LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Acquisition delay after a certain amount of time

Solved!
Go to solution

I have been learning Labview in the past months and all my knowledge have came from this site, thank you all, well this is my problem: 


I did this VI to log a and plot a lot of signals (14) in  real time, the acquisition in the start of the program runs very well, I verified it changing one of the granite heights sensor using my hands and instantly watching the change in the chart but after a certain time(i could not tell, it could be an hour or even half an hour) if I do the same experiment with the sensor that I mentioned before the chart takes several seconds to reflects the actual change so I figured out that after a certain time the data acquisition is suffering a delay. I have tried to reduce the Chart History Length and  turning on/off  the  Synchronous Display option. 

Thanks in advance for your help It will be very appreciated 

 

more info:

Labview 2015 (15.0 32 bits)

I am using a NI cDAQ-9184 to get the data

The sampling frequency is 1hz (1 second)

 

 

 

0 Kudos
Message 1 of 6
(3,499 Views)

Most likely the delay comes from the extremely long distances that the data has to travel between nodes on this diagram.

Spoiler
Obviously, I'm being a bit facetious.....but just a bit.

Seriously though, I would need 12 monitors at 1920x1080 resolution to display this block diagram. 

Things like this:

 

wait.PNG

 

or this.....

constants.PNG

It's impossible to debug an application that looks like this.  There is no defined order.  There is no event structure to handle all of the button presses.  Wires going backwards and on top of other wires, wires hidden behind case structures.  May I suggest a state machine?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 6
(3,481 Views)

I'm guessing that your massive while loop is taking longer to execute than your sample rate of the hardware.  And so all of these samples are building up (rather slowing at 1S/s) in the buffer.  Over time, it takes longer and longer to see the latest data on the screen.  At first, the delay is very small and so you may not notice it but gradually increases as the buffer fills up. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 3 of 6
(3,476 Views)
Solution
Accepted by topic author elfredy91

Remove the wait function and your program should "work".  But don't stop there.

Go grab the JKI state machine from VIPM.  Everything in your code should fit within this one while loop without increasing its size.  See if you can make it happen.

jki.PNG

 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 4 of 6
(3,467 Views)

"Most likely the delay comes from the extremely long distances that the data has to travel between nodes on this diagram"

-I could not stop laughing when I read this haha. 

 

 

 

"It's impossible to debug an application that looks like this.  There is no defined order.  There is no event structure to handle all of the button presses."  

sorry buddy, I just started learning labview a year ago hehe, I am more an C/C++ guy so all this block block me. 

 

"Remove the wait function and your program should "work".

-THIIIIS was the problem a looooot of thank you mate, I did not even know that delay was placed there due to my disorder mess. I have already tested and everything is ok.

 

"Go grab the JKI state machine from VIPM.  Everything in your code should fit within this one while loop without increasing its size."

-Sorry I did not know what is JKI nor VIPM, can you explain me? thanks in advance


"See if you can make it happen."
I will 🙂

0 Kudos
Message 5 of 6
(3,403 Views)

VIPM is an addon manager for Labview developed by the JKI team.  Its use is so widespread now that it actually ships with Labview.  You can download it here.  Once you get this installed, open it up and do a search for JKI state machine.  Install it and you'll get a new block diagram menu group called JKI toolkits.  In this menu group is a merge VI that will drop the state machine template into your block diagram.  You'll want to study it for a while to figure out what is going on...run the VI in highlight execution mode, etc.  

jki.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 6 of 6
(3,396 Views)