Hi,
I have a task that contains a pulse generation counter output channel (Device: NI 9402 module on a NI cDAQ 9188 Chassis). I notice that if I change the frequency and duty cycle while the task is running, simply stopping the task and starting it again resets the duty cycle and frequency. I have modified the Ansi C example titled DigPulseTrain-Cont.c that ships with NI-DAQmx to implement the following workflow:
1) Create a task
2) Set the counter output duty cycle to 0.1
3) Set the counter output frequency to 100
4) Start the task
At this point, we see a square wave being generated at 100Hz with a 0.1 Duty cycle
5) Change the counter output duty cycle to 0.001 without stopping the task
6) Set the counter output frequency to 100 (unchanged) without stopping the task
The Duty cycle of the square wave now changes to 0.001
7) Stop the task
8) Start the task
The Duty cycle of the square wave now changes back to 0.1.
Similar behavior is observed when one changes the counter output frequency. Is this intended behavior? If this is unexpected behavior, can you provide us a CAR number so that we can track this.
Thanks,
Varun Hariharan
MathWorks