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.
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.
Thank you guys. It worked
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.