LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer data between the different states in "state machine"?

I want to transfer some data from one state to another. I tried the tunnel, but it can't work since it's the case structure. Does "state machince" support data transfer? Or any other methods I can do?

Thank you.
0 Kudos
Message 1 of 17
(5,610 Views)
Typically, you would keep your data in a shift register so it is avalable in all states.
0 Kudos
Message 2 of 17
(5,608 Views)
Are you using the State Diagram Editor toolkit, the State Chart or a state machine of your own?

Cheers!
0 Kudos
Message 3 of 17
(5,607 Views)
Yes, I am using State Diagram Editor toolkit.
0 Kudos
Message 4 of 17
(5,593 Views)
altenbach nailed it on the head, keeping the data you want to pass in a shift register is the way to go. 

Cheers!
0 Kudos
Message 5 of 17
(5,589 Views)
Do you mean to add a shift register on the outer while-loop? I tried that but still didn't work.


0 Kudos
Message 6 of 17
(5,588 Views)
Yes, adding a shift register to the outer while loop should work, make sure to initialize it.  Perhaps you could attach your vi so we could have a look at it.  Be sure to give us as much info as to what your goal for the vi is.

Cheers!
0 Kudos
Message 7 of 17
(5,585 Views)
It can work. But what I want is some data only used in certain states not all the states.
If I used the shift register, I need to wire the registers in all states.
0 Kudos
Message 8 of 17
(5,580 Views)
That is true, but you dont have to access the data from the shift register in every state, you can simply pass it through.  It may be a hassle to do the extra wiring but it will be your best solution.

Cheers
0 Kudos
Message 9 of 17
(5,578 Views)
well, Thank you very much!
0 Kudos
Message 10 of 17
(5,576 Views)