LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need status led for application

I have a prog that reads a gpib dev every second and I would like to have an led that turns on when the app starts and turns off when the app ends. The problem I have is the nonlinear execution of LV code seems to keep me from implementing this old fashioned pseudo code:

turn non led
while DIO_bit_1 not set
read gpib
wait 1 sec
end while
turn off led

All my attempts to use shift, local, and while loops have failed. The solution escapes me.
Can anyone help?

Thank you,
0 Kudos
Message 1 of 4
(2,593 Views)
Place a sequence structure around your code. It allows you to artificially control the order of execution.

___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,583 Views)
Since LabVIEW is a dataflow language, code execution is linear when you use data dependency. Here's a simple example. A local variable is set prior to the while loop. Since there is data flow from the Boolean constant to the while loop, the local variable will be set before the while loop runs. When the while loop finishes, the data flow from the stop condition to the LED indicator means that the LED will turn off when the while loop finishes.
0 Kudos
Message 3 of 4
(2,583 Views)
Thank you,
Dennis your example is great, it does exactly what I need and I may even understand it!
0 Kudos
Message 4 of 4
(2,567 Views)