LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Timeout Values Don't Work--Temporarily Hangs UI on Invalid Open/Write to GPIB-ENET/100

The main problem--broad overview:

I am trying to initialize two GPIB power supplies on an ENET-GPIB/100 box. When I start my program without being on the network (necessary for programming in one location and using the program at another location), trying to initialize these devices can take up to 30 seconds each (1 minute) during which my UI is hung. This is what I want to correct. Also: the 'network' is a Windows 2000 self initialized network on a direct connect cable to the ENET-GPIB/100 so network traffic is not the problem.

Some investigation has revealed:

On startup, when I am not connected to the network, the resource name for what I'm trying to access (GPIB0::7::INSTR) does not appear in a VISA Resource Name drop down box. When the resource does not appear, I have long timeout delays, usually around 11 seconds, when trying to open, write or set the timeout value itself. Three of these together (set timeout, open, write) with a bad VISA resource were causing my 30 second delays. After removing the set timeout call, and the VISA Open call (which I didn't know previously was unecessary), I now have 11 second delays when trying to initialize, so about 22 or 23 seconds now total.

There are three timeout values I have used to try and correct this:
1) The general visa timeout value which defaults at 2 seconds (to no avail)
2) The I/O timeout value for the GPIB device itself in MAX (it was worth a try, also to no avail)
3) The VISA Open timeout value (also to no avail)

This appears to be a network connectivity issue because my UI (all threads) stall when this happens. By stall I mean it hangs but not permanently--when the VISA call eventually times out, everything you clicked/typed/did happens all at once

Scenario:
Program starts, no ethernet connection to GPIB-ENET/100 has been established.
Power supply init times out in ~10secs/supply

Ethernet connection established:
Power supplies init correctly

Connection broken (unplugged / loss-of-comm):
Timeouts of 20-40 seconds/supply while entire program is completely stalled (not a good thing)

I have a few questions that might help me resolve this:
There is no delay time in pinging the ENET-GPIB/100 to see if it is available. This tells me if I should even try and talk to it / initialize since it will be of no use if the network is down. This requires an IP address and is doable but it means that I cannot change the ENET-GPIB/100 IP address in MAX at any given point when needed, without also telling my compiled program the new address somewhere in an init file.

Question: Is it possible to determine the IP address of an ethernet device given it's VISA Resource Name?

Since my resource name (GPIB0::7::INSTR) is constant, but not always valid (when I'm unplugged), I tried using VISA Find Resource to determine if it was a valid resource. This also has the same delay problems... ~10-11 seconds at first when initially started not plugged in, no delay (and finds resource) when plugged in, and long delays (up to 90 seconds) after unplugging again... during which point, as I mentioned earlier, my UI is completely stalled and I can't even click the 'STOP' button.

Question: Is there another way besides VISA Find Resource to determine if the resource I want to access is valid?

Any other suggestions on getting rid of this timeout delay would be greatly appreciated.
0 Kudos
Message 1 of 3
(2,821 Views)
Hi,

A simple solution I found is using the Open VISA VI to access the resource. The execution stop while the VISA open is searching for the resource, but at least the UI remains active. If you add the VISA open VI, make sure you also include a VISA close. If you add the VISA open VI by itself, it won't do anything.

When I used the VISA write by itself, it hanged the UI (blank UI, etc). Using the VISA Open I can move the screen, type ,etc.


I couldn't find a way to get the IP address of a GPIB resource.

Also, even though you are using LabVIEW, I suggets you post this question on the VISA discussion forum. Someone else might provide more information.

DiegoF.
National Instruments.
0 Kudos
Message 2 of 3
(2,820 Views)
Thanks for the pointer to the VISA discussion forum...
0 Kudos
Message 3 of 3
(2,820 Views)