LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Align DAQmx Data with Data from Non-DAQmx Device

Solved!
Go to solution

I have created a project that continuously reads a voltage acquired from a load cell (strain gauge) using a cDAQ NI-9224 module in an NI-9171 chassis. Simultaneously, the program reads deflection data from laser deflection sensors through a third-party interface device connected to the PC via USB. I would like to roughly align in time the two data streams, but I am having a difficult time doing so. The laser sensor interface accepts a hardware trigger, but cannot generate one, so I can't use it to trigger the DAQmx device.

 

So far, I have tried to find the t0 offset between the first set of samples from both interfaces. I then used a DAQmx Read property node to set the Offset of the load cell Relative To the next set of samples to roughly align with t0 of the next set of samples from the laser sensors. The program then reads another set of samples. Then, I used a DAQmx Read property node again to set the next buffer read position to Current Read Position to move the beginning of all subsequent reads to just after the last sample previously returned. This, however, didn't solve the problem, as each subsequent DAQmx Read takes a long time to complete, and reads from the buffer can't keep up with the acquisition.

 

The program is quite complex and I am working on creating a simplified version of it to post here. I just wanted to start a post in case anyone has any immediate ideas.

0 Kudos
Message 1 of 11
(748 Views)

If I were to simplify, you want to synchronously capture load cell and a LASER sensor?

 

Load cell is interfaced through 9224 & 9171, whereas the LASER sensor directly connects over USB?

 

What LASER sensor are you using?

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 11
(728 Views)

Yes, that is an accurate summary.

 

The laser sensors are the ILD1220 from Micro-Epsilon.

0 Kudos
Message 3 of 11
(710 Views)

The good news is that your device is primarily a 4-20mA current loop output sensor. If you had a larger cDAQ chassis, you could buy a current input module, connect the sensor to the DAQ and thereby synchronise both the current and the load cell measurements easily.

 

Do you use the IF2001/USB device to connect to the computer?

santo_13_0-1701060271705.png

 

In my 5mins search, the manufacturer did not provide a manual on how the data is translated on the IF2001/USB, it could be simple text or binary, having this information would make like a bit easier as they use a FTDI chip and you could read it off the COM port in LabVIEW.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 11
(682 Views)

I am using the 4-channel IF2004/USB converter instead of the single-channel IF2001/USB, but I think the operation is similar.

 

Would you mind expanding on the potential use of the current module in the DAQ chassis? How would the devices be wired if I were to go this route?

 

Is there no way to play with the read position in the DAQmx buffer to more closely align it with the data from the laser sensors? The alignment doesn't have to be perfect. I only need to find the load cell data point whose timestamp is nearest to the first data point from the lasers, and use that to align all subsequent data from both systems. The program is run for 30 minutes at the most, so any small drift (phase shift) that might occur over time is acceptable.

 

Also, I have attached the LV project. I hastily put this together to test ideas for solving this problem and to post here to the forum. So I haven't had time to refine the code.

0 Kudos
Message 5 of 11
(661 Views)

Before we get there, just noticed that you're using a generic Analog input card 9224 to read loadcell, do you use any loadcell amplifier? or just supply the external excitation to the bridge?

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 6 of 11
(649 Views)

The load cell is providing load feedback to a controller that controls a linear hydraulic actuator; the load cell is coupled inline with the actuator's ram. The signal cable to the load cell is connected directly to this controller. I would have to dig into schematics of the controller to answer your question if it will help with the problem at hand.

0 Kudos
Message 7 of 11
(646 Views)

You can connect the LASER's analog output to 9224 AI using a resistor and capacitor as indicated in the manual (Uout to AI+ and GND to AI-)

 

500 ohm maps the 4-20mA to 10V range to maximize the usage of +/-10V range of 9224.

 

 

santo_13_0-1701097271420.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 8 of 11
(645 Views)

I hadn't considered this option because I had purchased the IF2004 converter, but your suggestion seems a viable solution.

 

Would your suggested setup require establishing a calibration curve over the measurement range of the laser sensor?

 

Is there any hope of solving my problem using LabVIEW as originally asked?

0 Kudos
Message 9 of 11
(623 Views)
Solution
Accepted by topic author SrLimpio

I figured out how to accomplish my goal using LabVIEW code instead of the more elegant hardware solution proposed by @santo_13. I am hesitant to mark the suggested solution of @santo_13 as the official solution since it will introduce electronic components that would require calibration of the voltages read by the DAQ hardware; while the IF2004/USB interface eliminates this requirement. I did, however, give that user Kudos, which is the next best thing, I suppose.

 

I have uploaded a newer version of my LV code with the solution.

0 Kudos
Message 10 of 11
(561 Views)