From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Signal delayed when using multiple VISA connections

Solved!
Go to solution

Hello,

 

For a project, I'm using 2 digital pressure sensors (Omega PXM409) to measure the pressure at 2 different locations. However, I noticed that one of the signals suffers a serious delay. This is seen when I blow into them at the same time (and yes, they can handle that pressure difference), and I see one of them giving a peak immediately, and the other some time later. In the mean time, new values are obtained and shown for both sensors. The delay increases when my programis running for a longer time; in the beginning it is something like 0.5 s, later it can become 5 s or even worse. It is not the sensor itself, as one time sensor 1 is delayed and sensor 2 isn't, while a next time I run the program it is the other way around. Also, when I use only one sensor, it works fine, no matter which one I choose. I've also noticed that, when adding a third sensor, the problem appears for 2 of them (so, only 1 sensor seems to give the signal immediately and 2 sensors are delayed). Any ideas what is causing the problem, and how I can solve it?

 

Thanks in advance!

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

Hi RHJH,

 

handle each sensor in its own loop. Then test again…

Best regards,
GerdW


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

Thank you for your reply. I did test that already (should have noticed that, sorry), but it didn't work.

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

Hi RHJH,

 

what happens when you switch the COM port for these two sensors?

Does the problem switch too (so it is related to the sensor) or does it stay with the COM port?

 

Still I would use separate loops for each sensor/COM port…

Best regards,
GerdW


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

The problem switches too in that case, so it does not stay with the COM port.

 

edit: re-reading your post, I may be unclear in what I mean with switching. I switched them in the i/o block (so in labview), and then the other sensor gets the problem. So the same sensor on the same COM port, but at a different location in the VI, works fine then. However, when restarting Labview, the problem may occur the other way around (so that the other i/o block gives fast response).

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

If those VIs are not set to be reentrant, that could potentially cause some issues.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 9
(2,733 Views)

How can I see if they are reentrant, or how can I change it?

 

Am I correct when I state that it may introduce delays between the signals (so the samples of the 2 different sensors will never be obtained at the same time, and the theoretical sampling rate cannot be reached), but that this should not cause a delay in an external signal being transfered to Labview?

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

Found the reentrancy thing, and it seems to work! Thank you very much!

 

For those who need it as well: go to file --> VI properties and select the "Execution" category. Here you can set the default non-reentrant execution to a reentrant form.

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

@RHJH wrote:

Am I correct when I state that it may introduce delays between the signals (so the samples of the 2 different sensors will never be obtained at the same time, and the theoretical sampling rate cannot be reached), but that this should not cause a delay in an external signal being transfered to Labview?


If the VIs are not reentrant, then only one instance of that VI can be in memory.  So it will cause a blocking between your two reads.  So the first one must finish the read before the second one can.  By setting these to reentrant, both calls to that read VI can have their own copy of the VI in memory and run in parallel.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 9
(2,692 Views)