LabView Example for Steppers incorrect

Supporting Labview 2012 and up
Fresh meat
Posts: 1
Joined: Mon Jun 10, 2013 11:50 am

LabView Example for Steppers incorrect

Postby stevencovert » Mon Jun 10, 2013 12:04 pm


I came here for some general advise about structuring code in LV (2012) because I found the example code fails in the same way as my code :P

The problem is the in the Init section of the Case structure. It works until you try to change anything, in which case the state machine goes back to INIT, and calls the StepperOpen again. This crashes LV, because it is opening a reference that is already open.

I was trying to find a VI that could tell me if the handle is already open, and putting a test case in front of StepperOpen. Which leads me to my real question about structuring a LV program that calls a .DLL. My code is similar to the example, a state machine. There is an OPEN, a while loop that continues until STOP is pressed, then CLOSE. If something goes wrong and the program stops, the handles (or references) are still open and crash the next time you run the VI. Looking for a good way to detect this.

I have built an XY stage using the Phidget controllers and LabVIEW. It is pretty cool! I use a chart with cursors. I "grab" a cursor and move it withing the chart and the steppers follow along. I know my travel (and thus max counts). Set up the chart to show 0" to 1.000" (my range). So the chart is now your XY space. Now need to "solidify" the code :)

Any ideas?


Return to “Labview”

Who is online

Users browsing this forum: No registered users and 1 guest