LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Timeout Problem

Hi,

 

I've got a really annoying problem currently while trying to initialise a TCP connection as a VISA resource.

 

If I connect a network analyser to my laptop via a LAN cable, the VISA resource is found and if I try to communicate with it over this connection, it works fine.

 

The problem occurs if I leave it for several minutes without running any code. If I try to run any code to control the analyser, I get a timeout error. If I unplug the LAN cable and re-plug it in, the connection re-initialises itself and it'll work again until I leave it for several minutes.

 

So far, I've tried turning off power saving mode on both devices. My logic is to send null packets to the analyser to keep the connection alive. Does this seem logical, and if so is there a way I can programmatically restart the TCP connection beforehand so that the connection will always be there?

 

Many thanks in advance!

Charlie

 

0 Kudos
Message 1 of 5
(2,833 Views)

It may be a property of your analyzer.  I could imagine designing an analyzer to be placed on a network, available to whomever sends it a "Request for Use" packet, which causes the analyzer to "attach" to that host.  I could also imagine that if the host stops sending the occasional packet, I might want to "disconnect" from that host so that someone else could use me (this is called "Sharing").

 

If something like this is the case, then unless you change the behavior of the analyzer so that once allocated, it stays allocated "forever" (requiring a reboot of the analyzer to be used by anyone else), a reasonable way to keep it "captured" is to make periodic requests, as you are suggesting.

 

Note this is not unlike PC "sleep" policies, where the screen goes blank or the computer shuts down if there is "no activity" for a period of time.  This can be serious if the PC is monitoring something critical, as it generally requires mouse or keyboard activity to signal "I'm still here".

 

Bob Schor

0 Kudos
Message 2 of 5
(2,780 Views)

Hi Bob,

 

Thanks for the reply and apologies for the late response!

 

I've been tinkering around on and off for a while now and annoyingly I'm still in pretty much the same position.

 

One thing I did try today was sending continual ping requests via CMD running in the background, but it seemed to still have the same issue after leaving it for some time. It also appears to be quite random which is even more annoying.

 

I'm not sure if maybe it has something to do with the drivers I'm using or if it's a feature of the LAN VISA connection, but my whole project relies on reliable connection to the network analyser.

 

Thanks again for all support! As always, much appreciated! 🙂

 

Charlie.

0 Kudos
Message 3 of 5
(2,719 Views)

Have you tried using the TCP functions available in LabVIEW instead of VISA?

0 Kudos
Message 4 of 5
(2,709 Views)

Hey Nathan,

 

Thanks for the reply. I was looking at this but I couldn't work out how to use it with the drivers as they take a VISA input.

 

Thanks,

Charlie

0 Kudos
Message 5 of 5
(2,701 Views)