Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sample_changer
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
Bliss
Tango Servers
sample_changer
Commits
abe6057d
Commit
abe6057d
authored
6 years ago
by
bliss administrator
Browse files
Options
Downloads
Patches
Plain Diff
Added error handling in the align, load_sample and unload_sample macros.
parent
a424e22a
Branches
add_helical
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
macros/SampleChanger.mac
+55
-15
55 additions, 15 deletions
macros/SampleChanger.mac
with
55 additions
and
15 deletions
macros/SampleChanger.mac
+
55
−
15
View file @
abe6057d
...
@@ -535,7 +535,8 @@ def tomo_sc_load_sample '{
...
@@ -535,7 +535,8 @@ def tomo_sc_load_sample '{
local sample_pos
local sample_pos
local aligned
local aligned
local align_pos
local align_pos
local robot_state
local ret
local robot_state, robot_status
if ($# < 1 || $# > 2 ) {
if ($# < 1 || $# > 2 ) {
print "usage: $0 <sample position or name>"
print "usage: $0 <sample position or name>"
...
@@ -586,15 +587,29 @@ def tomo_sc_load_sample '{
...
@@ -586,15 +587,29 @@ def tomo_sc_load_sample '{
_tango_error (ret)
_tango_error (ret)
}
}
print "\nMove to experiment position"
sleep(1)
tomo_sc_experiment_position (align_pos[0], align_pos[1], align_pos[2])
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
_tango_error (ret)
print "\nSample loading done!"
if ( robot_state == 0 ) {
print "\nMove to experiment position"
tomo_sc_experiment_position (align_pos[0], align_pos[1], align_pos[2])
print "\nSample loading done!"
} else {
print "\nSample loading did not finish as expected!"
print "\nThe sample changer status is:"
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "Status", robot_status)
_tango_error (ret)
print robot_status
exit
}
}'
}'
def tomo_sc_unload_sample '{
def tomo_sc_unload_sample '{
local ret
local robot_state, robot_status
print "Beam shutter closing"
print "Beam shutter closing"
shclose
shclose
...
@@ -609,12 +624,26 @@ def tomo_sc_unload_sample '{
...
@@ -609,12 +624,26 @@ def tomo_sc_unload_sample '{
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
_tango_error (ret)
_tango_error (ret)
while (robot_state == 6) {
while (robot_state == 6) {
sleep(
5
)
sleep(
3
)
printf (".")
printf (".")
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
_tango_error (ret)
_tango_error (ret)
}
}
print "\nSample unloading done!"
sleep(1)
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
_tango_error (ret)
if ( robot_state == 0 ) {
print "\nSample unloading done!"
} else {
print "\nSample unloading did not finish as expected!"
print "\nThe sample changer status is:"
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "Status", robot_status)
_tango_error (ret)
print robot_status
exit
}
}'
}'
...
@@ -622,6 +651,7 @@ def tomo_sc_align '{
...
@@ -622,6 +651,7 @@ def tomo_sc_align '{
local ret
local ret
local confirm
local confirm
local is_aligned
local is_aligned
local robot_state, robot_status
print "Move to alignment position"
print "Move to alignment position"
tomo_sc_change_position
tomo_sc_change_position
...
@@ -642,22 +672,32 @@ def tomo_sc_align '{
...
@@ -642,22 +672,32 @@ def tomo_sc_align '{
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
_tango_error (ret)
_tango_error (ret)
# test to 6 == robot is moving, if not return error!
# test to 6 == robot is moving, if not return error!
print robot_state
while (robot_state == 6) {
while (robot_state == 6) {
sleep(
5
)
sleep(
3
)
printf (".")
printf (".")
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
_tango_error (ret)
_tango_error (ret)
}
}
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "Aligned", is_aligned)
sleep(1)
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "State", robot_state)
_tango_error (ret)
_tango_error (ret)
if ( robot_state == 0 ) {
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "Aligned", is_aligned)
_tango_error (ret)
if (is_aligned == 1) {
if (is_aligned == 1) {
print "\n\nThe sample changer is aligned!"
print "\n\nThe sample changer is aligned!"
} else {
print "\n\nThe alignment procedure ended without error, but the alignment failed!"
print "Please check the sample changer!"
}
} else {
} else {
print "\n\nThe alignment procedure ended without error, but the alignment failed!"
print "\nAlignment did not finish as expected!"
print "Please check the sample changer!"
print "\nThe sample changer status is:"
ret = tango_get (TOMO_SC_ROBOT_DEVICE, "Status", robot_status)
_tango_error (ret)
print robot_status
}
}
}
}
}'
}'
...
...
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