Jogging; Configuration; Description; Tcl Code - Newport XPS-Q8 Manual

Universal high-performance motion controller/driver
Table of Contents

Advertisement

XPS-Q8
EDH0307En1041 — 10/17
7.8

Jogging

7.8.1

Configuration

Group type
XY
7.8.2

Description

This example opens a TCP connection, kills the XY group, then initializes and homes
the group. It enables the jog mode and sets the parameters to move a positioner in the
positive direction with a velocity of 10 units/s for 1.5 seconds. Then, during the 2 next
seconds, the positioner moves in the reverse direction with a velocity of -20 units/s, and
finally stops (velocity set to 0). The jog functionality is then disabled and 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.8.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
60
TimeOut
set
Group "XY"
set
Positioner "XY.X"
set
Velocity1
set
Velocity2
set
Acceleration
set
0
code
# Open TCP socket
set
code
[catch
if
{$code != 0} {
puts
$telnetOut "OpenConnection failed => $code"
# Force transfer to channel's output buffer
flush
$telnetOut
else
}
{
# Kill group
set
code
if
{$code != 0} {
DisplayErrorAndClose $socketID $code "GroupKill" $telnetOut
return
}
# Initialize group
Number
Group name
1
XY
10
-20
80
"OpenConnection $TimeOut socketID"]
[catch
"GroupKill $socketID $Group"]
42
Tcl Manual
Positioner name
XY.X and XY.Y

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents