Tango API

Let's start with a very simple example. We execute the standard plan scan with a motor and a few counters. Then we see what is necessar to accomplish this task:

 
#!/usr/bin/env python3

import blueskyDESY
from bluesky import RunEngine
from bluesky.plans import scan
 
def main():
    #
    # get the active measurement goupd
    #
    AMG = blueskyDESY.getActiveMntGrp()
    print( "testMG.main: AMG %s " % repr( AMG))
    #
    # {'counters': ['eh_c01', 'eh_c02', 'eh_c03'],
    #  'timers': ['eh_t01'],
    #  'sampleTime': 0.       1}
    #
    mg = blueskyDESY.Experiment( read_attrs = AMG[ 'counters']) 
    eh_mot65 = blueskyDESY.motorTango( name = 'eh_mot65')

    RE = RunEngine() 
    #
    # docCallback sends the data to be displayed to pyspMonitor
    #
    RE.subscribe(blueskyDESY.docCallback())

    try: 
        RE(scan([mg], eh_mot65, 0, 0.1, 3))
    except Exception as e:
        print( "plan raised an exception, %s" % repr( e))
    
    return 
    
if __name__ == "__main__":
    main()



Subsections