LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time controlled boolean button for turning powersupply ON and OFF

Use Shift Registers to pass data between iterations of your loop.


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 11 of 15
(418 Views)

@crossrulz, you mean to add one while loop around case structure and than add shift registers?

0 Kudos
Message 12 of 15
(387 Views)

Forgive me for "cutting in line", but what @crossrulz means is to add another shift register to the While Loop that surrounds the Case Statement (that combination is "the State Machine").  If you are in State A and in this State, you decide to set some value in the next State, you wire the Value to the "My Value" Shift Register, the next State into the Next State Shift Register, and exit the current state.  When you get to the "next State" and need to use the value, its right there on the "My Value" Shift Register.

 

Note that you might have several different values that you use in your program (let's say, 15 of them).  Does this mean you need 15 Shift Registers, one for each Value?  You could do that, but the wiring would be (and look) "messy".  Instead, make a Cluster that has the 15 Values in it.  To add a new Value, do a "Bundle by Name" and put the new Value in to the proper "slot" in the Cluster.  To use a value, simply do an Unbundle by Name.  [Do you see how useful the "by Name" versions of cluster Bundle and Unbundle can be?]

 

Bob Schor

0 Kudos
Message 13 of 15
(384 Views)

Thank you for your answer. 

 

And where to put a cluster, outside case structure but inside while loop?

 

 

0 Kudos
Message 14 of 15
(379 Views)

Outside of the While Loop. Drag the wire to the While Loop then right-click and select Replace with Shift Register.

 

Eric1977_0-1670349052316.png

 

Read up on how to use Shift Registers

 

0 Kudos
Message 15 of 15
(367 Views)