09-06-2024 08:00 AM
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.
09-06-2024 08:17 AM
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.
09-06-2024 06:54 PM
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)
Reference: Instrument Bus Performance – Making Sense of Competing Bus Technologies for Instrument Control
09-07-2024 12:46 AM
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.
09-07-2024 04:11 PM
Duplicated with Re: Lag in data while trying to control a system using two separate DAQ types
09-07-2024 04:21 PM
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.
09-09-2024 12:03 AM
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