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.

EncoderType

Encoding type of counter channel

Description

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'

Example

Change Encoder Type Property

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
Was this topic helpful?