Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Lag in data while trying to control a system using two separate DAQ types

Hello,

I am a new LabView user and am currently facing a problem related to a control software that I made. The main purpose of this software is to acquire an displacement data (LVDT sensor). A progenerated file will be uploaded to the PC which will contain a list of displacements and corresponding voltages to apply as an output. The program will check whether the current displacement is greater than or lesser than (based on a the input file which contains the required greater than or lesser than logic). For this purpose I am acquiring the data from the LVDT sensor using an USB NI (NI 6001), and the output voltages are given using a ethernet  NI cDaq (NI 9181) which contains a four output channel NI module (NI 9263). While using this setup a lag is occurring in the data acquisition of the displacement, which is preventing proper control of the system. I have attached the program and a sample input file for reference.

Please state if any additional information is necessary.

Thanks in advance.

Download All
0 Kudos
Message 1 of 7
(359 Views)

Hello,

I am a new LabView user and am currently facing a problem related to a control software that I made. The main purpose of this software is to acquire an displacement data (LVDT sensor). A progenerated file will be uploaded to the PC which will contain a list of displacements and corresponding voltages to apply as an output. The program will check whether the current displacement is greater than or lesser than (based on a the input file which contains the required greater than or lesser than logic). For this purpose I am acquiring the data from the LVDT sensor using an USB NI (NI 6001), and the output voltages are given using a ethernet  NI cDaq (NI 9181) which contains a four output channel NI module (NI 9263). While using this setup a lag is occurring in the data acquisition of the displacement, which is preventing proper control of the system. I have attached the program and a sample input file for reference.

Please state if any additional information is necessary.

Thanks in advance.

Download All
0 Kudos
Message 2 of 7
(317 Views)

I don't see any major issues in your code. How much delay you are seeing?

 

Note that both USB and Ethernet have high communication latency. I guess you will see a latency of 10ms (USB-6001) + 30ms (cDAQ-9181)

ZYOng_0-1725666679062.png

Reference: Instrument Bus Performance – Making Sense of Competing Bus Technologies for Instrument Control

 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 3 of 7
(332 Views)

The lag I am getting is much higher than 50ms (it is in the range of 2-4 seconds, it varies and is not like the delay is always the same). While testing out the code we were seeing that although the LVDT sensor has reached a displacement of 120mm (measured by keeping a scale beside the sensor, so that we can physically verify the distance traveled), the software is still displaying a value 60-70mm and is getting updated with an extremely noticeable delay.

0 Kudos
Message 4 of 7
(323 Views)

Duplicated with Re: Lag in data while trying to control a system using two separate DAQ types

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 5 of 7
(302 Views)

To understand your situation better, are you seeing delays in displaying the LVDT displacement only? Are you seeing delays when commanding the actuators via Horizontal Jack control?

What are the values of Time Spent in Measurement and Control Loop?

 

When I recheck your VI, I realized that there is a big problem. All while loops have a constant false value to the stop terminal, and you can only abort your VI. This is not desired as you cannot close DAQ and release queues properly. You can refer to Stopping Parallel While Loops in LabVIEW with One Stop Button and make sure all DAQmx tasks are cleared and all queues are released at the end.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 6 of 7
(303 Views)

Ok, I will be trying that and also try to capture the time spent in measurement and display loop. Better yet I will run it real time and capture a video so that it can be better explained

0 Kudos
Message 7 of 7
(271 Views)