Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmytro Levit
Software
Commits
555b1797
Commit
555b1797
authored
5 years ago
by
Patrick Robbe
Browse files
Options
Downloads
Patches
Plain Diff
Adapt script for KEK test bench
parent
9a7b3f8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Scripts/testB2L.py
+16
-11
16 additions, 11 deletions
Scripts/testB2L.py
with
16 additions
and
11 deletions
Scripts/testB2L.py
+
16
−
11
View file @
555b1797
...
...
@@ -54,26 +54,31 @@ def _crc16(data, crc, table):
crc
=
((
crc
<<
8
)
&
0xff00
)
^
table
[((
crc
>>
8
)
&
0xff
)
^
byte1
]
return
crc
&
0xffff
import
socket
hname
=
socket
.
gethostname
()
for
nev
in
range
(
10
):
# Send trigger (adapt this line to your system)
os
.
system
(
"
ssh vme
\"
trigft -80 pulse 1 1
\"
"
)
### ADD this to suppress output >/dev/null 2>&1" )
if
(
hname
==
'
belle2daq.local
'
):
os
.
system
(
"
ssh vme
\"
trigft -80 pulse 1 1
\"
"
)
### ADD this to suppress output >/dev/null 2>&1" )
else
:
### KEK
os
.
system
(
"
ssh ttd3
\"
trigft -23 pulse 1 1
\"
"
)
# wait for data to arrive
attempt
=
0
size
=
0
while
size
!=
892
:
status
,
val
=
mem
.
read
(
0
,
0x00050080
)
size
=
val
attempt
=
attempt
+
1
if
attempt
>
1000
:
for
i
in
range
(
10000
):
mem
.
read
(
0
,
0x00050060
)
print
'
Error in reading: try again now
'
exit
(
0
)
## temporisation of 2s
import
time
time
.
sleep
(
2
)
status
,
val
=
mem
.
read
(
0
,
0x00050080
)
size
=
val
print
"
Number of words received = {}
"
.
format
(
size
)
if
size
==
0
:
print
'
Not enough data read, exit
'
exit
(
0
)
# read data
data
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment