13
VIO 4K TPP PROGRAMMER'S GUIDE FOR v02.00.7X
3.1
Establishing a connection with a VIO 4K™
3.1.1
Usage
This example gives you the proper way to establish the connection with a VIO 4K™ device. It is made of
four recommended steps: socket opening, device type checking, command set version checking and VIO4K™
registers read back.
3.1.2
Summary of the commands sequence
socket opening
initial step, TCP/IP connection.
device type checking
verifying that the expected device (VIO 4K™) is connected.
command set version checking
verifying that controller driver and VIO 4K™ TPP version matches.
VIO 4K™ registers read back
retrieving the current VIO 4K™ state.
3.1.3
Detailed commands sequence
o
socket opening: As indicated in
chapter, TCP/IP must be used to control
VIO 4K™. The device acts as a server, and accepts connections as soon as it is ready. Once the
connection established, the device sends the COMM_TPP_NB_OF_CLIENTS status, giving the
number of connected controllers.
Answer:
TPcon
<value>
C
R
L
F
The numerical <value> gives the connected controllers number.
o
device type checking:
This read only command gives the device type.
Syntax:
?
L
F
Answer:
DEV
<value>
C
R
L
F
The numerical <value> gives the connected device type. Other
values match other Analog Way devices.
o
command set version checking: This read only command gives the “command set version”
number. When a new firmware version is released, if TPP is modified, then the “command set
version” is increased.
Syntax:
TPver
L
F
Answer:
TPver
1
C
R
L
F
The current value is 1 for this firmware version.
o
VIO 4K™ registers read back: This step is recommended to initialize the controller. Various
methods exist depending on controller software architecture.
To ease this initialization step, the device features the DIESE command to enumerate (read back)
all its registers current values. This produces a huge amount of data that can saturate the
controller. A command parameter allows reducing this volume by sending only register values
different from their default value. If the volume is still too high, the controller should enumerate
himself all the required registers, at its own pace.
o
Read back using DIESE command:
At first, the controller should wait for a possible current DIESE command to finish.
sending: #
L
F
Controller ask the current state of the DIESE register.
Answer: #<value>
C
R
L
F
The controller must wait that the numerical <value> be equals
<value>
device
1024
VIO 4K™