LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For loop control

I am new to Labview, but do have experience with Java and C++. I am trying to troubleshoot an existing program that use to work for two devices working in conjuction with each other (SRS DSP SR830 Lock-In Amplifier and Newport Universal Motion Controller). I am moving the device under test (DUT) by 5 micron steps. For a total of 2000 microns. Then the contoller moves it back to the original position. At each step, the voltage (data) is read and written to test.txt. The program runs once successfully for 5 microns and then moves back 2000 microns. It should move 5 microns, read data, another 5 microns, read data, etc... until it reaches 2000 and moves back. Also when it reaches the end of the program the screen flashes a red and green outline box. Any help at look at this VI would be appreciated.
 
Thanks,
Andrew
0 Kudos
Message 1 of 3
(2,451 Views)


@usfoptics wrote:
Also when it reaches the end of the program the screen flashes a red and green outline box. Any help at look at this VI would be appreciated.

The second problem is easy. You accidentally placed a breakpoint on the background. Just use the breakpoint tool and click on the background until the red outline inside the window frame disappears.

The first problem is a bit harder because the code is deeply stacked into sequence structures and it is hard to get a good overview. In addition, all subVIs are missing. Maybe somebody has time to dissect it. 😉

0 Kudos
Message 2 of 3
(2,445 Views)
Your logic appears to be in error. The code shows you're taking a reading 400 times with a delay in between each reading, but you're not stepping the device in that process between each reading. So it steps once at the beginning, takes 400 readings with delay, then finishes up by moving it back to its original position (which it thinks was 2000 microns back/forward but in reality is only 5).

You can also make the code a lot simpler, cleaner and much more maintainable by doing more procedural steps rather than sequential steps (use as few sequence structures as possible, none is preferred).
0 Kudos
Message 3 of 3
(2,434 Views)