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.

DurationInSeconds

Specify duration of acquisition

Description

When working with the session-based interface, use the DurationInSeconds property to change the duration of an acquisition.

When the session contains analog, digital, or audio output channels, DurationInSeconds is a read-only property whose value is determined by s.ScansQueueds.Rate.

If the session contains only counter output channels with PulseGeneration measurement type, then DurationInSeconds represents the duration of the pulse train signal generation.

Values

In a session with only input channels or counter output channels, you can enter a value in seconds for the length of the acquisition. Changing the duration changes the number of scans accordingly. By default, DurationInSeconds is set to 1 second.

Examples

Create a session object, add an analog input channel, and change the duration:

s = daq.createSession('ni');
addAnalogInputChannel(s,'cDAQ1Mod1','ai0','voltage');
s.DurationInSeconds = 2
s = 

Data acquisition session using National Instruments hardware:
   Will run for 2 seconds (2000 scans) at 1000 scans/second.
   Operation starts immediately.
      Number of channels: 1
      index Type  Device   Channel  MeasurementType      Range        Name
      ----- ---- --------- ------- ----------------- ---------------- ----
      1     ai   cDAQ1Mod1 ai0       Voltage (Diff)  -10 to +10 Volts

See Also

Properties

NumberOfScans, Rate

Functions

addCounterInputChannel

Was this topic helpful?