|Download Help (Windows Only)|
Each Run Statechart function represents a separate copy, or instance, of a statechart. Because this function is reentrant, you can call multiple statechart instances simultaneously. You can call multiple instances of both asynchronous and synchronous statecharts.
The following figure shows a single caller VI that calls two instances of the same asynchronous statechart.
In the previous figure, notice how the caller VI contains two instances of the Run Statechart function. Each instance has a unique Instance Name, which separates the external trigger queues from one another. When you click the Button front panel control, the Send External Trigger 1 function sends Trigger1 to Statechart 1 while the Send External Trigger 2 function sends Trigger2 to Statechart 2. Also notice that both instances read the same input data but write to different output data.
|Note This example uses the caller VI to send triggers to an external queue. However, as long as the caller VI is running and the statechart is in memory, you can use any VI to send triggers to an external queue. This behavior means that you can place the Trigger Loop and Statechart Loop in separate VIs.|