Dear all,
I have a simple pyTango DS in asyncio mode that only provides two scalar double attributes. A LabVIEW client is supposed to write them. I was wondering why the communication crashes after some writes. I suspected that LV-Bindings has problems with the async mode.
It turned out that a pyTango client shows the same behavior.
But, and this is my question: It only happens (LV or py) when I watch the DS in the Jive ATK monitor. Why actually?
class LVProxyAsync(Device):
green_mode = GreenMode.Asyncio
async def init_device(self):
super().init_device()
self._sinus_signal=float('nan')
self._saw_signal = float('nan')
self.set_change_event('sinus_signal', True, False)
self.set_change_event('saw_signal', True, False)
self.set_state(DevState.RUNNING)
@attribute(dtype=float)
async def sinus_signal(self):
return self._sinus_signal
@sinus_signal.write
async def set_sinus_signal(self, nValue):
self.debug_stream(f"Write Sinus: {nValue}")
self._sinus_signal = nValue
self.push_change_event("sinus_signal", nValue, time.time() , q.ATTR_VALID)
@attribute(dtype=float)
async def saw_signal(self):
return self._saw_signal
@saw_signal.write
async def set_saw_signal(self, nValue):
self._saw_signal=nValue
self.push_change_event("saw_signal", nValue, time.time() , q.ATTR_VALID)
Here is the test client (runs in VS Code jupyther nb)
from tango.asyncio import DeviceProxy as aDS
import numpy, asyncio, tango
lvproxy_async = await aDS("lvproxyasync/lvproxyasync/1")
for i in range(10000):
try:
await lvproxy_async.write_attribute("sinus_signal", numpy.sin(i))
await lvproxy_async.write_attribute("sinus_signal", numpy.sin(i))
await asyncio.sleep(0.1)
except:
print(f"Error after {i} try")
break
— Update -----
The error message:
CommunicationFailed: DevFailed[
DevError[
desc = TRANSIENT CORBA system exception: TRANSIENT_CallTimedout
origin = DeviceProxy:write_attribute()
...
desc = Timeout (3000 mS) exceeded on device lvproxyasync/lvproxyasync/1
origin = DeviceProxy:write_attribute()
reason = API_DeviceTimedOut
severity = ERR]
]