Documentation Center

  • Trial Software
  • Product Updates

NotifyWhenScansQueuedBelow

Control firing of DataRequired event

Description

When working with the session-based interface to generate output signals continuously, the DataRequired event is fired when you need to queue more data. This occurs when the ScansQueued property drops below the value specified in the NotifyWhenScansQueuedBelow property.

Values

By default the DataRequired event fires when 1/2 second worth of data remains in the queue. To specify a different threshold, change the this property to control when DataRequired is fired.

Example

Control When DataRequired Event is Fired

Specify a threshold below which the DataRequired event fires.

Create a session and add an analog output channel.

s=daq.createSession('ni')
addAnalogOutputChannel(s,'cDAQ1Mod2', 0, 'Voltage')

Queue some output data.

outputData=(linspace(-1, 1, 1000))';
s.queueOutputData(outputData);

Set the threshold of scans queued to 100.

s.NotifyWhenScansQueuedBelow=100;

Add an anonymous listener and generate the signal in the background:

lh = s.addlistener('DataRequired', ...
@(src,event) src.queueOutputData(outputData));

startBackground(s);
Was this topic helpful?