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.
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.
05-27-2020 08:47 AM - edited 05-27-2020 08:48 AM
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.
05-27-2020 11:36 AM
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.
06-05-2020 01:22 AM
Thank you guys. It worked
06-05-2021 08:39 AM - edited 06-05-2021 08:42 AM
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.