Position Compare; Configuration; Description; Tcl Code - Newport XPS-Q8 Manual

Universal high-performance motion controller/driver
Table of Contents

Advertisement

XPS-Q8
7.6

Position Compare

7.6.1

Configuration

Group type
Single axis
7.6.2

Description

This example opens a TCP connection, kills the single axis group, then initializes and
homes the group. With an absolute move, the positioner moves to the start position –15.
Then, the program configures the parameters for the position compare (enabled from -
10 to +10 with step position of 1 unit). It enables the position compare functionality and
executes a relative move of 25 (final position will be –15+25 = +10). During this move,
between the positions –10 and +10, pulses are sent by the trigger output for each 1 unit
incremental position. The position compare mode 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.6.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 "SINGLE_AXIS"
set
Positioner "SINGLE_AXIS.MY_STAGE"
set
StartPosition
set
Displacement
set
-10
MinPos
set
10
MaxPos
set
1
StepPos
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} {
Number
Group name
1
SINGLE_AXIS
-15
25
"OpenConnection $TimeOut socketID"]
[catch
"GroupKill $socketID $Group"]
37
Tcl Manual
Positioner name
SINGLE_AXIS.MY_STAGE
EDH0307En1041 — 10/17

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents