timeout when no path to TANGO_HOST

I'd like to have my code detect, reasonably fast, if TANGO_HOST is unreachable, to trap the situation. What I see is that either _TangoPing or _TangoReadAttribute time out in 60 sec, if my application computer is offline. Is there a way to shorten this time? I considered Tango SetTimeout, but that doesn't seem to affect the situation - which makes sense if not even the database can be reached. Can anyone suggest how to tackle this from within Labview? Of course I think one option would be to shell out a ping command, I wonder if there is a way all contained in tango.lvlib or in environment vars.
This is my testing code:
Errors spell like below, which makes sense.

tango.lvlib:_TangoExceptionToLabviewError.vi<ERR>
[TangoPing.vi] - ERROR - API_CorbaException - TRANSIENT CORBA system exception: TRANSIENT_CallTimedout - Connection::connect - ERROR - API_CantConnectToDatabase - Failed to connect to database on host X.Y.Z.W with port NNNNN - Connection::connect - ERROR - API_CommandFailed - Failed to execute command_inout on device sys/database/2, command DbImportDevice - Connection::command_inout()

tango.lvlib:_TangoExceptionToLabviewError.vi<ERR>
[TangoReadAttributes.vi] - ERROR - API_CorbaException - TRANSIENT CORBA system exception: TRANSIENT_CallTimedout - Connection::connect - ERROR - API_CantConnectToDatabase - Failed to connect to database on host X.Y.Z.W with port NNNNN - Connection::connect - ERROR - API_CommandFailed - Failed to execute command_inout on device sys/database/2, command DbImportDevice - Connection::command_inout() - ERROR - API_AttributeFailed - Failed to read_attributes on device aaaaaaa/bbbbbb/1, attributes cccccc - DeviceProxy::read_attributes()
Ping?
Sorry for the late answer but I live on another planet now.

I only just added a mechanism throwing an exception in case TANGO_HOST is not defined. I now need time to generate the distribution…

However, Tango itself is supposed to do the same natively - don't understand why you don't get the error coming from the kernel. Please note that we can't do anything for you in TANGO_HOST is defined but not properly set (sys. timeout will apply in this case).
Edited 5 years ago
Here is your Christmas gift smile
Edited 5 years ago
Thanks Nicolas, I'll see if I have a chance to try this out someday. Now it's me being much less involved in that project, and besides I never really figured out how to compile a 32bit windows version.
The doubt still is:
I only just added a mechanism throwing an exception in case TANGO_HOST is not defined
TANGO_HOST is defined but not properly set (sys. timeout will apply in this case)
As my point was to trap and flag a network disruption, i.e. TANGO_HOST is correctly defined and was working but now the network broke, maybe that won't do.
Enrico
 
Register or login to create to post a reply.