LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change control values during SubVI call of a State Machine

Hi

I'm developing two JKI State Machines to control two Modbus Units.
I want to keep their respective control in a state machine, such that they can be used stand-alone.

 

Now I want to combine these State machines as Sub VI to do various automated control. How can I call a JKI State Machine as a Sub VI and during its call change some control values, like programmatically pressing a button to enter a new state?

0 Kudos
Message 1 of 2
(512 Views)

Hi,

 

I'm not familiar with JKI SM specifically, so ma answer will be broad about communikation with a sub-vi.

 

There are several ways, but the main idea is to make this communication follow a "by reference" approach, instead of LabVIEW's usual "by value" approach.

 

You could pass a queue into the subvi. You could the feed the queue in the caller and consume it in the sub-vi. (Queue are for one consumer only though)

You could use user events in a similar fashion. This could work with multiple such sub-vis simultaneously.

You could obtain references to the buttons in your sub-vi and pass them to the caller (via FG e.g.) and "press" them with property nodes (works only if mechanical action is switch)

 

Hope these are some good starting points.

 

0 Kudos
Message 2 of 2
(506 Views)