LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call chained states effectively with Producer Consumer design ?

In my consumer producer design, I have producer loop which is a GUI thread, and a consumer loop. Both are linked by a queue. The producer loop basically sends command and data to producer loop and then the producer loop will grab this data, do some processing and output to a string indicator.

 

Suppose there are 3 states A, B, C in consumer loop. Now I want to add state D which basically works as A → B → C → final data.

Without changing the way states A, B, C take in data, process data and output data. How can I design state D or if not possible, achieve the equivalency of state D ?

 

0 Kudos
Message 1 of 4
(3,025 Views)

I think you have the words "consumer" and "producer" confused in parts of your post. When D is triggered, you could just queue up all three other states at once for sequential consumption..

0 Kudos
Message 2 of 4
(2,997 Views)

For now I just put D in producer loop which gives data to state A, get the processed data, passed it on to B and so on.

I don't think it is possible to put similar code in consumer loop without modifying the way state A, B, C work (each state was given data and spit out processed data and nothing else). Am I wrong ?

0 Kudos
Message 3 of 4
(2,993 Views)

Your descriptions is not specific enough to give much advice. can you show us some simplified code?

What do the states actually do?

0 Kudos
Message 4 of 4
(2,976 Views)