LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Lag : Real Time Data Acquisition

Solved!
Go to solution

Hi,

 

I have designed the pressure vs time simple measurement program. Objective was to acquire data continuously for visualization on the front panel , as well get plotted on the waveform chart(Data vs real time) and also save the data on the notepad. 

 

Program runs well when it start but when the pressure suddenly change or fluctuate, I wont see that change immediately on my screen (front panel), I need to wait for like few mins to see them. I have also try to reduce the wait time to 0 but still I see this lag during the variation of the pressure. any suggestion?

 

39.png

 

How can I improve this and yeah, I am using the termination character for my program. 

 

I am using the SH68-8DB9 cables to connect my deck (NI PXle 1078). Does connecting the Rs232 cable, directly to the port will helpful?

 

 

 

 

0 Kudos
Message 1 of 4
(215 Views)

Posting your VI would be better than a screenshot, if you can do that.

 

I would check to make sure your chart is set up properly.  If the time axis is set up with an offset or something, it could be you're not seeing the most recent data live.

 

Another thing you could do is move the logging to file out of the loop.  Either record it all at the end instead of continuous updates, or put it in a separate loop using a Queue to send the data from the top loop to the bottom.

 

I would also put something on the error wires for both serial connections to do something in the event of a timeout.  It could be one or both of your devices are timing out occasionally, causing delays.  If you are getting timeouts, you could consider changing something with the cabling setup to see if it helps, as otherwise it shouldn't matter much.

0 Kudos
Message 2 of 4
(184 Views)

Hi Kyle I have enclosed the file. 

 

0 Kudos
Message 3 of 4
(177 Views)
Solution
Accepted by skdubey

OK, I looked at your previous posts and found one where you posted the manual for this device, and it has this in it:

 

Kyle97330_0-1618607313513.png

So it looks like what you're doing is putting in into "continuous" mode, meaning that if you sent the VISA write just once and then ran the VISA read over and over, you'd keep getting readings because it's set to send them forever.

 

This is likely causing your problem, because either when you write to file it's getting behind, or one of your two devices is set to a different sample send speed than the other is.  So you're never reading the most recent value.

 

You could try switching to this command instead: 

Kyle97330_1-1618607679138.png

 

That would probably make it act like you actually want it to.

 

If that doesn't give measurements fast enough and you want to use continuous mode, then you're going to have to make 3 loops, one for each device and one for file logging, to be sure that each device isn't holding the other back and that the file writing is fast enough and doesn't hold back the device reads.

0 Kudos
Message 4 of 4
(161 Views)