Commit 755d7637 authored by Francesco Tripaldi's avatar Francesco Tripaldi
Browse files

Add TopUp Test Mode

parent 78ae95c0
......@@ -24,7 +24,7 @@ attr;publish_to_elog;bool;1
attr;graph_title;string;GUN grid Scan
attr;best_vgrid_result;double;0
attr;plot_best_vgrid;bool;1
attr;topup_test_mode;bool;0
```
......
......@@ -52,6 +52,7 @@ def main():
scan_start = selfseq_dev.read_attribute("scan_start").value
scan_stop = selfseq_dev.read_attribute("scan_stop").value
scan_step = selfseq_dev.read_attribute("scan_step").value
topup_test_mode = selfseq_dev.read_attribute("topup_test_mode").value
dcct_samples = int(selfseq_dev.read_attribute("dcct_mean_samples").value)
starting_gun = gun_dev.read_attribute('GridVoltage').value
selfseq_dev.write_attribute("ScriptErr","")
......@@ -81,12 +82,16 @@ def main():
if bool(timing_enable.read_attribute("ExtractionEnabled").value) == False:
selfseq_dev.write_attribute("ScriptErr", 'SE Extraction DISABLED')
sys.exit(1)
if float(gun_dev.read_attribute('GridVoltage').value) < 0.5 :
plc_status = dcct_dev.read_attribute('Stat').value
if float(gun_dev.read_attribute('GridVoltage').value) < 0.5 and topup_test_mode == False:
selfseq_dev.write_attribute("ScriptErr","Grid disabled or zero voltage during scan")
gun_dev.write_attribute('FastGridVoltage',starting_gun)
sys.exit(1)
if topup_test_mode == True and (plc_status[9] == True or bool(trigger_gun.read_attribute("gun_trigger_on").value) == False):
#print("Interlock dcct booster, stop")
scan_stop = x
break
#print("valore gun: " + str(x))
gun_dev.write_attribute('FastGridVoltage',x)
if not first_time:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment