Create data acquisition session for specific vendor hardware


session = daq.createSession(vendor)


session = daq.createSession(vendor) creates a session object that you can configure to perform operations using a CompactDAQ device.

Input Arguments

collapse all

vendor — Vendor namecharacter string

Vendor name for the device you want to create a session for, specified as a string. Valid vendors are:

  • ni

  • digilent

  • directsound

Output Arguments

collapse all

session — Session objectcharacter string

Session object created using daq.createSession, specified as a string variable. Use the data acquisition session for acquisition and generation operations. Create one session per vendor and use that vendor session to perform all data acquisition operations.


Session acquisition and generation properties:

ChannelsArray of channel objects associated with session object
ConnectionsArray of connections in session
DurationInSecondsSpecify duration of acquisition
IsContinuousSpecify if operation continues until manually stopped
IsDoneIndicate if operation is complete
IsLoggingIndicate if hardware is acquiring or generating data
IsNotifyWhenDataAvailableExceedsAutoControl if NotifyWhenDataAvailableExceeds is set automatically
IsNotifyWhenScansQueuedBelowAutoControl if NotifyWhenScansQueuedBelow is set automatically
NotifyWhenDataAvailableExceedsControl firing of DataAvailable event
NotifyWhenScansQueuedBelowControl firing of DataRequired event
NumberOfScansNumber of scans for operation when starting
RangeSpecify channel measurement range
RateRate of operation in scans per second
RateLimitLimit of rate of operation based on hardware configuration
ScansAcquiredNumber of scans acquired during operation
ScansOutputByHardwareIndicate number of scans output by hardware
ScansQueuedIndicate number of scans queued for output
VendorVendor information associated with session object


Create a session object s:

s = daq.createSession('ni')
s = 

Data acquisition session using National Instruments hardware:
   Will run for 1 second (1000 scans) at 1000 scans/second.
   No channels have been added.   
Was this topic helpful?