LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re-Entrant State Machine

Greetings! About a year ago, I created an application that controls a lift that moves barrels through 1 of 4 different sequences. I coded a state machine for each of the 4 sequences to allow multiple barrels to run at once since the sequences themselves had several minutes of wait after each step.
 
I'm trying to simplify my code and I was thinking of using just one re-entrant state machine and then passing the "sequence unique" information to it since all 4 state machines are nearly identical structurally. I want to make sure my assumptions on how it would work is correct.
 
1) A re-entrant state machine would allow 4 different "copies" of the state machines to run at once, all at different states, correct?
 
2) If I have a single VI that controls the lift inside the state machine, only one of the "copies" could use this VI at a time and the others would wait in line, correct?
 
Thanks for you help!
 
Jase
0 Kudos
Message 1 of 2
(2,958 Views)

Hi Jase.

1) You are right.

2) A non-reentrant VI can execute only once at a time - even if placed in a reentrant VI.
   This might be what you need (e.g. to control a shared resource).

Regards, Guenter

Message 2 of 2
(2,921 Views)