06-25-2010 09:37 AM
Thanks. One more layer of the onion. I read the example. Thanks for the link...It should be put into the tutorial so that I don't have to waste 2 days finding it. Now, once I read the example, like so many others, it does not relate to the problem that I have. It is a general example and does not address the use of the ezlite board for handling interrupts from the buttons. In the vi.lib associated with my lv20098 file...there is no function name corresponding to ezlite button push... Where does one find that? (If I have to go to some example and pull a copy and install it in the library, why don't you modify the update install function so that gets done and we don't have to waste your time and mine doing this...
Where is it?
Hummer1
06-25-2010 09:49 AM
Hummer1,
I don't quite understand what you are looking for. The interrupt functionality is built into the DeviceStub.dll and is called from the callback.vi. This callback.vi is used through the VI reference in the main.VI. When a button is pushed, the function in the dll sees that and passes that information to the Button Number global.vi. This just holds a numeric value of what number was pressed. Here are some pictures showing the Call Libraray Function Node inside of callback.vi and the configure window for that CLFN that says what function has been selected:
06-25-2010 10:08 AM
Ok. Why do you have to do that when there is a Get Pushed Button.vi in the ez-lib? Is that the same thing...? I think the same dll is imbedded in this vi...
06-25-2010 10:25 AM
Hummer1,
Yes, it is using the same function inside of the DeviceStub.dll. If you open up the block diagram of the Get Pushed Button.VI and double click in the orange area of the Call Library Function Node, you can see that it is configured to use the lv-adi-ezGetPushedButton function as the other one. You can use this VI and acieve the same functionality as the shipping example.
06-25-2010 10:28 AM
Superb...would suggest that you modify the diagrams in the help function and tutorial to indicate that.
Thanks a lot for walking through that with me.
Hummer1
06-28-2010 11:16 AM
Here is the working example using the LV functions rather than the dll calls.
May I suggest that you mention the following in your tutorial or example
General:
You will be creating two vi's and a global variable. One of the vi's will be designated as the interrupt handler and the other will be the main. The Global variable will be used to pass the number of the button that is pressed on the board from the interrupt handler to the main program.
Vi Construction
Interrupt handler:
Start with the interrupt handler. Place the Get Button Number.vi function from the blackfin/Buttons/ function on the block diagram. Place a global variable on the block diagram by selecting a global from the programming/structures/global vi. functions. Double click the global variable and place a numeric indicator on it's front page. Then connect the output of the Get Button Number to the Global Variable input. Later, in the build process, we will designate this vi as an interrupt handler, but just save it for now.
Main:
Now build the Main program as shown. You can make the global by dragging it from the project file onto the block diagram and then making it a read function by right clicking on it and selecting "Change to Read".
Building the Project
To let the project know that the interrupt handler is an interrupt handler, go to the Build Specification and right click on the Debug Build. Select proberties/interrupt VI's. the interrupt handler, the global variable and the main program should be in the list on the left. Select the interrupt handler.vi and then the right arrow to move it to the interrupt VI's list.
Build the project.
Debug the project or run the project AFTER resetting the Black Fin board by turning it's power off for at least 10 seconds.
Grant, I have left a few things out that should be inserted by your help file and tutorial process. What I have noticed is that the examples and tutorials are horizontally based rather than vertically arranged. I mean by that that you (NI...not you personally...but generally)...you respond to questions asked by users on tutorials and examples by referring them to other discussions examples or help file references. This is under the assumption that everyone you are dealing with should be at a particular "perfect knowledge" level, and that if they aren't they should get there. A vertical example is one that includes direct references to each step of the operation with links to the specific help functions needed for the instance in the example.
One such problem is in the timing loop example I am going to work on next. In that example the value of using a text variable to select the timing source for the timing loop is discussed, but nowhere in the tutorial or examples are there a list of suitable timing sources and their text definitions. That is a critical part of the process and should be immediately associated with the mention of the use of the text variable.
Try these out and see what you think. If they are good, feel free to use them. I can't seem to get through the example submission process, which also needs a significant amount of cleaning up.
Hummer1
Program Theory of Operation:
In the attached diagram, when a button is pressed on the Black Fin board, the interrupt handler fires loading the global variable with the number of the button that was pressed. In the main program, the reference number of the interrupt handler will be passed to the BF Enable Button Interrupt. This data flow will create an ok error message that is used to start the while loop. Since the interrupt handler has already written the global variable value with the button number, it is available when the while loop runs, and is used to select which case is run.