Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CCS
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marko Mecina
CCS
Commits
0400a5ad
Commit
0400a5ad
authored
1 year ago
by
Marko Mecina
Browse files
Options
Downloads
Patches
Plain Diff
add generic proc_func
add IWF EGSE commanding template
parent
f156f852
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ccs/scripts/iwf_egse_template.py
+30
-1
30 additions, 1 deletion
Ccs/scripts/iwf_egse_template.py
with
30 additions
and
1 deletion
Ccs/scripts/iwf_egse_template.py
+
30
−
1
View file @
0400a5ad
...
@@ -4,6 +4,35 @@ import iwf_egse as iwf
...
@@ -4,6 +4,35 @@ import iwf_egse as iwf
econ
=
com
.
Connector
(
''
,
iwf
.
PORT
,
msgdecoding
=
'
ascii
'
)
econ
=
com
.
Connector
(
''
,
iwf
.
PORT
,
msgdecoding
=
'
ascii
'
)
econ
.
connect
()
econ
.
connect
()
econ
.
start_receiver
(
procfunc
=
iwf
.
response_proc_func
)
def
save_egse_tm
(
data
,
ts
=
None
):
if
data
.
startswith
(
b
'
k
'
):
htr
=
int
(
data
[
12
:
16
].
decode
(),
16
)
msg
=
'
{}
\t
{}
\t
{}({:.3f} V)
\n
'
.
format
(
ts
,
data
.
decode
(),
htr
,
htr
/
4095
*
5
)
else
:
msg
=
'
{}
\t
{}
'
.
format
(
ts
,
data
.
decode
())
return
msg
econ
.
start_receiver
(
procfunc
=
save_egse_tm
,
outfile
=
'
egselog.dat
'
)
econ
.
send
(
iwf
.
Command
.
get_status
(),
rx
=
False
)
econ
.
send
(
iwf
.
Command
.
get_status
(),
rx
=
False
)
econ
.
send
(
iwf
.
Command
.
set_psu_ok_signal
(
1
,
1
),
rx
=
False
)
# set IWF_EGSE_PSU_OK = 1
econ
.
send
(
iwf
.
Command
.
set_psu_ok_signal
(
3
,
1
),
rx
=
False
)
# set IWF_EGSE_RSE_OK = 1
econ
.
send
(
iwf
.
Command
.
set_psu_ok_signal
(
4
,
1
),
rx
=
False
)
# set IWF_EGSE_PIN_PULL_OK = 1
econ
.
send
(
iwf
.
Command
.
set_rsm_end_switch
(
1
,
1
),
rx
=
False
)
# set IWF_EGSE_CLOSE_POS = 1; response 'R7' -> only for EBOX
econ
.
send
(
iwf
.
Command
.
set_psu_analogue_value
(
iwf
.
Signal
.
EGSE_I_HEATER
,
0
),
rx
=
False
)
# set IWF_EGSE_I_HEATER
econ
.
send
(
iwf
.
Command
.
set_pwm
(
2
,
1663
),
rx
=
False
)
# set CCD Thermistor
econ
.
send
(
iwf
.
Command
.
inject_errors
(
6
,
0
,
3
,
0
,
11
,
0
),
rx
=
False
)
# inject RSE error
import
time
cfl
.
Tcsend_DB
(
'
SASW ModHkPeriodCmd
'
,
101
,
1
,
pool_name
=
'
LIVE
'
)
for
i
in
range
(
0
,
4001
,
1
):
t
=
time
.
time
()
econ
.
send
(
iwf
.
Command
.
set_pwm
(
2
,
i
),
rx
=
False
)
print
(
i
,
t
)
time
.
sleep
(
1
-
(
time
.
time
()
-
t
))
econ
.
send
(
iwf
.
Command
.
set_pwm
(
2
,
0
),
rx
=
False
)
cfl
.
Tcsend_DB
(
'
SASW ModHkPeriodCmd
'
,
101
,
40
,
pool_name
=
'
LIVE
'
)
for
i
in
range
(
1
,
5
):
econ
.
send
(
iwf
.
Command
.
set_psu_analogue_value
(
i
,
0
),
rx
=
False
)
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