LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The TCP/IP connection does not closed after a VISA close

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
0 Kudos
Message 1 of 3
(3,846 Views)
Hi Julia,

Let me try answering your questions here.

1) I'm actually currently looking into this to see if this is expected behavior, and I'll definitely post back to let you know what I find.
2) You do not need to close a VISA session everytime you want to communicate with the device, you can leave the same session open and keep using that session, instead closing it out at the end.
3) The VISA aliases and what they correspond to are stored in a visaconf.ini file. There is more information about this file and where it is located on your hard disk in this KnowledgeBase article here. This visaconf.ini file is checked to see what the actual resources being looked up are.

Let me know if I answered your questions, I will write back with more information on question 1.
Rasheel
0 Kudos
Message 2 of 3
(3,803 Views)

Hi Julia,

I think this will give an idea whats going on...

regards

0 Kudos
Message 3 of 3
(3,787 Views)