LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clear, start, & stop programatically

I want to be able to press the run button, but for the program not to run until the start button is pressed. Also, after the stop button (of data aquisition) is pressed, I do not want the program to stop running. I want the user to be able to select more than one button, as in a clear chart button and run the program again. I cannot find any information on programatically clearing the chart also.
Thank you!
0 Kudos
Message 1 of 4
(3,055 Views)
For the program architecture, I would recomend using a state machine. There is an example called User Interface Event Example.vi. There is also an example called How to Clear Charts & Graphs.vi. Both of these are included with the version 6 distribution. Just click on Help>Examples.
0 Kudos
Message 2 of 4
(3,055 Views)
A state machine is your best bet for this type of application. A simple state machine template can be found in you LabVIEW directory under \Templates. There are other methods of building them, but this should get you started.

Basically you have a for loop with a case structure inside. Each case is a state of your state machine, ussually the default case simply checks the status of your controls and passes the next case name to the queue/shift register, which feeds the case structure with the next state in the next iteration of the for loop.

It's kinda hard for me to explain, so I made a quick example, see attached...

Hope this helps!

Brian
Message 3 of 4
(3,055 Views)
I noticed that you may be running LabVIEW 5.1, so I saved a copy of the example to version 5.0 instead of 6.0.2

Brian
0 Kudos
Message 4 of 4
(3,055 Views)