diff --git a/script/Marco/power-supply.py b/script/Marco/power-supply.py new file mode 100644 index 0000000..a3fbbb5 --- /dev/null +++ b/script/Marco/power-supply.py @@ -0,0 +1,44 @@ +#Script imported from: PTEST-VME-HW_ps.xml + +#Pre-actions +caput('PTEST-VME-VHQ1:Set-RampA', '25') +sleep(1.0) +caput('PTEST-VME-VHQ1:Set-VA', '0') +sleep(4.0) + +#TODO: Set the diplay names of positioners and detectors +scan = ManualScan(['Set-VA'], ['time', 'Actual-VA'] , [0.0], [50.0], [50]) +scan.start() + +#Creating channels: dimension 1 +#LinearPositioner Set-VA +Set-VA = Channel('PTEST-VME-VHQ1:Set-VA', type = 'd') +#Timestamp time +#ScalarDetector Actual-VA +Actual-VA = Channel('PTEST-VME-VHQ1:Actual-VA', type = 'd') + +#Dimension 1 +#LinearPositioner Set-VA +for setpoint1 in frange(0.0, 50.0, 1.0, True): + if setpoint1 > 50.0 or setpoint1 < 0.0: + break + Set-VA.put(setpoint1, timeout=None) # TODO: Set appropriate timeout + readback1 = Set-VA.get() + if abs(readback1 - setpoint1) > 0.5 : # TODO: Check accuracy + raise Exception('Actor Set-VA could not be set to the value ' + str(setpoint1)) + sleep( 1.0 ) # Settling time + #Detector time + detector1 = float(java.lang.System.currentTimeMillis()) + #Detector Actual-VA + detector2 = Actual-VA.get() + scan.append ([setpoint1], [readback1], [detector1, detector2]) + +#Closing channels +Set-VA.close() +Actual-VA.close() + +scan.end() + +#Post-actions +caput('PTEST-VME-VHQ1:Set-VA', '0') +sleep(4.0)