Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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 this property value to control when the event 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?