I am a beginner of the labview, I appreciate if you can help me out.
I have been doing to create a start and stop button for my program, but I got some trouble for creating a start button to make it in same status with stop button...
When I try to put a event structure outside of my while loop, the stop button inside the while loop won't work anyone, I don't know what should i do to deal with this situation, could u plz help me? Also I have a 'export' button to export the measurements, how can I to make it can be pressed anytime after I press the start button?
Thanks in advance!
Your program looks good and I don't think there should be any problem with the stop button unless the program gets stuck in any of the subroutines.
If you want to export the data any time after the program starts the put the event structure inside the while loop. Notice there should be a timeout event with a timeout as per your requirement and there should be another event which is linked with the export button.
your block diagram can be improved: after using AutoCleanup it immediatly fits into just one FullHD screen…
Thanks for your reply and your great advice!
I don't know if I understand it right, so I moved my 'data flow' event into the while loop, is that correct?
Also, what I mentioned at the beginning is that if I put a event structure outside my while loop and use a 'ok' button to control the it(which is shown in the new VI), the loop won't run in number of iterations and I can't use the stop or export button after I pressed the ok button...
One more question about the data flow, which is that I create one more case structure to let the user be able to use more channels, but the data saving can't accept more than one flowing into it, what should I do?
Really thanks for your time!
what should I do?
Read the LabVIEW help on the event structure. And the linked Caveats article!
Placing the event structure around your while loop is wrong.
Placing another event structure inside the loop inside the event case is wrong.
LabVIEW comes with a huge example library: did you examine the examples on event structure usage?
Your second example is worse than the first for the reasons that GerdW has already noted. You should definitely look at some examples. You don't really need event structures for what you want to accomplish, though. Just put a case structure inside your loop and connect a Start/Stop button to it. No need for two buttons. You can do the same for your logging. No need for an event structure there either. As GerdW mentioned you should move your open and close connection outside your loop so that you're not performing this action every time through the loop.
I will go through the examples and the labview help, thanks for your advice!
Thanks for your advice, just start the labview programming and still need to improve a lot. Anyway, thanks for our advice!
Am not an expert but if I can help, I uploaded a test example for you. The start boolean should be inside your events box. And the stop can be activated using another events.
If you do not put a while loop around the events box, it will run only once. If you put a while loop around the events box, it will run over and over until the stop condition to stop that loop is activated.
If you have more questions and if I can help, will be glad to do so.