LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array data lost after one execution

Hi
 
Can anyone help me?
 
I am using Labview 6.1 on Windows XP and the program code moves a linear actuator forward and reverse until an optical sensor is triggered whilst aquiring voltages.
 
Once I have created an application with the application builder the voltage aquiring only occurs the first time I run the test, subsequent tests (after investigating) does not build the array.
 
The program runs no problem if I just use Labview and not the executable.
 
Any suggestions on what I am doing wrong?
 
Cheers
 
Ian
 
 
0 Kudos
Message 1 of 6
(2,842 Views)
Would it be possible for you to upload your VI?
0 Kudos
Message 2 of 6
(2,826 Views)
Hi
 
I have attached the vi below. I have managed to drill down my application to this vi being the problem.
 
Cheers
 
Ian
0 Kudos
Message 3 of 6
(2,823 Views)
Is this VI being called multiple times?
 
If it is running only once, that tells me either the conditions to enter the TRUE case structure isn't occuring
the second time, or that the TRUE case structure is entered but that the Trigger Detected remains true
so the two WHILE loops do not run.
 
0 Kudos
Message 4 of 6
(2,815 Views)
And one thing you could do is combine the acquisition of both channels into a single read and a single loop. Each time AI Sample Channel is called, it calls AI Read One Scan which does an AI Config each time. You would be much better off doing a single AI Config outside the loop and then an AI SingleScan of both channels inside the loop.
0 Kudos
Message 5 of 6
(2,809 Views)

Hi

Thanks for your help - the bottom while loop was picking up the previous trigger state and finishing instantly, hence the actuator moved but no aquisitions took place. The first action now is to clear the the trigger.

I have also decided to tidy the vi up as suggested with the one loop and AI sample channels.

Thanks Again!!

Cheers
 
Ian
 
Smiley Very Happy
0 Kudos
Message 6 of 6
(2,790 Views)