LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State machine inside a state machine

Hello everyone,

My question is maybe stupid but is it possible to put a state machine in a state of a bigger state machine ?

 

0 Kudos
Message 1 of 5
(813 Views)

Short answer: Yes

 

But, there are probably better ways to accomplish it then that. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(798 Views)

Not a stupid question at all.  It IS done in many of the larger LabVIEW programs.  As long as you are sure you are not blocking program flow it can be a powerful technique.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 3 of 5
(781 Views)

Sure, many sub-vi's are implemented as small state machines, e.g. take a measurement from an instrument might be an Init, Measure, Close.

If the question is regarding bigger long running ones, it can quickly be problematic.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 5
(773 Views)

@WarThoG28 wrote:

My question is maybe stupid but is it possible to put a state machine in a state of a bigger state machine ?


The question is too vague. An inner state machine probably would need to be "transparent", i.e. not block the outer state machine form executing by trapping the dataflow in an inner loop. You can simply maintain a second state across all code that is used in some inner code.

 

It typically helps to explain what you want to do, not how you want to do it. Can you explain the purpose of all this from a wider perspective? I am sure we can come up with a suitable architecture that satisfies all your requirements.

0 Kudos
Message 5 of 5
(765 Views)