Packet Flush for resetting signal processing on Server-Side

Introduction
With Device operation modes - :raised_hand: Feature Requests - openDAQ community defining operation modes, those are to be used as triggers for function blocks/devices to change their mode of operation, serving as a start/stop event for function blocks that might have side effects when running (eg. AO modules, file writer).

However, those events will not be synchronized with measurement data. Function blocks are not able to tell between which two packets received by their input ports the mode change occurred, resulting in different blocks in the openDAQ tree starting measurement at different timestamps, depending on the state of their input port packet queues.

This feature addresses that issue by providing an option to “flush” any given openDAQ system. The flush clears all packets from openDAQ objects that are holding onto them. This includes Readers, Connections, Input ports, Signals… After the flush, a “Reset” packet is enqueued at the start of each input port connection, indicating that a flush occurred. The flush guarantees that immediately after it has finished, there are no packets in the system.

User stories

  • On measurement start, the operation mode is changed to “Operating”. A statistics function block receives the “reset” packet sent by flush. It clears all internal buffers and resets calculated averages.
  • The same should apply to any math that does interval calculation. For instance, if I do 1 second averages with statistics and I calculate 1 second Leq values with SLM, I would expect the samples from each to have the same timestamps.
  • The counter function block receives a “reset” packet. It resets the counter values back to their starting point.
  • Client changes the operation mode of a device, using the option to flush the system on change. The operation mode change triggers a packet flush.

Feature requirements

  • A system flush function is available in openDAQ. When invoked, measurement is locked and all packets in the system are cleaned up.
  • Input ports are made aware of the flush by a reset packet that’s sent through every signal.
  • An operation mode change can optionally flush a system if the caller chooses to do so.

Release Version

3.20

Who shall implement the Feature

openDAQ
Contribution

Status
Feature Planned on Roadmap
Feature Request is discussed in Working Group
Feature declined.