06-02-2016 12:15 PM
Hey everyone,
I believe this is a very simple problem, but I've been trying to figure it out, and I am in the same question.
I am testing parallel events for future application and eventually I understood my STOP buttons are not working. I am creating a sinusoidal wave to simulate my signal and I want to be able to stop/pause the acquisition if needed. However I can't stop it, neither I can now exit the program after starting the acquisition (and after it is finished).
Maybe someone can give me some tip? I attached the .vi
Thank you!
06-02-2016 12:29 PM - edited 06-02-2016 12:29 PM
Hi Rhen,
did you read the "Do's and Don'ts" mentioned in the LabVIEW help for the event structure?
- You should avoid stacking event structures inside of event structures!
- You should avoid waiting for events when you have configured your event to process new UI action only when the current event has been handled!
- You should avoid long execution times in event cases!
- many more…
And: try to reduce local variable usage…
06-02-2016 12:35 PM
All events should be in the same event structure. Use a
Queued Message Handler or
notifier to control parallel loops. There are multiple examples on ni.com and your examples in labview.
06-02-2016 12:42 PM
Hi GerdW,
Thank you for the fast answer!
I guess I did read it some time ago, but maybe I should review it again!
Anyway, the event structure inside the event structure is to disappear. I used it because in the first test the small while cycle was out (to test parallel behaviour).
How can I handle an acquisition otherwise without an event then? I need to choose when to start acquiring. Should I simply use a case structure out of the event case?
About your second point (" You should avoid waiting for events when you have configured your event to process new UI action only when the current event has been handled!"), I didn't really understand what it means...
Abour local variables, I guess I got "addicted" to use them. I'll try to reduce them! Btw, is it better to use property nodes? Or should I simply connect wire as much as possible?
Thank you once again!
06-02-2016 01:03 PM
Hi Rhen,
maybe I should review it again!
Yes…
I didn't really understand what it means...
Read the LabVIEW help on the event structure and all options for event cases!
Btw, is it better to use property nodes?
No, they are even slower…
Or should I simply connect wire as much as possible?
LabVIEW follows the DATAFLOW: use wires for DATAFLOW!