03-27-2013 04:40 AM
Hello all,
I would like to synchronize the position readings of my motion control system wired to a PCI 7332 with the readings of a laser sensor usb-connected through NI 9239. From what I understand, RTSI connection is not available on the NI 9239, is there another way to do it? Any guidance would be greatly appreciated 🙂
Many thanks,
Benoît
03-29-2013 10:15 AM
NI experts out there, your wise comments would be greatly valued.
Please let me know if the description of what I want to do is unclear.
Thanks again,
Ben
04-03-2013 02:25 AM
Hi Benoit,
You're absolutely right when you say RTSI connection is not avaiblable on 9239, and with USB career, you'll be not able to synchronize you're acquisition as efficiently as you expect.
Can you explain us your project? We could find a solution.
Romain P.
National Instruments France
04-03-2013 11:01 AM
Hi Romain,
Basically, my laser sensor is mounted on a linear slide, the whole thing is moving during acquisition and I need to locate the readings of the laser sensor with good precision. With DAQmx through NI 9239 I get a time serie corresponding to my laser sensor readings and with Flexmotion through PCI 7332 a time serie of the slide position. I need to synchronise those time series so I can get my laser sensor readings as a function of time.
I'm having a shot software solutions (in C++) since my hardware is not compatible with RTSI. One way of looking at it is to determine the time elapsed between the start of both acquisition. With timestamlps (code below), I found that starting the flexmotion acquisition is almost instantaneous (0 ms) whereas starting the DAQmx task (the USB one) takes an awfull lot of time (about 150 ms). Since DAQmxStartTask is a black box to me, I can't tell when the actual acquisition starts during the call to DAQmxStartTask. According to some tests I did, I would say it starts at about 3/4 of the 150 ms, but that is not good enough since my measurements are very imprecise.
int t0 = GetTickCount();
// DAQmx - starting laser acquisition
DAQmxStartTask(taskHandle);
int t1 = GetTickCount();
// Flexmotion - starting position acquisition
err = flex_acquire_trajectory_data(boardID, axisMap, numSamples, 4/* ms time period*/);
int t2 = GetTickCount();
int delta_laser = t1-t0;
int delta_position = t2-t1;
Is there a way to tell with better precision when the acquisition actually starts within the DAQmxStartTask black box? Any other ideas to synchronize the time series?
Many thanks,
Ben