This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Generate Pulse Data on a Counter Channel

Use addCounterOutputChannel

Use addCounterOutputChannel to add a channel that generates pulses on a counter/timer subsystem. You can generate on one channel or on multiple channels on the same device using startForeground.

Generate Pulses on a Counter Output Channel

This example shows how to generate pulse data on an NI USB-9402 with device ID 'cDAQ1Mod5'.

Step 1. Create a session object and save it to the variable s:

s = daq.createSession('ni');

Step 2. Add a counter output channel with a PulseGeneration measurement type:

ch =  addCounterOutputChannel(s,'cDAQ1Mod5', 0, 'PulseGeneration')
ch = 

Data acquisition counter output pulse generation channel 'ctr0' on device 'cDAQ1Mod5':

       IdleState: Low
    InitialDelay: 2.5e-008
       Frequency: 100
       DutyCycle: 0.5
        Terminal: 'PFI0'
            Name: empty
              ID: 'ctr0'
          Device: [1x1]
 MeasurementType: 'PulseGeneration'

Step 3. Generate pulses in the foreground:


Related Topics