diff --git a/i2cserv/hba1.py b/i2cserv/hba1.py index bca60ab34931d00c832568e2a9d5a3fc90c9e701..a0d1e2be7290733b0b2d3f65ea8db993a9768337 100644 --- a/i2cserv/hba1.py +++ b/i2cserv/hba1.py @@ -31,14 +31,14 @@ class hba1(hwdev): #Wait for PPS if required else wait a bit if var1.get('wait')=="PPS": channel=GPIO.wait_for_edge(self.pin,GPIO.RISING,timeout=1500) - self.conf['parentcls'].i2csetget(self.addr,[],self.reg,0) + self.conf['parentcls'].i2csetget(self.addr,[self.reg]) if channel is None: logging.info("PPS not received!"); - sleep(0.5) + sleep(0.6) # return False; elif var1.get('wait'): logging.debug("Wait %i ms",var1.get('wait')) - sleep(var1['wait']/100.) + sleep(var1['wait']/1000.) data,mask2=self.conf['parentcls'].GetVarValueMask(var1,mask) Data=OPCUAset(varid,InstType.varSet,data.copy(),mask2.copy()) return [Data] diff --git a/scripts/SetHBAT_BFs.py b/scripts/SetHBAT_BFs.py index 425cd6bc0baba584865969d5871b5c9ab313407f..1d1a9e182c17d33079678cd35373ffa04158dd84 100644 --- a/scripts/SetHBAT_BFs.py +++ b/scripts/SetHBAT_BFs.py @@ -27,7 +27,7 @@ for cnt,NewVal in enumerate(NewValues): if DEBUG: print("set:") for x in range(3): print(val[i+x*32:i+(x+1)*32]) - time.sleep(0.4) + time.sleep(0.5) wait_not_busy("RCU_translator_busy_R",timeout_sec=2) # time.sleep(0.1) val=get_value(name+"_R") diff --git a/scripts/SetHBAT_PPS.py b/scripts/SetHBAT_PPS.py index 2660fc2ce4b1bd811918a9985ca9355a903bdf6f..5eddbdabc4d6096b26c146f47ecb68e3cc3abfd0 100644 --- a/scripts/SetHBAT_PPS.py +++ b/scripts/SetHBAT_PPS.py @@ -8,15 +8,15 @@ import numpy as np setRCUmask(RCU) -val=get_value(name+"_R") +val=get_debug_value(name+"_R") print("old:",val) for r in RCU: val[r]=NewVal -set_value(name+"_RW",val) +set_debug_value(name+"_RW",val) print("set:",val) time.sleep(0.1) -val=get_value(name+"_R") +val=get_debug_value(name+"_R") print("new:",val) disconnect() diff --git a/scripts/SetHBAT_timeout.py b/scripts/SetHBAT_timeout.py new file mode 100644 index 0000000000000000000000000000000000000000..d21476220d51756cc2f3f3d6df0cd7ab1bfb20c0 --- /dev/null +++ b/scripts/SetHBAT_timeout.py @@ -0,0 +1,22 @@ +RCU=[0] +name="HBA_uC_Timeout_RXTX" +NewVal=1536 + +from test_common import * +import numpy as np + +setRCUmask(RCU) + + +val=get_debug_value(name+"_R") +print("old:",val) +for r in RCU: + val[r]=NewVal + +set_debug_value(name+"_RW",val) +print("set:",val) +time.sleep(0.1) +val=get_debug_value(name+"_R") +print("new:",val) + +disconnect() diff --git a/scripts/test_common.py b/scripts/test_common.py index 97c38167d4c8d11a698b394b6bc3b68c057a6d3e..4ea708f26977a7b4aef3726ba41e596cfbd854a2 100644 --- a/scripts/test_common.py +++ b/scripts/test_common.py @@ -1,5 +1,5 @@ -#Address="opc.tcp://odroidRCU2:4842/" -Address="opc.tcp://LTSpi.astron.nl:4842/" +Address="opc.tcp://localhost:4842/" +#Address="opc.tcp://LTSpi.astron.nl:4842/" import sys sys.path.insert(0, "..") import logging @@ -33,6 +33,14 @@ def set_value(name,value): var1 = root.get_child(["0:Objects", "2:PCC", "2:"+name]) var1.set_value(value) +def get_debug_value(name): + var1 = root.get_child(["0:Objects", "2:PCC", "2:DEBUG", "2:"+name]) + return var1.get_value() + +def set_debug_value(name,value): + var1 = root.get_child(["0:Objects", "2:PCC", "2:DEBUG", "2:"+name]) + var1.set_value(value) + def setRCUmask(rcu=[]): name="RCU_mask_RW" M=get_value(name)