Addressing; Sockets, Multitasking And Multi-User Applications; Programming With Tcl - Newport XPS-Q8 Users Manual, Software Tools And Tutorial

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)
2.7.2

Addressing

There are two levels of addresses that define Ethernet devices. The first is the MAC
address. This is a unique and permanent 6 byte number. No other device will have the
same MAC address. The second level of addressing is the IP address. This is a 32-bit
(or 4 byte) number. The IP address is constrained by each local network and must be
assigned locally. Assigning an IP address to the controller can be done in a number of
ways (see section 3.5: "Connecting to the XPS").
2.8

Sockets, Multitasking and Multi-user Applications

Based on the TCP/IP Internet communication protocol, the XPS controller has a high
number of virtual communication ports, known as sockets. To establish communication,
the user must first request a socket ID from the XPS controller server (listening at a
defined IP number and port number). When sending a function to a socket, the
controller will always reply with a completion or error message to the socket that has
requested the action.
The concept and application of sockets has many advantages. First, users can split their
application into different segments that run independently on different threads or even
on different computers. To illustrate this, see below:
In this example, a thread on socket 1 commands an XY stage to move to certain
positions to take pictures while another thread on socket 2 independent of socket 1,
concurrently manages an auto-focusing system. The second task could even be run on a
different PC than the first task yet be simultaneously executed within the XPS.
Alternatively, if the auto-focusing system is providing an analog feedback, this task
could have been also implemented as a TCL script within the XPS (see the next topic).
Second, the concept of sockets has another practical advantage for many laboratory
users since the use of threads allows them to share the same controller for different
applications at the same time. With the XPS, it is possible that one group uses one axis
of the XPS controller for an optical delay line, while another group simultaneously uses
other axes for a totally different application. Both applications could run completely
independent from different workstations without any delays or cross-talk.
The XPS controller uses TCP/IP blocking sockets, which means that the commands to
the same socket are "blocked" until the XPS returns feedback about the completion of
the currently executed command (either '0' if the command has been completed
successfully, or an error code in case of an error). If customers want to run several
processes in parallel, users should open as many 84 parallel sockets. Please refer to
section 18.4: "Running Processes in Parallel" for further information about sockets and
parallel processing.
2.9

Programming with TCL

TCL documentation is in a PDF file accessible from the XPS controller web site.
TCL stands for Tool Command Language and is an open-source string based command
language. With only a few fundamental constructs and relatively little syntax, it is very
easy to learn, yet it can be as powerful and functional as traditional C language. TCL
includes many different math expressions, control structures (if, for, foreach, switch,
etc.), events, lists, arrays, time and date manipulation, subroutines, string manipulation,
file management and much more. TCL is used worldwide with a user base approaching
12
User's Manual

Advertisement

Table of Contents
loading

Table of Contents