Script execution

This commit is contained in:
voulot_d
2017-01-31 08:45:56 +01:00
parent c50853ea81
commit 7bb50d44ba

View File

@@ -9,12 +9,12 @@ if get_exec_pars().source == CommandSource.ui:
else:
start = args[0]
stop = args[1]
step = args[2]
nb = int(args[3])
lat = args[4]
step = args[2]
nb = int(args[3])
lat = args[4]
phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE-SIM", "SINEG01-RSYS:GET-VSUM-PHASE-SIM")
phase = ControlledVariable("Phase", "SINEG01-RSYS:SET-VSUM-PHASE-SIM", "SINEG01-RSYS:GET-VSUM-PHASE-SIM")
phase.config.minValue =-45.0
phase.config.maxValue = 360.0
phase.config.resolution = 0.5
@@ -24,13 +24,14 @@ phase.initialize()
#q = st.addScalar("Charge", "SINEG01-DICT215:B1_CHARGE-SIM", 1, 0)
#st.initialize()
#st.start(True)
q = Channel("SINEG01-DICT215:B1_CHARGE-SIM", type = 'd', alias='ICT-Q')
q = Channel("SINEG01-DICT215:B1_CHARGE-SIM", type = 'd', alias='ICT-Q')
try:
qb = create_averager(q, nb, 0.100)
r = lscan(phase, (qb), start, stop, step, latency=lat)
rf_phase = r.getPositions(0)
charge = [val.mean for val in r.getReadable(0)]
chargerms = [val.stdev for val in r.getReadable(0)]
finally:
phase.close()
q.close()
@@ -38,9 +39,8 @@ finally:
#Setting the return value
#set_return(50.0)
y = r.getReadable(0)
x = r.getPositions(0)
y = [v.mean for v in y]
y = charge
x = rf_phase
index_max = y.index(max(y))
phase_ref = x[index_max] - 90
phase_offset = - phase_ref