LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enqueueing Message data without overwriting existing data

Solved!
Go to solution

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:

Queued Message.jpg

 

0 Kudos
Message 1 of 6
(2,904 Views)

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?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,884 Views)

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?

0 Kudos
Message 3 of 6
(2,876 Views)

This is what I'm trying to avoid:

UnBundleBundle.jpg

0 Kudos
Message 4 of 6
(2,870 Views)
Solution
Accepted by topic author RossM

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

 

Cluster bundle.png

Message 5 of 6
(2,856 Views)

Too simple. Why was I overthinking it? That is exactly what I needed, and I totally knew how to do that.

Thanks,

Ross

 

Bundle.jpg

0 Kudos
Message 6 of 6
(2,848 Views)