LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Order of static reactions - Statechart Module

After studying the article describing the code generation for Statechart Module logic, it appears to me that static reactions within a given state will execute in the order they are created -- which is the order in which they are listed 'Reactions' list pane.

 

If I have several static reactions in a given state, can anyone verify my suspicion or educate me as to how to know the order data flow within a state?

0 Kudos
Message 1 of 12
(3,616 Views)
You are correct. The static reactions will execute in the order they are listed in the configuration dialog, which is precisely the order in which they were created.
0 Kudos
Message 2 of 12
(3,615 Views)

Thanks very much.

 

This prompts a needed feature in the Labview State configurator: the ability to change the order of static reactions.  I understand that Entry and Exit actions must be at the top of the list, but there is no way I see to change the order of static reactions you create without deleting them and re-creating them in the order you need.

0 Kudos
Message 3 of 12
(3,592 Views)

Jonathan Fazekas wrote:

Thanks very much.

 

This prompts a needed feature in the Labview State configurator: the ability to change the order of static reactions.  I understand that Entry and Exit actions must be at the top of the list, but there is no way I see to change the order of static reactions you create without deleting them and re-creating them in the order you need.


I agree this would be very nice to have. There is a viable workaround (deleting and recreating in the order you need), but that is kindof painful, so hopefully this functionality will be added in some future release.

0 Kudos
Message 4 of 12
(3,582 Views)

To test this behavior I made a static reaction just now with six static reactions in which the order of execution is logged to disk.  I noticed that when I compiled the statechart (whatever happened to compile as you program?) and re-opened the Configure State panel, the reactions are slightly reorganized such that the reaction I desired to run sixth is now running third in the list!! 

 

I think there may be other factors influencing the order in the reaction list pane other than time of creation.

0 Kudos
Message 5 of 12
(3,575 Views)

Jonathan Fazekas wrote:

To test this behavior I made a static reaction just now with six static reactions in which the order of execution is logged to disk.  I noticed that when I compiled the statechart (whatever happened to compile as you program?) and re-opened the Configure State panel, the reactions are slightly reorganized such that the reaction I desired to run sixth is now running third in the list!! 

 

I think there may be other factors influencing the order in the reaction list pane other than time of creation.


Ouch. That's definitely not supposed to happen. Which version of LV are you using? I will try to reproduce it and create a CAR for this bug. Thanks for the info/help.

0 Kudos
Message 6 of 12
(3,572 Views)

If you want to email me or create an SR I'd be happy to respond with some screenshots demonstrating this observation.

I'm using 8.6.

0 Kudos
Message 7 of 12
(3,569 Views)

If you can give me the exact steps you did that gave the wrong behavior that would be great. I tried a little creating reactions and they seemed to stay in the order I created.

 

You could either respond here, or if you would prefer to email or create an SR, let me know and we can do that. Thanks.

0 Kudos
Message 8 of 12
(3,565 Views)

Here is how to recreate:

  1. create five reactions named 1,2,3,4,5
  2. compile statechart
  3. delete reaction 3
  4. delete reaction 2
  5. click on reaction 4
  6. create a reaction named '2'
  7. create a reaction named '3'
  8. compile the statechart

I would expect the  reaction list to show in this order, 1,4,5,2,3 but it really shows 1,2,3,4,5.

Looks like using the same name as a previously deleted reaction may be a part of the issue.

0 Kudos
Message 9 of 12
(3,560 Views)
Ok, thanks. I will dig a bit and then have a CAR number for you and more details, hopefully this afternoon.
0 Kudos
Message 10 of 12
(3,557 Views)