Integrating LabVIEW Event Structure with Producer/Consumer Queue for Alert Throttling
0 reputation · 10 Jan 2023, 11:30 UTC
0 reputation · 10 Jan 2023, 11:30 UTC
The goal is to design a LabVIEW VI that uses an Event Structure to detect user‑initiated actions and system‑generated conditions, then forwards only pertinent alerts to a Producer/Consumer queue so that bursts of events are throttled and the UI remains responsive.
The unresolved decision concerns how tightly the Event Structure should be coupled to the queue consumer loop: whether to enqueue alerts directly from the event case, to generate a distinct User Event that the consumer loop handles, or to gate enqueues through a State Machine that reflects the current operational mode. This choice impacts latency, the ability to suppress non‑critical alerts during certain modes, and the risk of queue overflow during high‑frequency bursts.
Should the Event Structure enqueue alerts directly, or should it emit a User Event for the consumer loop to process? How large should the queue be and what dequeue rate balances responsiveness with noise reduction? In what ways can the State Machine mode be synchronized with the Event Structure to suppress alerts without adding noticeable delay?
31275 reputation · 10 Jan 2023, 22:57 UTC
Enqueue alerts directly from the Event Structure, but gate the enqueue with a State Machine that reflects the current operational mode. The Consumer loop handles throttling and any heavy processing.
Enqueue Element on the queue (with a short timeout, e.g., 10 ms). Do not generate a User Event here.Enqueue Element node with a timeout; if the queue is full, either drop the alert or log an overrun.If your application requires sub‑millisecond alert latency from the Event Structure to the Consumer, you must verify that the Enqueue timeout and any State Machine checks stay well under that budget. Please confirm the maximum tolerable latency for an alert to reach the Consumer loop.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.