import  ch.psi.pshell.epics.ControlledVariable as ControlledVariable

phase = ControlledVariable("Phase", "TESTIOC:TESTCALCOUT:Input", "TESTIOC:TESTSINUS:SinCalc")
phase.config.minValue   = 0
phase.config.maxValue   = 1000
phase.config.resolution = 1
phase.initialize()

try:
    r = lscan(phase, sin, 0, 100, 10, latency=0.5)
finally:
    phase.close()
    #st.close()