The following Vc module returns the Counts attribute of a VFCADC.
#!/bin/env python import PyTango class VC: def __init__(self): print " VC.init" self.proxies = [] self.proxies.append( PyTango.DeviceProxy( "p09/vfc/exp.01")) # # dev_state # def dev_state( self): argout = self.proxies[0].State() return argout # # Counts # def read_Counts( self): print "vc_attribute:: read-counts " return self.proxies[0].Counts def write_Counts( self, argin): return 1 # # reset # def Reset(self): return True
If we wanted to use this device in Sardana, the file /online_dir/onlineSardana.xml
had to be edited to include the lines which are listed below. We assume that the
VcExecutor device name is p09/vcexecutor/vfc_counts.01
. After a Sardana
shutdown and Sardana startup the device exp_vfc01 is avalable in Spock.
<device> <name>exp_vfc01</name> <tags>expert,user</tags> <type>counter</type> <module>counter_tango</module> <device>p09/vcexecutor/vfc_counts.01</device> <control>tango</control> <hostname>haso107klx:10000</hostname> <pool>pool_haso107klx</pool> <controller>vc_exp_vfc</controller> <channel>1</channel> <rootdevicename>p09/vcexecutor/vfc_counts.01</rootdevicename> </device>