Newport XPS-Q8 Users Manual, Software Tools And Tutorial page 214

Universal high-performance motion controller/driver
Hide thumbs Also See for XPS-Q8:
Table of Contents

Advertisement

XPS-Q8 Controller
XPSDocumentation V1.4.x (EDH0301En1060 — 10/17)
this case, the XPS will unblock the last socket after the TCPTimeOut time. However,
this method loses the ability to pinpoint which commands were not properly executed.
Examples of the use of parallel sockets
The following examples illustrate how to open several sockets via the web site
interface, TCL scripts, LabVIEW VIs and C++ programs.
Web site interface
The simplest way to open several sockets in parallel is to open several browser windows
using the IP address of the controller. This is completely transparent to the user. Two or
more groups of stages can be commanded from two terminal menus at the same time to
execute different motions (multitasking).
TCL scripts
A TCL script is carried out sequentially: the commands are executed one by one
following the order they are written in the script. Consequently, there is no benefit to
open several sockets in a single TCL script.
However, it is possible to start a TCL script from another TCL script. That way, as
many sockets and parallel processes can be started as needed. Below is an example with
3 open sockets:
#####################
# TCL program : GEN #
#####################
set TimeOut 10
set code 0
set Prog1 "ProgRV.tcl"
set Task1 "Task1"
set Prog2 "ProgXY.tcl"
set Task2 "Task2"
# open TCP socket
set code [catch "OpenConnection $TimeOut socketID"]
if {$code == 0} {
puts stdout "ProgGen : TCP_ConnectToServer OK => $code ID =
$socketID"
set code [catch "TCLScriptExecute $socketID $Prog1 $Task1 0"]
puts stdout "ProgGen : TCLScriptExecute => error = $code"
set code [catch "TCLScriptExecute $socketID $Prog2 $Task2 0"]
puts stdout "ProgGen : TCLScriptExecute => error = $code"
# close TCP socket
set code [catch "TCP_CloseSocket $socketID"]
puts stdout "ProgGen : TCP_CloseSocket => $code ID = $socketID"
} else {
puts stdout "ProgGen : TCP_ConnectToServer NOT OK => $code"
}
202
<– Socket 1
<– Socket 2
<– Socket 3
Motion Tutorial

Advertisement

Table of Contents
loading

Table of Contents