I have done some further investigation, and here is where I think the issue arises: In my main program (frame 0) I call a routine to initialize the input temperature and current read tasks, and the analog current write task. These are all listed in one program panel, so the execution order is not defined but it looks like it goes in this order:
- Initialize the Read All Currents task ( reads 4-20 mA data from cDAQ1)
- Initialize Write All Currents Task (writes to currents on cDAQ1)
- Initialize read All temperatures Task (reads from cDAQ2)
When I start the Main program, the first loop is 10-15 seconds -- i.e., almost the same as the time difference in data time stamps. I think the Current data gets started and then there is a delay until the temperature data gets started, and this time offset persists throughout the program.
Can I fix this by (at the end of the initialization or on the first data read) fircing t0 of the temperature to the value for the currents? Or, is there a way to force the two cDAQ units to have the same timer?
I am still slightly unclear on what your program actually looks like, but ideally you would want to have the current and temperature readings happening together, in the same task. Therefore, when you perform your read, it will take a reading from both devices at the same time. You can have different DAQmx Create Channel VIs wired together in series, such that the current and temperature inputs are in the same task. Then, when you callDAQmx Read, you will simply be reading multiple channels for each different type of measurement. For more information on this topic, please see the online KnowledgeBase articles titled "Using Different Types of DAQmx Global Channels in the Same Task" and "Virtual Channels of Different Measurement Types in One Task in the DAQ Assistant". Of course, you can always play with the t0 value returned from the waveform, such as wiring the t0 from one waveform and using this as the t0 of the other waveform. However, this does not actually change the fact that the readings are not happening at the same time, and so the first method of using a single task would be the best choice. Hope this helps,