I need to syncronize a 1kHz AO signal with a 100Hz CAN output signal. I am using a PXI E-series DAQ card and a PXI series 2 CAN card and I am using a shared clock (from DAQ device) over RTSI. I started with using frame API and filling the buffer with data assuming 10ms increments. This is nearly working correctly, but the timing seems to be off. I create a CAN obj with a 10ms period, but after 20 seconds, the CAN data is about 200ms faster than the AO.
I then tried using channel API. The signals now stay in sync, but since I need to write 20 sec worth of data, the software loop waits until it has finished writing the entire buffer. I then tried to put this into a loop where I write small chunks at a time, but then it gets further behind each loop iteration and by the end, the CAN data is really far behind.
I would like to use the frame API but I have only found examples for syncronizing CANnet and not CANobj. Has anyone used precise output timing for CAN objects?