Skip to Main Content Skip to Search
Product Documentation

addCounterOutputChannel - Class: daq.Session
Package: daq

Add counter output channel

Syntax

s.addCounterOutputChannel(deviceID, channelID, measurementType)
ch = s.addCounterOutputChannel(deviceID, channelID, measurementType)
[ch, idx] = s.addCounterOutputChannel(deviceID, channelID, measurementType)

Description

s.addCounterOutputChannel(deviceID, channelID, measurementType) adds a counter output channel on the device represented by deviceID, with the specified channelID, and channel measurement type, defined by measurementType, on the session object, s. Measurement types are vendor specific.

ch = s.addCounterOutputChannel(deviceID, channelID, measurementType) returns the object ch, representing the channel that was added.

[ch, idx] = s.addCounterOutputChannel(deviceID, channelID, measurementType) returns the object ch, representing the channel that was added and the index, idx, which is an index into the array of the session object's Channels property.

Tips

Use daq.createSession to create a session object before you use this method.

Input Arguments

deviceID

Specify the vendor-defined ID of the device. The specified channel is created for this device. The device ID is the ID of the device that you obtain by calling daq.getDevices.

channelID

Specify the ID of the channel added to the device. You can also add a range of channels.

For NI devices, use either a terminal name, like 'ctr2', or a numeric equivalent like 2, for the channel ID.

measurementType

Specify a string that represents a vendor-defined measurement type. A valid output measurement type is 'PulseGeneration'.

Output Arguments

ch

Object representing the channel you added.

idx

An index into the array of the session object's Channels property.

Properties

DeviceAnalog and counter channel device
DutyCycleDuty cycle of counter output channel
FrequencyFrequency of generated pulses on counter output channel
IDAnalog and counter channel ID
IdleStateDefault state of counter output channel
InitialDelayDelay until output channel generates pulses
MeasurementType Type counter channel measurement
NameSpecify descriptive name for the channel

Examples

Add an counter output PulseGeneration channel:

s = daq.createSession ('ni')
s.addCounterOutputChannel('cDAQ1Mod3','ctr0','PulseGeneration')

Add two counter output PulseGeneration channels:

s = daq.createSession ('ni')
s.addCounterOutputChannel('cDAQ1Mod3',0:1,'PulseGeneration')
 

See Also

daq.Session | daq.Session.addCounterInputChannel | daq.Session.removeChannel | daq.session.startBackground

How To

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS