Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems when the GPIB-ENET/100 is powered off.

Is there a way, other than Ping, to prevent the long timeout periods when a GPIB-ENET/100 is in or enters a bad state such as powered off?
0 Kudos
Message 1 of 3
(3,494 Views)
Hi,

I did some tests and searched through the documentation, but I couldn't find any NI-488.2 function that would explicitly verify if the IP address is valid.

An EDVR means that an operating system error occured. Some function within the driver failed and the error code returned by the function is store in ibcnt.

You could use this error to as a signal that the ENET is not there or it is off. Any EDVR means some fatal error occur, so you can assume you need to restablish communication. It doesn't matter if the ENET is off or the network is failing, in any case the EDVR will indicate a fatal condition.

You can then call a function that handles this situation by calling ibonl(ud,0) to close the handle (which i think will also return an EDVR error)
and then try to restablish communication using the ibdev function.

The reason the timeout value doesn't affect the time it takes for the function to return is that the timeout is used to abort GPIB operations, not function calls. The timeout value is used by the ENET firmware to determine when to abort an I/O operation on the GPIB bus. The driver doesn't use this value to timeout the network communication.

Finally, you could use the windows socket API in your code to determine if the IP address is valid. You could probably find some simple ping code that you could include in your application.

Hope this helps.
Diego
0 Kudos
Message 2 of 3
(3,494 Views)
Thank you Diego.

It makes sense that the timeout is for the GPIB bus activity not the network communications.

I will give your ideas a try.

Jack
0 Kudos
Message 3 of 3
(3,494 Views)