LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Statechart Module - Is transition priority possible?

I am using LabVIEW's Statechart Module to build a synchronus statechart that is called within a Timed Loop from another VI. Within the statechart, each transition is configured to occur on the NULL trigger, but can only take place if its guard evaluates to true. I have a state that has 2 transitions out of it, where each transition has a different guard. Since my Timed Loop executes relatively slowly (once every few seconds), it is likely that both guards could become true between subsequent calls to the statechart.

If this happens, which transition will occur? Does LabVIEW have some kind of priority that I can assign to transitions to ensure that if multiple transitions are possible, a particular transition will execute rather than another?

I have attached a simple example that should illustrate my point. In this example, if the statechart is in State 1, and both Input A and Input B change from false to true within the same 3000ms period, will Transition A or Transition B take place? More importantly, how can I force a particular transitions to occur in these circumstances?

NOTE: The Run Statechart function in Example Caller VI.vi may need to be re-linked to Example Statechart.lvsc by right-clicking and selecting "Link to Statechart...".

I would greatly appreciate it if someone could shed some light on this subject. I have found nothing about this on the web, but maybe I'm just not looking in the right place?
Download All
0 Kudos
Message 1 of 3
(2,676 Views)
Nevermind, I have answered my own question. See the following link.

http://zone.ni.com/reference/en-XX/help/372103A-01/lvschowto/sc_h_transprior/
0 Kudos
Message 2 of 3
(2,670 Views)
Hi,

You can specify the order in which the transitions are evaluated. Right click on your State 1 and choose "Set Transition Priorities..." The statechart will enter a mode where you can see the old assigned priorities (gray numbers on white background) and the priorities you are setting (white numbers on black background). You click each transition beginning in the order you want the transitions to be evaluated. When done, click the checkmark in the top left of the diagram. Lower numbered transitions are evaluated first.

If you go to the built-in LabVIEW help (help menu > search the labview help) and choose the search tab and search for "transition priorities", one result should be "setting transition priorities". This topic basically describes what I just said in the paragraph above with a few more details.

Hope that helps,
Nick
0 Kudos
Message 3 of 3
(2,664 Views)