LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

statechart external queue

Is there a way to see the external queue of a asynchronous statechart?
0 Kudos
Message 1 of 6
(3,393 Views)
Hello TOBR

I would be glad to help you with your question, but i will need further information on the problem:

- Witch NI Product do you use for your application? [developement system and toolkits / modules used]

- What exactly you mean with "asynchronous statechart"? Maybee you can attach a simple example code to your reply.


0 Kudos
Message 2 of 6
(3,334 Views)

Hello TOBBR,

There is not currently a built in way to view the items in the external queue for the LabVIEW StateChart Module.  One possibility for now would be to use a synchronous statechart and implement your own external queue using the built in LabVIEW queue functions.  Did you have a specific use case in mind?

 

Regards,
Angela M
Product Support Engineer

0 Kudos
Message 3 of 6
(3,286 Views)

If the statechart external queue is implemented Labview-internally as a normal Labview queue then it should be possible to access the queue using the "Obtain "Queue" VI, given that that the instance name of the queue is not a random string but can somehow be derived from the instance name of the statechart (e.g., if the instance name of the statechart is "my_statechart", the instance name of the external queue might look like "my_statechart_external_queue".

 

- Is the external queue indead implemented as a Labview queue?

- If yes, how is the name of the queue instance created?

 

I am also very much interested in accessing the external queue because in my case, I have an event structure sending triggers to the statechart via the external queue upon value changes of front panel controls. In the case of knob and slider controls, value change events can occur at a much higher rate than the statechart is able to handle, which leads to an accumulation of triggers within the external queue and thus an increasing delay in statechart reaction. If I had access to the external queue I could check whether a given trigger is already in the queue before inserting it again.

 

Thanks in advance for any hints.

0 Kudos
Message 4 of 6
(3,202 Views)

Hello dlanger,

I don't think there will be a way to get the queue information as you described, but I would have to do some more investigation to know for sure.

 

In the meantime there are a few alternatives.  This has been encountered in regular LabVIEW programming and there is a KB that gives some suggestions for some slide logic that will avoid generating so many events.  See KB

Ignoring a Value Change on a Slide Control for more information about that workaround.

 

Another option, depending on your code would be to setup some sort of guard on the transition.  If the guard prevents the transition for a few quick fired events the triggers get discarded, this would avoid enqueueing too many triggers very quickly.  The guard could be something like waiting a few milliseconds between triggers before transitioning.  If you have questions about this implementation, please post back.

 

Regards,

Angela M

Product Support Engineer

0 Kudos
Message 5 of 6
(3,184 Views)

The queue is indeed implemented internally as a LabVIEW queue, but that is not something we wanted users to have to be aware of, and it is always possible the implementation could change someday.

 

If you want advanced trigger queue management, I would strongly recommend creating and managing your own LV queue and using it with a synchronous statechart. This is really pretty straightforward and gives you the opportunity to have more precise control over the enqueue/dequeue behavior. Let us know if it isn't clear how you would do this.

0 Kudos
Message 6 of 6
(3,179 Views)