LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot acquired load cell data from DAQmx against a static sine wave.

Solved!
Go to solution

Hello,

 

I'm trying to plot my acquired data on a waveform chart with a static sine wave. For context, I'm performing a motor control force-tracing task for a research study and would like to compare the participants force trace to the reference sine wave data. The reference sine wave the participants are trying to trace with by pressing the load cell would therefore have to be plotted on the waveform chart immediately after the program is started. Can anyone help me get started? I'm currently able to acquire data from DAQmx and plot on the waveform chart in real time, however, I have tried using bundle and combine signal functions without success to plot against a reference sine wave.

 

Any assistance would be appreciated.

0 Kudos
Message 1 of 9
(2,782 Views)

Hi Liddy,

 

I recommend to plot the measured data on a graph instead of a chart.

This way it becomes really easy to plot the "static sine wave" as second plot…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(2,775 Views)

When I try to plot DAQmx data on the waveform graph the data from the load cell does not show up on the graph, although the y-axis appears to be scaling to the input.

0 Kudos
Message 3 of 9
(2,772 Views)

Hi Liddy,

 

surely it shows up: use a different plot style with visible points to see the data!

 

With graphs you need to collect your data in arrays…

(You know the example finder? And you did examine the example VIs on charts and graphs, did you?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(2,758 Views)

Hello,

I'm able to plot two waveforms in real time on a waveform chart, however, There is an 8 second delay in my loop (28 sec instead of 20 sec). Is this delay normal in LabVIEW?

 

0 Kudos
Message 5 of 9
(2,720 Views)
Solution
Accepted by topic author Liddy

Hi Liddy,

 

Is this delay normal in LabVIEW?

It's normal for programs like yours…

 

- When you want to read 2000 samples at a given sample rate you should use DAQmxTiming function and request a fixed sample number at DAQmxRead.

- You should not convert an array of samples to DDT and convert back to a single sample…

- You should NOT put an additional Wait function into the DAQ loop, especially after setting a samplerate with DAQmxTiming…

 

Please go back to those example VIs coming with LabVIEW. They explain all this DAQmx stuff very good!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(2,711 Views)

Thank you for the response. 

I have removed the wait function without any improvement. I have also tried using the timeout function and acquire data Analog 1 sample 1 channel, however, there are delays in the response of the load cell and also loop time. I also tried removing the simulate signal function and there was no effect on the loop time. I originally used this method because I thought the delay in the loop time was originating from using DAQ assistant. I have also tried using information on the NI website (http://www.ni.com/product-documentation/2835/en/) to better understand how to use myDAQ funcitons, however, none of the options are improving the delay in the loop time. I have also removed the dynamic data conversion functions within the loop without any improvement.

0 Kudos
Message 7 of 9
(2,705 Views)

Here is where I'm at right now.

0 Kudos
Message 8 of 9
(2,701 Views)

It works now. My case structure was causing the problem. I'm not sure why that was the case.

0 Kudos
Message 9 of 9
(2,689 Views)