LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting labview to stop after a certain time.

I'm trying to get labview to stop running after a set time? I have a load cell attached to a NI ELVIS board and once the set load is read by labview it's outputting a voltage thourgh the board but continuesly till the load is removed. I would like to ouptut the voltage to stop after a certain amount of time with the load still on the load cell.
0 Kudos
Message 1 of 5
(6,690 Views)

I'm a little confused by your description.  You say you are reading a load cell from the board.  What voltage are you writing to the board and why?  Please post some code.Smiley Wink

If you want labview to stop, you just need to wire a stop condition to the stop terminal of the while loop that surrounds your code.



Message Edited by Ravens Fan on 05-07-2008 04:08 PM
Message 2 of 5
(6,682 Views)
Here is another example... same result different method.  Enjoy!
 
SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 3 of 5
(6,666 Views)

I just noticed there is an error in the 2nd post. The current time + 10000 (this is in sec not ms). Thanks!

0 Kudos
Message 4 of 5
(6,291 Views)

@bmira1 wrote:
I would like to ouptut the voltage to stop after a certain amount of time with the load still on the load cell.


Of course stopping LabVIEW (as described in the post title) and stopping an output voltage (as described in the post body) are two completely different things! Blindly stopping LabVIEW will not necessarily reset any active analog output to zero.

 

Best would be a simple state machine that changes the output to zero after a certain elapsed time. This could for example be done with the timeout case of an event structure or even with the "elapsed time" express VI (or with the code fragments given above after you make sure there is a small wait in the polling loop)

 

When the experiment starts, write a certain voltage to the output once (You don't need to do that over and over, only when the voltage changes) and, after the time has elapsed, write a zero voltage to the output.

 

No need to stop LabVIEW. You should actually disable or catch "panel close?" events and other abnormal shutdown attempts, and reset the outputs in an orderly fashion before allowing the program to stop.

0 Kudos
Message 5 of 5
(6,270 Views)