XPS-Q8
Tcl Manual
return
}
# Disable jog mode
# (constant velocity must be null on all positioners from group)
set
code [
catch
"
GroupJogModeDisable
$socketID $Group"]
if
{$code !=
0
} {
DisplayErrorAndClose
$socketID $code "GroupJogModeDisable"
$telnetOut
return
}
# Close TCP socket
set
code [
catch
"TCP_CloseSocket $socketID"]
}
7.9
Jogging and Gathering
7.9.1
Configuration
Group type
Number
Group name
Positioner name
XY
1
XY
XY.X_VP and XY.Y_VP
7.9.2
Description
This example opens a TCP connection, kills the XY group, then initializes and homes.
The program then configures the parameters for gathering (data to be collected: setpoint
position, current position, setpoint velocity and setpoint acceleration). It displays the
maximum acquisition per type of data that can be collected (max total data
acquisition/number of data types = 1000000/4 = 250000). It defines an action
(GatheringRun) to an event (Immediate). When the jog mode is enabled, it changes the
jog speed and acceleration. At the end, the jog mode is disabled, the gathering is
stopped and saved in a text file (
Gathering.dat
in Admin/Public directory of the
controller). Finally, the program ends by closing the socket.
Please see the sections:
4 Principle of a Tcl script redirection to a telnet session
.
6 Proposed function for error handling.
7.9.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
120
set
Moteur "XY"
set
Mot "XY.X"
set
A "XY.X.SetpointPosition"
set
B "XY.X.CurrentPosition"
EDH0307En1041 — 10/17
44