Duty cycle of counter output channel
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.
Create a session object and add a 'PulseGeneration' counter output channel:
s = daq.createSession('ni'); s.addCounterOutputChannel('cDAQ1Mod5', 'ctr0', 'PulseGeneration')
Change the DutyCycle to 0.25 and display the channel:
s.Channels.Frequency = 200; s.Channels ans = Data acquisition counter output pulse generation channel 'ctr0' on device 'cDAQ1Mod5': IdleState: Low InitialDelay: 2.5e-008 Frequency: 100 DutyCycle: 0.25 Terminal: 'PFI12' Name: empty ID: 'ctr0' Device: [1x1 daq.ni.DeviceInfo] MeasurementType: 'PulseGeneration'