Add counter output channel
ch = addCounterOutputChannel(s,deviceID,channelID,measurementType)
[ch,idx] = addCounterOutputChannel(s,deviceID,channelID,measurementType)
create a session object before you use this method.
s— Data acquisition session
Data acquisition session, specified as a session object. Create
the session object using
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.
deviceID— Device ID
Device ID as defined by the device vendor specified as a character
vector. Obtain the device ID by calling
The channel specified for this device is created for the session object.
channelID— Channel ID
Channel ID, specified as a numeric value, character vector,
or string, corresponding to the specific counter channel on the device
added to the session. Channel ID
to the device counter
'ctr0', Channel ID
and so on. For the related device signal names and physical pins,
see the pinout for your particular device.
You can add a range of channels by specifying the channel ID with a numeric array, or an array of character vectors or strings.
The index for a channel displayed in the session indicates the
channel’s position in the session. The first channel you add
in a session has session index
1, and so on.
measurementType— Channel measurement type
Channel measurement type, specified as a character vector or
measurementType represents a vendor-defined
measurement type. A valid output measurement type is
ch— Counter output channel object
Counter output channel that you add, returned as an object containing
n array of vendor specific channel information.
Use this channel object to access device and channel properties.
idx— Channel index
Channel index returned as a numeric value. Through the index
you can access the array of the session object's
|Device||Channel device information|
|DutyCycle||Duty cycle of output channel|
|Frequency||Frequency of generated output|
|ID||ID of channel in session|
|IdleState||Default state of counter output channel|
|InitialDelay||Delay until output channel generates pulses|
|MeasurementType||Channel measurement type|
|Name||Specify descriptive name for the channel|
s = daq.createSession('ni'); ch = addCounterOutputChannel(s,'cDAQ1Mod3','ctr0','PulseGeneration'); ch.Terminal % View device signal name for pin mapping.
s = daq.createSession('ni') ch = addCounterOutputChannel(s,'cDAQ1Mod3',0:1,'PulseGeneration')