Encoding type of counter channel
When working with the session-based interface, use the EncoderType
property
to specify the encoding type of the counter input 'Position'
channel.
Encoder types include:
'X1'
'X2'
'X4'
'TwoPulse'
Change the EncodeType property of a counter
input channel with a Position
measurement type.
Create a session and add a counter input channel with Position
measurement
type.
s = daq.createSession('ni'); ch = addCounterInputChannel(s,'cDAQ1Mod5', 'ctr0', 'Position')
ch = Data acquisition counter input position channel 'ctr0' on device 'cDAQ1Mod5': EncoderType: X1 ZResetEnable: 0 ZResetValue: 0 ZResetCondition: BothHigh TerminalA: 'PFI0' TerminalB: 'PFI2' TerminalZ: 'PFI1' Name: '' ID: 'ctr0' Device: [1x1 daq.ni.CompactDAQModule] MeasurementType: 'Position'
Change the channels encoder type to X2
.
ch.EncoderType = 'X2'
ch = Data acquisition counter input position channel 'ctr0' on device 'cDAQ1Mod5': EncoderType: X2 ZResetEnable: 0 ZResetValue: 0 ZResetCondition: BothHigh TerminalA: 'PFI0' TerminalB: 'PFI2' TerminalZ: 'PFI1' Name: '' ID: 'ctr0' Device: [1x1 daq.ni.CompactDAQModule] MeasurementType: 'Position