02-13-2015 02:47 PM
I wasn't sure how to title this subject.
This is a statemachine that I am controlling from a "Master" statemachine. Maybe this is called Producer and Consumer. I need to pass state information from the producer to the consumer along with data elements.
I am a little confused with how I change states within the consumer loop without overwriting everything in the data elements. I hope I don't need to dequeue and then enqueue the data again.
Here is an image of my program:
Solved! Go to Solution.
02-13-2015 03:34 PM
Maybe you should describe everything this VI is supposed to be doing. I feel like you are overcomplicating things. What other "states" does this VI have and what do they do? Could you just post the VI so that we can get a better idea of what you are trying to do?
02-13-2015 04:00 PM
It's a test tool that uses User Input from the GUI to control things like Kloen Pumps, Mettler Scales, Validyne Transducer and some other stuff. Describing the entire program flow would be pages and pages and posting the project is impractical.
Maybe if I generalize the question it would be better. Hopefully I am using the correct terms here. Correct me if I say things wrong.
I am trying to move data through my program using the message part of the Queue, and not by using Global Variables or Property Nodes. I want to bundle them when I Enqueue the next state.
Say I have a producer state machine that I use to send user input and program generated data to a consumer statemachine. The consumer state can make some decisions internally as to what state it goes to next. The user presses Go and the Master State machine Enqueues the desired initial state and also sends the data needed in the Message part of the Queue. So far so good. I’ve done that.
Now I want the consumer loop to go to the next state. Is there a way to Enqueue the next state without overwriting the rest of the data with default data? I am currently writing a subvi that will Unbundle all the elements in the (I don’t know what it is called) message, allow me to change the State type def, and then Bundle it all back up. Seems like a lot of work just to change a state. I get the sense I’m going at this wrong but enqueueing and dequeueing message seems like a really slick way to move data around in (sort of) independently running loops.
Does that help?
02-13-2015 04:09 PM - edited 02-13-2015 04:11 PM
This is what I'm trying to avoid:
02-13-2015 04:25 PM
You do not need all that! Drop a Bundle by Name node with just one element. Pop up on the element name and Select Item.
Lynn
02-13-2015 04:35 PM
Too simple. Why was I overthinking it? That is exactly what I needed, and I totally knew how to do that.
Thanks,
Ross