11-14-2005 02:30 PM
11-15-2005 06:39 PM
Hi Bill,
You can definitely synchronize multiple tasks from a same start trigger. You can do this using the RTSI cable but also you can use the internal signal sampling clocks as start triggers.
First you will have to configure your RTSI in MAX. This can be done by right-clicking on Devices and Interfaces -> NI-DAQmx Devices and choosing Create New NI-DAQmx Device -> RTSI Cable. Then, for each device that is connected to the RTSI cable, use MAX to edit its properties and in the "RTSI Configuration" tab, specify the RTSI cable. This will allow NI-DAQmx to automatically route signals of the RTSI cable.
Actually, the discussion forum http://forums.ni.com/ni/board/message?board.id=250&message.id=9743&requireLogin=False explains in detail how setup the time bases and synchronize the each of the tasks using the DAQmxGetMasterTimebaseSrc function. Please also refer to synchronization examples in the C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Synchronization.
Also, if you decide just to use the internal sampling clock option, when you set up the timing for the task by using the function DAQmxCfgSampClkTiming(), for the source parameter you can specify the same start trigger for all tasks (for example Dev1/ao/Start trigger). Daqmx will automatically synch the start of all tasks once the source is specified.
11-16-2005 08:32 AM
Hi Natasa,
Thanks for the reply. Actually, I was able to solve the problem after I stumbled onto a property called "DAQmxSetStartTrigDelay()". I actually *had* setup all the items you'd suggested, but the problem I was a "chicken-and-egg" situation. I needed to use CTR0 and CTR1 on my E-series (6033E) card for buffered acquisition, but I was getting an error (-200078) that suggested (because of DMA issues) that I needed to "start my AIN tasks before I start my CTR tasks, or not use CTR0". The problem was, if I started the AIN tasks first, the CTR tasks were "behind" by about 30 milliseconds or so because the CTR tasks depended on exported sample clock timing signals from the AIN tasks.
My solution (and I don't know if it's the RIGHT solution, but it did work) was to use the ""DAQmxSetStartTrigDelay()" feature on the AIN task. This allowed me to start the AIN task first (which really just seemed to "arm" it because it's actual start would be delayed), and the delay gave me enough time to start the CTR tasks. When the delay expired, the AIN task started up automatically, and because the CTR tasks were hooked up to the expoted timing signals from the AIN task, the entire system came up synchronized, with the counters in lock-step with the AINS, and with no DMA errors.
Thanks for your reply!