LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read waits for full timeout

My program does common things with serial port and VISA blocks, such as sending "AT" commands to a modem and receiving "OK" with termination character \n. All is fine on my PC (Labview 2009), but when i run the same executable on another PC (Runtime engine 2009), and connect it to the same modem, the VISA reads take a lot of time, by unnecessarily waiting for the full timeout. No timeout errors, reads are correct, but very slow. It happens only with my program on that PC, the VISA test panel in MAX is fine. What could be the reason?

0 Kudos
Message 1 of 12
(3,753 Views)
Can you post your code? I suspect that you may not be terminating your read on the termination characters correctly in the code. Does your actual code work on one PC and not the other or are you comparing the results of MAX with your code?


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 12
(3,736 Views)

It works on one PC and not the other. Looks like some machine-level setting of VISA.

Here's the core of comunication code with termination character, however:

Image.png

VISA read generates error when termination char isn't received within timeout.

In second PC, it generates no error and the termchar is received... but as slow as possible!

0 Kudos
Message 3 of 12
(3,731 Views)

Snamprogetti wrote:

It works on one PC and not the other. Looks like some machine-level setting of VISA.

Here's the core of comunication code with termination character, however:

Image.png

VISA read generates error when termination char isn't received within timeout.

In second PC, it generates no error and the termchar is received... but as slow as possible!


Check the radix on the "10" int constant!


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 12
(3,728 Views)

It's decimal 10, that's character \n

0 Kudos
Message 5 of 12
(3,725 Views)
Is that what your data is terminated with? Are you using XON/XOFF flow control? If so, it will filter out the 0x0A byte since it uses that for flow control. Try using hardware flow control instead.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 12
(3,721 Views)

Flow control is left to default (0 - none).

Everything i can set in my Labview program is the same in both PCs, except COM port number

0 Kudos
Message 7 of 12
(3,718 Views)
What about serial hardware?
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 12
(3,715 Views)

The "good" PC has a traditional COM1 port.

The "bad" PC actually has a USB-serial converter, appearing as COM4, but it works fine with terminal or MAX.

The connected modem is the same one.

0 Kudos
Message 9 of 12
(3,703 Views)
Have you tried running NI SPy to see what is happening. You have a fairly significant difference once you introduce the USB to serial. They don't all act the same. Can you try running in the second PC using a regular com port and see if that works.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 10 of 12
(3,700 Views)