Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eehg-master
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs
ds
eehg-master
Commits
bb738ec9
Commit
bb738ec9
authored
1 week ago
by
Mauro Trovo
Browse files
Options
Downloads
Patches
Plain Diff
add utilizzo
parent
b199cbdf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/ScrivoEcoMaster.py
+51
-0
51 additions, 0 deletions
docs/ScrivoEcoMaster.py
with
51 additions
and
0 deletions
docs/ScrivoEcoMaster.py
0 → 100644
+
51
−
0
View file @
bb738ec9
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 1 10:32:43 2025
Funzione per il settaggio della nuova lunghezza d
'
onda su eco master>
@author: Mauro T,
"""
import
PyTango
import
time
#from tango import DevState
def
cambio_lambdaECO
(
new_wavelength
=
13.2
):
device
=
'
srv-tango-srf-01:20000/fel01/master/eehg_fel01.01
'
# new_wavelength = 13.2
time_step
=
0.2
tempo_massimo
=
15
master_proxy
=
PyTango
.
DeviceProxy
(
device
)
# 1 aggiorno i valori dal campo
master_proxy
.
command_inout
(
'
ReadFromField
'
)
time
.
sleep
(
0.2
)
# 2 scrivo la lunghezza d'onda richiesta
master_proxy
.
write_attribute
(
'
lambda_fel
'
,
new_wavelength
)
# 3 lancio il calcolo necessario
master_proxy
.
command_inout
(
'
Calculate
'
)
time
.
sleep
(
0.3
)
# 4 attendo che sia finito, ... puo' richiedere svariati secondi
contatore
=
0
attesa
=
True
while
attesa
:
contatore
+=
1
# server_state = master_proxy.command_inout_asynch('State')
server_state
=
master_proxy
.
command_inout
(
'
State
'
)
if
server_state
!=
PyTango
.
DevState
.
RUNNING
:
break
if
contatore
>
(
tempo_massimo
/
time_step
):
attesa
=
False
time
.
sleep
(
time_step
)
# 5 applico se non e' andato in time out
if
attesa
and
master_proxy
.
command_inout
(
'
State
'
)
==
PyTango
.
DevState
.
ON
:
# master_proxy.command_inout('ApplyAll')
print
(
'
tutto ok ed avrebbe applcato
'
)
#cambio_lambdaECO(12.2)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
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