Hi all,
I have a question regarding writing to the counter outputs on a cDAQ-9188 with a NI 9401 module and synchronizing them with a digital output on a NI 9403 module.
Currently I am accessing the four on-board counters of the 9188 through the 9401 module, which are being used to create a 5kHz pulse train with a variable duty cycle to control four independent voltage outputs through a PWM chip. Whenever my main program is executing, I have a sub vi looping in the background which reads the requested values of the 4 channels through a functional global and calculates the corresponding on and off times. Within the same loop, I'm also building a boolean array which controls the enabling of the voltage output, its polarity and a reference digital output if the requested voltage in the current loop iteration was different than the last iteration (value changed indication for an analog trigger). After all of these values are determined, the counter writes to all four counter outputs and the digital output array is written.
Ideally, I would like "the value changed indication" to line up exactly with the counter write, but doing a millisecond timer outside my digital and counter writes showed the counter write took 20 ms to execute and the digital write took 2 ms to execute. Is there any way to synchronize these two writes to they occur at the exact same time?
Thank you,