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.

DutyCycle

Duty cycle of output channel

Description

When working with the session-based interface, use the DutyCycle property to specify the fraction of time that the generated pulse is in active state.

Duty cycle is the ratio between the duration of the pulse and the pulse period. For example, if a pulse duration is 1 microsecond and the pulse period is 4 microseconds, the duty cycle is 0.25. In a square wave, you will see that the time the signal is high is equal to the time the signal is low.

For function generation channels using Digilent devices, each waveform adopts the duty cycle

Examples

Specify Duty Cycle

Create a session object and add a 'PulseGeneration' counter output channel:

s = daq.createSession('ni');
ch = addCounterOutputChannel(s,'cDAQ1Mod5', 'ctr0', 'PulseGeneration')
ch = 

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

      IdleState: Low
   InitialDelay: 2.5e-08
      Frequency: 100
      DutyCycle: 0.5
       Terminal: 'PFI0'
           Name: ''
             ID: 'ctr0'
         Device: [1x1 daq.ni.CompactDAQModule]
MeasurementType: 'PulseGeneration'

Change the DutyCycle to 0.25 and display the channel:

ch.DutyCycle
ch = 

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

      IdleState: Low
   InitialDelay: 2.5e-08
      Frequency: 100
      DutyCycle: 0.25
       Terminal: 'PFI0'
           Name: ''
             ID: 'ctr0'
         Device: [1x1 daq.ni.CompactDAQModule]
MeasurementType: 'PulseGeneration'

You can change the channel duty cycle while the session is running when using counter output channels.

See Also

Functions

Properties

Was this topic helpful?