LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing data between states of the state machine

Solved!
Go to solution

Hello everybody,

 

I am using a state machine design and want to pass the data from one state to another one. For that I am using a shift register. But at that point I face a problem: The data is transformed from 'right side of the shift register' to the 'left side of the shift register' succesfully but when it enters the desired case structure its value changes to zero.

 

In more detail: I want that the max. and min. delay values calculated in the 'Set Initial Delay' case to be handed out to the 'Set Delay Value' case for further operation. When the data leaves the left shift register it still has its own desired value but as it enters the case structure ('Set Delay Value' case) it gets deleted and a zero is given to the case. What am I doing wrong in this and how can I fix it?

 

LabView Version:17.0.1f3 (64-Bit)

 

Any help is highly appreciated.

Best regards,

Ecafer

 

P.S: In the attachment there is also two pics of the relevant cases to the data transfer.

P.S: This didn't quite help to solve my problem.

 

 

Download All
0 Kudos
Message 1 of 3
(1,240 Views)
Solution
Accepted by topic author ecafer

You problem is your case structure has the output tunnels set to "Use Default If Unwired".  So your flow goes Set Initial Delay->Wait For Event->Set Delay Value.  You did not wire the value through the Wait For Event state, so the output tunnel will output 0, which then gets stored in the shift register.  Luckily, the fix is fairly simple.  First, turn off the User Default If Unwired for all of your output tunnels associated with your shift registers.  This is actually recommended for all case structure tunnels with some exceptions such as the loop stop condition.  Second, you can right-click on a tunnel and choose to "link tunnels".  One of the options is to link and wire unwired cases.  This will create a "link" between an input and an output tunnel so that when you create a new state, your values will automatically wired through.  Granted, you will definitely need to do some clean up after you do this.


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
Message 2 of 3
(1,227 Views)

Thanks for the quick and understandable reply. It worked.

0 Kudos
Message 3 of 3
(1,211 Views)