02-18-2013 04:36 AM
Hi everybody,
I apologize if my question is not well formulated but honestly I had hard time to formulate it correctly.. and thus I couldn't find the answer on the forum 😕 while it could be present
Here is the situation :
Imagine you have two VIs running at the same time. The first VI is dedicated to the control of, for example, the source of an electrical current while the second VI reads this current.
In each VI a sequence of subVI is run in order to either (first VI) control or read (second VI) the current source. An important constraint is that no read operation should be tried while the first VI is running its sequence of (control-)sub Vis and vice-versa.
In other words I would like to be able to send to the labview-queue a list of sub-VIS to run one after the other. Is it possible ?
For implementation reasons I need to keep two VIS running independently.
If the above explanation is not clear the situation is similar to the attached example where I would like the second VI to increment by +1 only when the 1st VI completed one turn of the while loop (+5 increment).
Again because of my implementation I don't want to share a variable or to send events between the two VIS. I would like to send to labview the five "+1" operations of the 1st VI, as a block of operations to run "in one time" (i.e. with no operations of the second VI inbetween)
Sorry for the big post but I tried my best to be clear 😉
Thanks a lot for the help
Alex
02-18-2013 11:11 AM
If they are talking to the same instrument, I would do everything in 1 loop and send the data out using a Queue or Notifier.
The other obvious option is to use an Action Engine.
02-18-2013 12:27 PM
crossrulz a écrit :
If they are talking to the same instrument, I would do everything in 1 loop and send the data out using a Queue or Notifier.
The other obvious option is to use an Action Engine.
Thanks a lot crossrulz for the quick answer.
Actually I really need to keep these two VIs that run in parallel, because my program is actually much bigger than the small example I gave.
If I understand well there is no way in Labview to send to tell the CPU :
"Once you start to execute this group of SubVI(or part of the block diagram), do not allow any other running VI to execute anything?"
02-18-2013 12:44 PM
@Alex1985 wrote:
"Once you start to execute this group of SubVI(or part of the block diagram), do not allow any other running VI to execute anything?"
Semaphores may serve your purpose for this. It is designed to keep 2 parts of code from executing simultaneously. I'm not sure how easy it would be to adapt it to this "one vs. anything/everything else" the way you are describing it.