7.11.2 Description
This example opens a TCP connection and kills the single axis group. It enables the
backlash compensation capability (for this the controller must be in the not initialized
state). The group then is initialized and homed. The value of the backlash compensation
is set to 0.1. The positioner executes relative moves with the backlash compensation.
Finally, the backlash compensation is disabled and the program ends by closing the
socket.
CAUTION
• The HomeSearchSequenceType in the stages.ini file must not be
set as CurrentPositionAsHome.
• The Backlash parameter in the stages.ini file must be greater than
zero.
• To apply any modifications of the stages.ini, the controller must
be rebooted
after the modification is made.
Please see the sections:
4 Principle of a Tcl script redirection to a telnet session.
6 Proposed function for error handling.
7.11.3 TCL Code
# Set channel’s name to be used for telnet.
# In this example we assume it is passed to the script as the
# first argument, if not specified output to stdio.
# Open the channel for read mode and get its id,
# this is the id that will be passed to puts function.
if {$tcl_argv(0) != 0} {
set telnetOut [ open "/dev/$tcl_argv(0)" r+]
} else {
set telnetOut stdout
}
# Initialization
set TimeOut 60
set Group "SINGLE_AXIS"
set Positioner "SINGLE_AXIS.MY_STAGE"
set BacklashValue 0.1
set Displacement 10
set code 0
# Open TCP socket
set code [catch "OpenConnection $TimeOut socketID"]
if {$code != 0} {
puts stdout "OpenConnection failed => $code"
flush $telnetOut
} else {
EDH0307En1041 — 10/17
51