11-06-2013 05:49 AM
Hi everyone! I have a question about passing instructions between parallel while loops:
I basically have a VI which is made up of 2 while loops: inside one of the loops there is a state machine,
in the other one there is a case structure inside a while loop. I would like to set one of the cases in the latter loops as a start command for the state machine.
How can I do that? I've been reading about queues but I don't understand if they suit my needs....
Either way, can I use the state machine as one of the cases of my case structures (I mean, it would be like a while loop inside another while loop which I don't think
is advisable....)?
Thank you in advance.
11-06-2013 06:24 AM
This is sort of sounding like the Queued Message Handler (often also called the Queued State Machine). Queues are perfect for sending messages between loops.
11-07-2013 02:55 AM
So, I read something about Queued Message Handler but I haven't quite figured it out how to make it work in my case...
here is my problem: the state machine which I already have should not start from the same case each time, I need to decide (with a control on the front panel)
from which case it starts...I mean, I cannot create in the state machine somthing like a "start" case so how do I use the message handler?
Sorry if I'm not being clear or making silly questions, I've just started using LV's state machines and multiple loops...
11-07-2013 03:11 AM
@Turillo wrote:
So, I read something about Queued Message Handler but I haven't quite figured it out how to make it work in my case...
here is my problem: the state machine which I already have should not start from the same case each time, I need to decide (with a control on the front panel)
from which case it starts...I mean, I cannot create in the state machine somthing like a "start" case so how do I use the message handler?
Sorry if I'm not being clear or making silly questions, I've just started using LV's state machines and multiple loops...
Put an event structure in the start case , register for front panel events and according event run the state machine.
Re read again QMH and other design pattern slowly you will be able to handle them.
Asking any type of questions are okay , if you give a try to suggested methods and post them.
11-07-2013 03:30 AM
Hello Turillo,
I made a little example VI, try it.
11-07-2013 03:33 AM
I'm sorry, I'm not able to upload the VI, when I attach it, I cannot post the message, I get the error message "The contents of the attachment doesn't match its file type." It even doesn't work with a Zip file.
I'll make pictures...
11-07-2013 03:45 AM - edited 11-07-2013 03:46 AM
Ok, here are the pics of the little VI
It is easy to create if you use "Duplicate Case / Event"
11-07-2013 03:46 AM
Thank you Dave! As soon as you'll post the pictures I'll be more than glad to give a look at them!
Neos, thank you to you too...I'll try your suggestion and I'll let you know if it works!
11-08-2013 02:50 AM
I finally made it work using the event structure which activated a start case in the state machine....
Thank you again!