EasyManua.ls Logo

Newport XPS-Q8 - Page 214

Newport XPS-Q8
232 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
XPS-Q8 Controller Motion Tutorial
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” <– Socket 1
set code [catch “TCLScriptExecute $socketID $Prog1 $Task1 0”]
puts stdout “ProgGen : TCLScriptExecute => error = $code”
<– Socket 2
set code [catch “TCLScriptExecute $socketID $Prog2 $Task2 0”]
puts stdout “ProgGen : TCLScriptExecute => error = $code”
<– Socket 3
# 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”
}
XPSDocumentation V1.4.x (EDH0301En1060 10/17) 202

Table of Contents

Other manuals for Newport XPS-Q8

Related product manuals