07-13-2011 08:03 AM - edited 07-13-2011 08:08 AM
Hello everyone,
I have several queued state machines some which drive hardware and others that are driven by events occuring at the GUI etc.. and i would like to make them in subVis + enable parallel processing between all of them. Also i would like to disable some of GUIs controls which have events
I have 3 questions:
How do i enable parallel processing? if you could point to some material i could study etc would be nice.
How do i pass notifieers and queues to subvis?
How do i disable controls that respond to events?
Cheers
07-13-2011 08:08 AM
if you want to pass the queue/notifier reference to a subVI you need a connector. Just create an indicator from your reference then change it to a control that you copy then paste into your subVI.
What do you mean by "parallel processing"? Is it reentrant execution?
07-13-2011 08:13 AM - edited 07-13-2011 08:15 AM
Hi Roderic,
The Hardware queued state machines will be controlled by the main loop and they would need to run in parallel with the main loop and never exit until the main loop has being instructed to exit.
I have posted a part of my code basicly the main loop will have 4 stages, idle where it just get data from the user, ok where the normal process will start and all queued state machines will be called from there in a specific sequence according to the type of measurement etc.
Cancel where the code will stop close resources based on where the execution of OK was halted
Exit where all the queues are discarded etc to shut down the program properly.
I just want to remove all those hardware loops and make them into neat looking Subvis so the code is more readable later on
07-13-2011 08:44 AM
You can do that, as long as they don't use any local variables or property nodes of a control or indicator in the loops. For most of the sub vi's the only inputs will be the error cluster and a queue reference.
I would also combind all GUI operations in one loop.
07-13-2011 09:35 AM - edited 07-13-2011 09:37 AM
In some loops i read local variables / write to some locals of the GUI , should i make those globals so that they can be transfered?
And also how do i make these subVis run parallel to the Main loop and GUI?
If i created the subvis and pass the queue references etc would it work in parallel or should i call the Vis using call reference Vi or some other method?
i just noticed i sent an old version of my program here is the normal one