LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure misses events

Hi,


I've got an event structure with events reading all my inputs, and one dynanmic event running every 10 ms.  The dynamic event is a pretty heavy piece of code.

 

It works swell, except that sometimes the events generated by inputs from the front panel are ignored.  Is there a way around this?  A screen shot of my code is attached.

 

Thank you!
Christopher

0 Kudos
Message 1 of 15
(3,421 Views)

You could try moving all of the processing in your dynamic event case (not sure what your subVI is doing) to Loop2.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 2 of 15
(3,400 Views)

I'd rather not, loop 2 is only running every 250ms.  And all the data from the engine is coming from the inputs in the other events.

 

I thought of putting this event in its own while loop, but then I would need a notifier to send it the data and a notifier to send it back after it had been modified in the subvi.

 

Any other ideas?  Thank you!
Christopher

0 Kudos
Message 3 of 15
(3,395 Views)

The event structure dynamic case is busy processing your subVI hence it is missing your front panel activity. You have to move your processing to a woker loop such as Loop 2

 

Also, you are generating a notification in your dynamic event case (every 10ms, from your previous post) so by waiting for 250ms in Loop2, you are overwriting 25notifications? Is this by design?

 

 


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 4 of 15
(3,380 Views)

What is your definition of a "heavy piece of code"? Could it be that it takes longer than 10ms to execute causing an large accumulation of events in the queue?

0 Kudos
Message 5 of 15
(3,376 Views)

Yes, in the subvi I'm writing data to a DAQ (critical), in loop 2 I'm writing other info to the front panel (not critical).

 

There is no way to make the event structure store up events and execute them when it is not busy?

 

Thanks!
Christopher

0 Kudos
Message 6 of 15
(3,375 Views)

No, it takes less than 10ms (I guess that was a misleading comment, sorry), but when it is running I can't register any other events.

Is there a way to que them, or do I need to just live with missing them occasionally?

 

Thanks!
Christopher

0 Kudos
Message 7 of 15
(3,371 Views)

Use queues (not lossy) instead of notifiers (lossy) and dequeue it in a separate loop, this is a much better solution and there are plenty of examples around. Search for producer / consumer (Events) examples.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 8 of 15
(3,368 Views)

Thats an idea.. but the notifier will only come when a value changes on the front panel.  Then my code will sit idle until a front panel value has changed and sends the next notifier.. or is there a way to run without a notification?

 

0 Kudos
Message 9 of 15
(3,352 Views)

This suggestion is based on partial information and a picture so apologies if this is not relavent.

 

I would change your structure with queues, it looks like you generate a notification every 10ms. You could replace all of this with a single consumer loop which essentially is a dequeue loop with a 10ms timeout and do all of the dynamic event processing when the dequeue times out. You can also enqueue any front panel activity to the same queue in the event structure. Look for producer consumer examples, it is very elegent


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 10 of 15
(3,342 Views)