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: 

Programmatically Add Network Device (VISA)

Thanks Bob. I just have one more clarification needed. While implementing TCP communication using the regular TCP VIs in LabVIEW, I usually handle the connection drop that can occasionally happen if the connection is silent for some time. So a reconnection method will be implemented. In the case of doing it using VISA TCP/IP, do I have to worry about the above scenario when a connection loss occur or does the VISA manages this at its lower level. I found a  'TCP Keep Alive 'method in VISA properties. Do I have to do something about it.

 

 

-----------------------------------------------------------------------------------------------------------------------------
Waiting For the inner calling 🙂


0 Kudos
Message 21 of 24
(727 Views)

It has not been a problem for me.  But it will depend on the instrument.  I would enable the keep alive just to be safe.


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 22 of 24
(712 Views)

Thank you guys. It worked

-----------------------------------------------------------------------------------------------------------------------------
Waiting For the inner calling 🙂


0 Kudos
Message 23 of 24
(661 Views)

The TCP/IP Keep Alive property is controlling directly a socket attribute. If enabled, socket will itself periodically send out an empty TCP/IP frame and await it’s acknowledgement by the remote side. This was initially meant to keep a data connection alive as TCP/IP was still mostly routed over landlines that cost money per minute and not per data amount. In order to reduce costs, intermediate modems were often configured to drop the connection after a certain amount of idle time. The keep alive packets reset that idle timer and keep the line open. Nowadays it is sometimes used by devices to not go into a sleep state, which could incur a lengthy wake-up delay when finally a new packet arrives. It also can help to detect bad connections since when the keep alive packet is not acknowledged after some time the socket will go into an error state which will be passed up to the application next time if accesses the socket actively.

 

But VISA doesn’t do automatic reconnect handling on such errors. The VISA nodes will report an error and your application has to deal with them just as with the native TCP nodes.

Rolf Kalbermatter
My Blog
0 Kudos
Message 24 of 24
(551 Views)