How to set timeout while reading Tango attribute in Synchronous mode?

Dear Tangoers,

I want to know how to set timeout while reading Tango attribute in Synchronous Mode. I am facing issue while server disconnected with client and client try to fatch attribute value so it's tack much time to get exception response and because of this GUI get hanged.

can I set timeout for attribute reading so that it will not wait for reply if timeout occur.?

I have used the set_timeout_millis(1000) to set timeout 1000ms but didn't worked for me.

please provide example if possible.

Thanks,
Hitesh Patel

Regards,
TCS_GMRT
Edited 7 years ago
Hi Hitesh,

I am not sure I understand your problem. Setting the timeout use the set_timeout_millis(1000) should work. You might want to set the timeout even lower e.g. 100 ms. When you say the server is disconnected do you mean the computer on which it is running is switched off? In which case you might have a longer timeout due to TCP. Please describe your use case more clearly so we can help you.

Other possibilities are to use events or asynchronous calls.

Andy
Dear Andy,

My Issue is while reading Attribute in Synchronous Mode if remote server disconnected then my GUI client get hanged due to blocking until reply not came or Tango Dev Connection error exception occur. can I use Timeout in Synchronous mode while reading tango attribute or it's only work if green_mode is not Synchronous.

I want timeout event while attribute reading should give me some event or timeout exception.

Thanks,
Hitesh Patel
Regards,
TCS_GMRT
Hi Hitesh,

which language are you using? It sounds like Python because you talk about green_mode. If you are using greenlets then the call will be asynchronous even if you make a synchronous call. Can you send us a code snippet so we can see how you access the server.

I don't know how to wake up a greenlet with an exception. Maybe a Python expert can help you solve this issue.

Cheers

Andy
Dear Andy,

Thanks for prompt reply.

I am Using Python language for creating Tango client proxy and that proxy I have used in for reading attribute value. My issue is due to server disconnection while reading attribute reading gets blocked due to server disconnected from client, due to this blocking my PyQt Gui get hanged.

Here is code snippet I am using.

Dev_Proxy = PyTango.DeviceProxy("01hw255501:10000/Pune/TCS/machine1") #device proxy for machine1
# Reading date attribute of machine1
date = Dev_Proxy.date

My problem is while reading date is server disconnected then it's blocking until response came so that my PyQt GUI get hanged.

I want to implement asynchronous call for reading attribute so it's not blocking process if response is not coming.

if possible, please provide example for attribute reading in asynchronous mode.

Thanks,
Hitesh Patel
Regards,
TCS_GMRT
 
Register or login to create to post a reply.