Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit 7b9cf05

Browse files
Andrew Levinjsturdy
authored andcommitted
move the sleeptime limit warning above the main terminal output
1 parent 97c0c1d commit 7b9cf05

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

python/reg_interface/scripts/repeated_reg_read.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@
3434

3535
writeReg(getNode("GEM_AMC.GEM_SYSTEM.CTRL.LINK_RESET"),0x1)
3636

37-
time.sleep(args.sleeptime/1000000.)
37+
sleeptime = args.sleeptime
38+
if sleeptime < 250.:
39+
print("Warning, sleeptime will be increased to 250 microseconds")
40+
sleeptime = 250.
41+
42+
time.sleep(sleeptime/1000000.)
3843

3944
crc_error_cnt_before = readAddress(getNode("GEM_AMC.SLOW_CONTROL.VFAT3.CRC_ERROR_CNT").real_address)
4045
packet_error_cnt_before = readAddress(getNode("GEM_AMC.SLOW_CONTROL.VFAT3.PACKET_ERROR_CNT").real_address)
@@ -70,11 +75,6 @@
7075

7176
register_values = {}
7277

73-
sleeptime = args.sleeptime
74-
if sleeptime < 250.:
75-
print("Warning, sleeptime will be increased to 250 microseconds")
76-
sleeptime = 250.
77-
7878
for i in range(0,int(args.nreads)):
7979
value = readAddress(node.real_address)
8080

0 commit comments

Comments
 (0)