I am using the VISA functions to communicate with a Sorenson SGA power supply from a Windows XP computer. I have the VISA TCPIP Resource defined in MAX and use this alias name in the VISAResourceName for the input to the VISA Open. Then I write a SCPI command, such as *IDN?, and read the repsonse. Then I close the VISA session. When I look at the TCP statistics using the netstat -n command, I get the following response:
Proto Local Address Foreign Address State
TCP 10.10.10.9:3881 10.10.10.1:111 TIME_WAIT
TCP 10.10.10.9:3882 10.10.10.1:111 TIME_WAIT
If I query the ID again, I get 2 more TCP connections with different local ports numbers. Every time I perform the query, I get 2 more TCP port connections at different local ports. It takes about 1 minute for the TIME_WAIT's to time out. If I query the Sorenson enough, I can fill up my allowable local port connections.
1) Why doesn't the TCP connections go away after the VISA Close?
2) Should I be opening and closing the VISA session every time I want to talk to the Sorenson?
3) What does the VISAResourceName control or constant actual do to resolve the alias into a IP?
This Sorenson power supply does not seem to be very quick to repsond to TCP requests. If I set the timeout on the VISA Open to anything less the 100ms, I cannot get a session open every time. It will fail about 50% of the time.
Has anyone had experince talking to the Sorenson power Supplies using VISA TCPIP?
Thanks,
Julia