Skip to content
Snippets Groups Projects
Commit 17d79d30 authored by BRONES Romain's avatar BRONES Romain
Browse files

Improve sequence offset seeking

parent 5f858cc9
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,16 @@ def align_ccn(node_tangopath, comlbpif=0):
time.sleep(2+np.random.uniform())
prx.ccnpack0_control=2 # latch it
time.sleep(2)
N.append(prx.ccnpack0_latchedseq1-prx.ccnpack0_latchedseq2)
_N = prx.ccnpack0_latchedseq1-prx.ccnpack0_latchedseq2
# handle diff going from 17 bits to 16bits offset
if _N > 0x7FFF:
_N=_N-0x10000
if -_N > 0x8000:
_N=_N+0x10000
N.append(_N)
logger.debug("seq ({}, {}, {})".format(prx.ccnpack0_latchedseq1, prx.ccnpack0_latchedseq2, N[-1]))
......@@ -76,12 +85,6 @@ def align_ccn(node_tangopath, comlbpif=0):
if N in (-1, 0, 1):
logger.warning("Sequence offset measured = {}, something might be wrong".format(N))
# handle diff going from 17 bits to 16bits offset
if N > 0x7FFF:
N=N-0x10000
if -N > 0x8000:
N=N+0x10000
logger.debug("Setting sequence offset to {}".format(N))
prx["comlbp{}_seqoffset".format(comlbpif)]=N
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment