Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

visa open on gpib device takes 30 seconds after > 30 minute idle

After access to the device has been idle for > 30 minutes, it takes 30 seconds for visa open on the device to complete.
 
HW setup:
gpib device (either hp6674 power supply or hp function generator, doesn't matter)
GPIB-ENET100 ni488-2
linux rh3
ni visa 4.0 or ni visa 3.1
labview 7.1
 
This becomes a problem when long term tests are running and the timing of a particular test changes from run to run.
 
Is the visa rescanning for all devices?
Are there some properties that can be set to keep the device alive or active?
 
I used a vi that timed the open, write, read, close to the device and then waited a progressively longer period of time.  With repeats of < 30 minutes, the cycle would complete in 70-90 ms.  When repeats hit the 30 minute period, the cycle would complete in 30 seconds where the open took 30 seconds and the write/read/close took a negligible amount of time.
 
Hugh
0 Kudos
Message 1 of 5
(3,990 Views)
Howdy hbaugh,

You want to use a VISA Close at the end of each iteration of VISA communication. Then open a new VISA session using VISA Open for each test you run.

Do you see the same behavior when you run the test on another machine, perhaps Windows-based?
Warm regards,

pBerg
0 Kudos
Message 2 of 5
(3,971 Views)
The test I am using is visa open/visa write/visa read/visa close wait 30 minutes, repeat.
 
When the wait is less than 30 minutes, the cycle take 50-70ms, greater than 30 minutes, the cycles take 30 seconds.
 
I have tried this on two different linux machines with similar setups with the same results.
 
I do not have access to a windows machine to try it out.
 
I was speculating it might be a gpib enet 100 thing.
 
Hugh
0 Kudos
Message 3 of 5
(3,958 Views)
Howdy hbaugh,

It sounds like your OS might have a TCP/IP timeout to the device if it happens at intervals >30min. I don't know how to change or check the timeout in RH, but it wouldn't surprise me if that were the culprit.

If it only happens if you wait >30min to read from the ENET device again, the simplest way to prevent a timeout would be to create an additional task that does some GPIB-ENET communication with the hardware at 15min after each test. You could do something simple like an *IDN? query that should keep the connection active and open without affecting anything your GPIB instruments are doing. Summarily, your timeline would look like this:

1. Perform your current test
2. Wait 15 min
3. Perform an *IDN? query
4. Wait 15 min.
5. Goto step 1 If not finished. Else, Goto step 6
6. End.

Using this technique the interval between communications to the GPIB-ENET would never exceed 30 min.
Warm regards,

pBerg
0 Kudos
Message 4 of 5
(3,947 Views)
More info:
After > 30 minutes idle, even a ping to the gpib-enet100 box takes 20 seconds to respond which leads me to believe that the gpib-enet100 box itself it going into some sort of sleep mode.
 
I sent 4 consecutive pings (with default 10 second timeouts) and used tcpdump to observe all net traffic on that interface and saw the following:
Note: tennet is the interface that the gpib-enet100 box is on, i.e. 10.10.10.x
 
<first ping, times out>
10:38:43.121123 tennet > GPIBENET0: icmp: echo request (DF)
10:38:48.120396 arp who-has GPIBENET0 tell tennet
10:38:49.120379 arp who-has GPIBENET0 tell tennet
10:38:50.120373 arp who-has GPIBENET0 tell tennet
10:38:53.123511 arp who-has GPIBENET0 tell tennet
10:38:53.124043 arp reply GPIBENET0 is-at xx:xx:xx:xx:xx:xx
<second ping, times out>
10:38:53.124051 tennet > GPIBENET0: icmp: echo request (DF)
< third ping, receives response>
10:39:03.123446 tennet > GPIBENET0: icmp: echo request (DF)
10:39:03.124055 GPIBENET0 > tennet: icmp: echo reply
<fourth ping, receives response>
10:39:03.127233 tennet > GPIBENET0: icmp: echo request (DF)
10:39:03.127801 GPIBENET0 > tennet: icmp: echo reply
 
These results are repeatable after the gpib-enet100 box remains idle for > 30 minutes
 
My solution is to ping the gpib-enet100 box every 10 minutes to keep it awake which worked in overnight testing.
 
Did not see any settings that refer to a sleep mode but may be hidden.
 
This issue occurrs with both b9 and c9 versions of the firmware.
 
Any NI people out there that can comment on the gpib-enet100 going into a sleep mode after 30 minutes?
 
Hugh
0 Kudos
Message 5 of 5
(3,870 Views)