How to create DeviceProxy with Gevent mode with defined timeout.

Dear All,

We wanted to create device proxy of device server irrespective of it's connection status (connected or disconnected). if deviceProxy is not created it should throw timeout error but it should not wait.

We have tried to use Gevent mode for creating DeviceProxy but it's not working as expected.
We have tried as follow:

>> from PyTango.gevent import DeviceProxy
>> dev = DeviceProxy("HostName:10000/Xyz/X/y",wait = True ,timeout =3)


It's not giving response within 3 second nor timeout Error.

Please let us know is this correct way to create DeviceProxy and suggest solution for the same.

Thanks,
Tcs GMRT Team
Regards,
TCS_GMRT
Hi TCS_GMRT,

I am not sure what your issue is but for the record the creation of the DeviceProxy should always work unless the device is not defined. This was part of the stateless behaviour of DeviceProxy from the beginning. I am not sure why it is not working in PyTango. I let a PyTango expert answer that.

Cheers

Andy
Hi Andy,

Any update from the PyTango experts …
Regards,
TCS_GMRT
Hi TCS_GMRT,

Is the device defined?

I guess you are making your test from the python console. The issue is probably related to the fact that the python console is not gevent friendly. Can you try the same from a python file and tell me the result?

Just to rule out some old version bug, can you tell me which versions of python, gevent and pytango are you using and are you on windows or linux?

Edited 6 years ago
Dear TCoutinho,

Thanks for your suggestion, we tried the same with python file but it didn't work for us.

Here is the python file content:

from PyTango.gevent import DeviceProxy
dev = DeviceProxy("HostName:10000/Xyz/X/y",wait = True ,timeout =3)


Version details:
Python - 2.7
pytango - '8.1.8'
gevent - 1.7




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