Analog Position Tracking; Configuration; Description; Tcl Code - Newport XPS-Q8 Manual

Universal high-performance motion controller/driver
Table of Contents

Advertisement

XPS-Q8
7.10

Analog Position Tracking

7.10.1

Configuration

Group type
XY
7.10.2

Description

This example opens a TCP connection, kills the XY group, then initializes and homes
the group. It sets the parameters for the position analog tracking functionality
(positioner, analog input, offset, scale, velocity and acceleration) and enables the analog
tracking mode. The mode gets activated for 20 seconds. During this time, the stage
position follows the voltage of the analog input GPIO2.ADC1. Then, the analog
tracking mode gets 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.10.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
AnalogInput "GPIO2.ADC1"
set
0
Offset
set
1
Scale
set
Velocity
set
Acceleration
set
TrackingType "Position"
set
0
code
# Open TCP socket
set
code
[catch
if
{$code != 0} {
puts
stdout "OpenConnection failed => $code"
else
}
{
# Kill group
set
code
if
{$code != 0} {
DisplayErrorAndClose $socketID $code "GroupKill" $telnetOut
return
}
Number
Group name
1
XY
20
80
"OpenConnection $TimeOut socketID"]
[catch
"GroupKill $socketID $Group"]
49
Tcl Manual
Positioner name
XY.X and XY.Y
EDH0307En1041 — 10/17

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents