LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Breaking Sequences

Is there any way to break out of a sequence, in say, the 3rd (out of 😎
frame?

--
Slade Squire
Programmer
Rectifier Technologies Pacific
Melbourne, Australia
SladeSquire@rtp.com.au
0 Kudos
Message 1 of 6
(3,178 Views)
No. If you want this functionality, you have to replace the sequence with a
case structure, put the whole thing inside a while loop and use a shift
register to allow frames of the case structure to determine the next frame
that should execute.

This is (mistakenly IMHO) referred to in the Labview world as a "state
machine".

Slade Squire wrote in message
news:9tcnr7$71q$1@perki.connect.com.au...
> Is there any way to break out of a sequence, in say, the 3rd (out of 😎
> frame?
0 Kudos
Message 2 of 6
(3,178 Views)
Sorry, this is a little off topic, how would you define a state machine in the LabVIEW enviroment?

Brian
0 Kudos
Message 3 of 6
(3,178 Views)
Brian Vibert wrote in message
news:506500000005000000D34E0000-1005954886000@exchange.ni.com...
> Sorry, this is a little off topic, how would you define a state
> machine in the LabVIEW enviroment?

A state machine, as far as I'm aware, is defined as a structure that yields
a given set of outputs for a given set of inputs. As such, the control logic
that determines which frame to execute is the state machine, not the case
structure itself.

Maybe you could argue that the case structure is a state machine because for
a given case selector input it produces a given output. In all but the
simplest of programs, though, the case structure output does not depend
solely on the case selector input.
0 Kudos
Message 4 of 6
(3,178 Views)
So, I think what you are trying to say is that the configuration you described in the answer to this question (case structure, inside a while loop, shift register, ...) has several variations, and one is a state machine.

If other variations are appropriately defined, here you have something for an article or something.
www.vartortech.com
0 Kudos
Message 5 of 6
(3,178 Views)
Enrique wrote in message
news:506500000005000000F34E0000-1005954886000@exchange.ni.com...
> So, I think what you are trying to say is that the configuration you
> described in the answer to this question (case structure, inside a
> while loop, shift register, ...) has several variations, and one is a
> state machine.

Not really, only the simplest example case could be a state machine- and
that only because it would be written for the hell of proving that a case
structure in itself can represent a very limited state machine, where the
state of one input governs the output states. In real cases, the state
machine is the "glue logic" and not the case structure. Generally in complex
programs I do, I have a state mach
ine sub-VI that's called either in a
"housekeeping" frame or inside the enclosing while loop before the case
structure is reached. This takes a Boolean array of the various conditions
along with a truth table and outputs a number corresponding to the current
state of the system. This number determines which frame of the case
structure is to be executed next. Essentially the case structure is a list
of tasks that must be done in response to the conditions identified by the
state machine.

Most "state machine" apps don't require this level of complexity, but it's
still the case that the state machine is that which determines what the case
structure will do next, and the case structure is just the set of tasks to
execute in response to particular situations.

> If other variations are appropriately defined, here you have something
> for an article or something.

That implies time to write. And afterall, to most people the distinction is
as relevant as the difference between mass and weigh
t.
0 Kudos
Message 6 of 6
(3,178 Views)