Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL Blocking
Commits
9394e0b4
Commit
9394e0b4
authored
Feb 15, 2017
by
Projects
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/pulse_rejection: updated to the new version of PyBECO
parent
787cb3a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
pulse_rejection.py
software/tests/pulse_rejection.py
+17
-10
No files found.
software/tests/pulse_rejection.py
View file @
9394e0b4
...
...
@@ -12,7 +12,7 @@ import sys
import
time
sys
.
path
.
append
(
"../PyBECO"
)
from
PyBECO.boards
import
PyConvTTL
,
PyConvTTLException
from
PyBECO.boards
import
PyConvTTL
BLO
,
PyConvTTLException
from
PyBECO.fec
import
Elma
,
ElmaException
# crate credentials
...
...
@@ -27,7 +27,8 @@ slot = int(input("Slot number: "))
cooldown_time
=
20
# number seconds of cool down time between tests
elma
=
Elma
(
address
,
user
,
password
)
convttl
=
PyConvTTL
(
slot
,
elma
)
convttl
=
PyConvTTLBLO
(
slot
,
elma
)
convttl
.
reset
()
# display status
print
(
convttl
.
status
)
...
...
@@ -45,6 +46,7 @@ if convttl.status.gw_version[0] != 4:
if
(
convttl
.
status
.
switch
[
1
]):
# short pulse
print
(
"Running short pulse tests"
)
tests
=
(
{
'freq'
:
2000000
,
'seconds'
:
1
},
{
'freq'
:
1333333
,
'seconds'
:
6.5
},
...
...
@@ -78,7 +80,7 @@ for test in tests:
# test if the guaranteed number of pulses is repeated
# clear counters
for
ch
in
range
(
1
,
7
)
:
for
ch
in
convttl
.
CHANNELS
:
convttl
.
pulse_counter_set
(
ch
,
(
0
,
0
))
# clear errors (including missed pulse flags)
...
...
@@ -100,9 +102,10 @@ for test in tests:
old_counters
=
convttl
.
pulse_counters
for
ch
in
range
(
1
,
7
):
pulse_missed_errors
=
(
convttl
.
ERRORS_MASK_FLIM_MISSED
(
ch
),
convttl
.
ERRORS_MASK_FWDG_MISSED
(
ch
))
for
ch
in
convttl
.
CHANNELS
:
# set of missed pulse error flags for this channel
pulse_missed_errors
=
(
convttl
.
error
.
ERRORS_MASK_FLIM_MISSED
(
ch
),
convttl
.
error
.
ERRORS_MASK_FWDG_MISSED
(
ch
))
if
old_counters
[
ch
-
1
][
0
]
!=
0
and
old_counters
[
ch
-
1
][
1
]
!=
0
:
print
(
"WARNING: Both pulse counters are increasing, check if it is ok"
)
...
...
@@ -133,7 +136,7 @@ for test in tests:
continue
# are meant to repeat pulses without rejecting any
# clear counters
for
ch
in
range
(
1
,
7
)
:
for
ch
in
convttl
.
CHANNELS
:
convttl
.
pulse_counter_set
(
ch
,
(
0
,
0
))
# clear errors (including missed pulse flags)
...
...
@@ -149,7 +152,7 @@ for test in tests:
print
(
"Pulse counters:"
)
test_run
=
True
passed
=
[
False
for
_
in
range
(
6
)
]
# passed test flags for each channel
passed
=
[
False
for
_
in
convttl
.
CHANNELS
]
# passed test flags for each channel
# test if pulses are rejected after a certain threshold
while
(
test_run
):
...
...
@@ -173,8 +176,12 @@ for test in tests:
print
(
"TEST FAILED: channel
%
d missed a pulse too early (
%
d)"
%
(
ch
,
pulse_count
))
sys
.
exit
(
2
)
elif
not
passed
[
ch
-
1
]:
print
(
"TEST PASSED: rejected
%
d pulse at channel
%
d"
%
(
pulse_count
,
ch
))
passed
[
ch
-
1
]
=
True
if
convttl
.
error
.
ERRORS_MASK_FLIM_MISSED
(
ch
)
&
errors
:
print
(
"TEST FAILED: pulse rejected on channel
%
d, but FLIM_MISSED bit is set"
%
(
ch
))
sys
.
exit
(
2
)
else
:
print
(
"TEST PASSED: rejected
%
d pulse on channel
%
d"
%
(
pulse_count
,
ch
))
passed
[
ch
-
1
]
=
True
# even if the test was passed, wait for the end of current pulse burst
if
(
pulse_count
>=
pulses
*
2
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment