LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing out different variables in a stacked sequence to the same indicator

I have a consumer producer program right now.

 

The consumer portion uses one sensor measurement, and then calculates 5 double constants based on this inital sensor (using a LUT). (--> program 1, program 2)

These 5 variables indicate different lengths of time for each of the programs to run (which are in a sequential order).

The programs control the same two indicators.

 

Right now I have a spaghetti of boolean statements based on the iterations, (if program 1 < iteration < program 3 --> runs program 2), which comes out to true or false after several layers which turns indicator on or off.

 

 

i am trying to create a stacked sequence, but I get a "A tunnel on this wire cannot determine whether it is an input or an output. Connect the tunnel to exactly one source terminal to set the direction of data flow." when I try to control the indicator from out side of the stacked sequence. (having an indicator in each case structure creates some kind of race condition.

 

 

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

Post your code (or at least a simplified example). There's almost never a reason to use the stacked sequence structure (it hides code, can't be interrupted etc.).

 

What you want to do can be done - for example using local variables (race conditions) or by having a separate 'UI' loop which updates the indicator while it runs.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 4
(3,521 Views)

Use a state machine instead.  It should help clear up your speghetti of boolean logic as well.



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 3 of 4
(3,518 Views)

Output of the structure (stacked sequence) is available only after all structure finishes. To make indicator change while frames execute, you will need to use local variables inside frames.

Disclaimer notice: The above statement is only to explain data flow concept, and in no case suggest to use stacked sequence, sequence locals and local variables (they are evil).

 

Will case structure inside a For loop work? You can wire integer to the case selector and set frames for intervals of this integer (or better use enum).

 

for+case+enum.png

Message 4 of 4
(3,507 Views)