Friday, 7 October 2016

PyTango: Device Commands

Passing Arguments to Device command_inout

When type of Arguments is special like DevVarLongStringArray the introduction of arguments is something like:
In [25]:api.manager.command_inout('UpdateSnapComment',[[40],['provant,provant...']])

Using asynchronous commands


cid = self.modbus.command_inout_asynch(command,arr_argin)
while True:
    self.debug('Waiting for asynchronous answer ...')
    threading.Event().wait(0.1)
    #time.sleep(0.1)
    try:
        result = self.modbus.command_inout_reply(cid)
        self.debug('Received: %s' % result)
        break
    except PyTango.DevFailed,e:
        self.debug('Received DevFailed: %s' %e)
        if e.args[0]['reason'] != 'API_AsynReplyNotArrived':
           raise Exception,'Weird exception received!: %s' % e

No comments:

Post a Comment