Python Client

The following script shows how an input register senses the state of an output register.

#!/usr/bin/python 

from PyTango import *
import sys
import time

try :
    ireg1 = DeviceProxy( "hires/exp/ireg1")
    oreg1 = DeviceProxy( "hires/exp/oreg1")
    
    attr=ireg1.read_attribute( "Value")
    print "ireg1, value ", attr.value
    attr.value = 1
    oreg1.write_attribute( attr)
    attr=ireg1.read_attribute( "Value")
    print "ireg1, value ", attr.value
    attr.value = 0
    oreg1.write_attribute( attr)
    
except :
    print "Failed with exception !"
    print sys.exc_info()[0]