04-18-2023 09:10 AM
Hello everyone,
My question is maybe stupid but is it possible to put a state machine in a state of a bigger state machine ?
04-18-2023 09:45 AM
Short answer: Yes
But, there are probably better ways to accomplish it then that.
04-18-2023 10:24 AM
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.
04-18-2023 10:33 AM
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.
04-18-2023 10:53 AM
@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.