Table of Contents

Memory Monitor

The following excerpt from the Breakout Board example workflow demonstrates memory monitor functionality.

~/workflows/hardware/np1e/memory-monitor.bonsai workflow

MemoryMonitorData emits a MemoryMonitorDataFrame at a regular interval set by Breakout Board Configuration using the ConfigureBreakoutBoard's SamplesPerSecond property (in our case 10 Hz). In the Breakout Board example workflow, the MemoryMonitorData's DeviceName property is set to "BreakoutBoard/MemoryMonitor". This links the MemoryMonitorData operator to the Breakout Board's memory monitor. MemberSelector selects the PercentUsed member from MemoryMonitorDataFrame so the user can visualize the percentage of the breakout board's memory that is occupied.

Note

MemoryMonitorData generates a data stream that is most useful in the context of closed-loop performance. It tells the user if data is being consumed rapidly enough by the host PC to keep up with data production by the hardware. The hardware FIFO is a buffer that is required to deal with the fact that computers with normal operating systems cannot perform operations with strict regularity. When there are hiccups in acquisition, the hardware FIFO picks up the slack, but should then be cleared immediately. To get the lowest latencies, StartAcquisition's BlockReadSize property should be as small as possible while the memory use percentage remains around 0%.

Warning

If the hardware FIFO's PercentUsed is non-zero for long time periods, or is increasing, the value of StartAcquisition's BlockReadSize property is too small (see the breakout board configuration). A small BlockReadSize means that the host computer does not have to wait long for enough data to become available to propagate it forward, but will reduce overall bandwidth by increasing the frequency at which the host computer checks if data is available and performs hardware reads.