04-19-2019 10:25 PM
Up until now, I've done TCPIP communication in LabVIEW using the TCP protocol VI's under Data Communication \ Protocols. With this, it is common to program a reconnect strategy, so that if your connection drops, you automatically attempt to reconnect. But that all has to be done at the LabVIEW level.
I now have a simple example of using TCPIP over Visa, and would like to build on it. But I cannot find any definitive information on how VISA handles TCPIP connection issues. Is auto-reconnect built in at a low level, like Network Streams? Or do you just start getting time-out errors if the connection drops.
I've done some forum searching, and have found a few posts that suggest that the latter is the case. One even said that VISA can't even detect whether the TCP connection is good or not. Where-as my possibly faulty recollection of the TCP protocol VI's is that you do get an error if the connection has dropped.
At this point, I'm not even sure if the instrument uses the INSTR or Socket version of the VISA TCPIP connection, so answers on both/either would be appreciated.
Thanks,
DaveT
04-22-2019 09:34 AM
Well, I can help a little bit. I've worked on a project where Mettler balances were sending serial data (weights) at 10 Hz, and all of the Balances (24 of them) were in a remote room. They were connected to a "concentrator" that turned them into TCP/IP addresses. I'm attaching Snippets of the two VIs we wrote to open them (based on the "Station number", from 1 to 24, with Stations 1..12 on one concentrator with 12 Ports and Stations 13..24 on another.
The "hidden Cases" in Open Balance are for a "Simulator" mode (for testing) and for "non-TCP/IP" VISA (for local trouble-shooting). Hope this is useful.
Bob Schor
04-22-2019 09:46 AM
Thanks, Bob. That's a great example. I've put serial devices over Ethernet before, but always had a driver on the computer that made them show up as a serial port. Didn't think about trying to do what you did...
One question regarding your solution: did you ever have connection issues? If the TCP connection ever goes away, what happens in your program?
Cheers,
DaveT
04-22-2019 10:17 AM
@Dave_Thomson wrote:
One question regarding your solution: did you ever have connection issues? If the TCP connection ever goes away, what happens in your program?
In a word, "Crashy-washy". And sometimes a Balance will "go south", or the Switch will need to be rebooted ... Usually doesn't happen in the middle of a run ...
Bob Schor
04-23-2019 10:00 AM
Ugh! NOT the answer I was hoping for!