# Ethernet TCP/IP Communication

{% columns %}
{% column %}

{% endcolumn %}

{% column %}
The XENAX® servo controller features an integrated TCP/IP stack for communication over a local network. The Ethernet interface supports both operation via the WebMotion® web interface (port 80) and direct control using ASCII commands through a TCP socket connection (port 10001).

Both services can be used simultaneously. The physical Ethernet connector and the LED status indicators are described in the chapter [ETHERNET TCP/IP](broken://pages/0JmTYHSywVylJlNSFenH#ethernet-tcp-ip).
{% endcolumn %}
{% endcolumns %}

***

{% columns %}
{% column %}

{% endcolumn %}

{% column %}

### Connection to WebMotion®

{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

<figure><img src="/files/lYvt4xHEci9r6DfTSxn2" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}
For initial commissioning, configuration, diagnostics, and operation, the XENAX® provides an integrated HTTP web server.

Use your standard web browser and ensure that your network interface is located in the same network as the XENAX®. If necessary, adjust the IPv4 settings accordingly. The IP settings for accessing WebMotion® can later be modified in WebMotion® under [connectivity](broken://pages/Lc9gRsdHubDtGN3B7w1z).
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

<figure><img src="/files/lSF09TZld6cuoxTnJEJN" alt="" width="346"><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

#### IP-Adress

The factory-default IP address is printed on the back of the controller.

If it is not accessible or has been changed, it can be displayed via the 7-segment display as follows:

{% stepper %}
{% step %}

#### Switch on the logic supply

{% endstep %}

{% step %}

#### As soon as the dot on the display lights up, switch off the logic power supply again

{% endstep %}

{% step %}

#### When switching on again, the IP address is displayed

{% endstep %}
{% endstepper %}
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

{% endcolumn %}

{% column %}

#### **Default IP-Configuration**

IP-Adresse: 192.168.2.100

Subnet-Mask: 255.255.240.0

For deliveries containing multiple servo controllers, the IP addresses are assigned sequentially\
(e.g. 192.168.2.100, 192.168.2.101, 192.168.2.102 …).
{% endcolumn %}
{% endcolumns %}

***

{% columns %}
{% column %}

{% endcolumn %}

{% column %}

### **ASCII Commands via TCP-Socket**

{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column width="50%" %}

<p align="center"></p>
{% endcolumn %}

{% column width="50%" %}
Via the TCP socket connection, the servo controller can be fully controlled using the available ASCII commands. This allows complete sequence control to be implemented in Python, LabVIEW, or other programming languages.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

{% endcolumn %}

{% column %}

#### ASCII Communication protocol

{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

<p align="center"><strong>Example write</strong></p>

<figure><img src="/files/OjkeMlMjfJsM6WgLLySw" alt=""><figcaption></figcaption></figure>

<p align="center"></p>

<p align="center"><strong>Example read</strong></p>

<figure><img src="/files/0QoRbSusdQlhZAYwIS43" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

#### ECHO

The ASCII protocol operates using the echo method: each character sent by the host is immediately echoed back by the controller and can therefore be verified. If echoing is not required, it can be disabled using the ASCII command `ECH0`.

After the command, if applicable, the corresponding parameter value follows, along with the terminating prompt character `>`.

Commands and values must be transmitted without spaces between them.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

<figure><img src="/files/uweDsTgr0AT4ydDPL6df" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

#### **Prompt character `>`**

The prompt character `>` of the XENAX® marks the end of a response. Wait for this character before sending a new command.

If requests are sent to the XENAX® in a cyclic loop - such as the commands `TP` and `TMC` in the example - it must be taken into account that, with TCP/IP, continuous ASCII sequences may be split into multiple telegram packets. For this reason, a separate receive buffer must be provided (in this example: `TM`). The resulting response is therefore `TMC230`.
{% endcolumn %}
{% endcolumns %}

***

{% columns %}
{% column %}

{% endcolumn %}

{% column %}

### Asynchrone Mitteilung (Events)

To reduce reaction times, status changes or changes at the PLC inputs can be sent automatically by the servo controller. These asynchronous notifications `Events` are transmitted independently of host requests, so continuous polling is not required.
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

<figure><img src="/files/YLinctTz30QG29Ngpjvp" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

#### **Status-Events `EVT1`**

After a restart of the servo controller or after an application download, the event function is disabled `EVT0`.

When events are enabled `EVT1`, the controller sends the following messages:

| Event from XENAX® | Status                 |
| ----------------: | ---------------------- |
|             `@S0` | Power OFF              |
|             `@S1` | Power ON / In Position |
|             `@S2` | In Motion              |
|             `@S9` | Error                  |
|              `@H` | Reference Set          |
|   {% endcolumn %} |                        |
|  {% endcolumns %} |                        |

{% columns %}
{% column width="50%" %}

{% endcolumn %}

{% column width="50%" %}

#### **PLC Input-Events `ETI`**

In addition to the status events, changes at the hardware inputs of the XENAX® can also trigger events. The prerequisite is that the event function is enabled `EVT1` and that the desired inputs have been enabled via `ETI` (`Enable Event Track Input`).
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column width="50%" %}

<p align="right"><strong>Enabling PLC Input-Events</strong> </p>

<p align="right"></p>
{% endcolumn %}

{% column width="16.666666666666664%" %}

ASCII

Bit structure

Default
{% endcolumn %}

{% column width="33.33333333333332%" %}

`ETI` (Enable Event Track Input)

Hex (`ETI4` = Input 4 / `ETIB` = Input 11)

All inputs disabled
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

<figure><img src="/files/9rMhoLEZPUrW7kZeV2jo" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

<table><thead><tr><th width="180" align="right">Activation</th><th>Status</th></tr></thead><tbody><tr><td align="right"><code>ETI0</code></td><td>Enable for all inputs 1-12</td></tr><tr><td align="right"><code>ETI1</code>...<code>ETIC</code></td><td>Selective activation of an input</td></tr></tbody></table>
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column width="50%" %}

<p align="right"><strong>Disabling PLC Input-Events</strong></p>

<p align="right"></p>
{% endcolumn %}

{% column width="16.666666666666664%" %}

ASCII

Bit structure

Default
{% endcolumn %}

{% column width="33.33333333333332%" %}

`DTI` (Disable Event Track Input)

Hex (DTI7 = Input 7 / ETIC = Input 12)

All inputs disabled
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

{% endcolumn %}

{% column %}

<table><thead><tr><th width="180" align="right">Deactivation</th><th>Status</th></tr></thead><tbody><tr><td align="right"><code>DTI0</code></td><td>Disable for all inputs 1-12</td></tr><tr><td align="right"><code>DTI1</code>...<code>DTIC</code></td><td>Selective deactivation of an input</td></tr></tbody></table>
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

{% endcolumn %}

{% column %}
When PLC Input Events are enabled, the XENAX® sends a message in the format `@Ixyz` whenever an input changes. The characters x, y, and z each represent a half-byte (nibble) in hexadecimal notation and indicate the current physical state of the inputs.

|                  | x    | y   | z   |
| ---------------- | ---- | --- | --- |
| INPUT No.        | 12-9 | 8-5 | 4-1 |
| {% endcolumn %}  |      |     |     |
| {% endcolumns %} |      |     |     |

{% columns %}
{% column %}

{% endcolumn %}

{% column %}

#### Error Codes – ASCII Protocol

If a question mark `?` or a `#xx` is returned as an echo, the command is invalid, not recognized, or cannot be executed in the current configuration. Below is a list of the error codes and their meanings:
{% endcolumn %}
{% endcolumns %}

<table><thead><tr><th width="176.3333740234375" align="right">ECHO</th><th>Description</th></tr></thead><tbody><tr><td align="right">?</td><td>Invalid command or whitespace character</td></tr><tr><td align="right">#01</td><td>Error pending</td></tr><tr><td align="right">#03</td><td>Motion active</td></tr><tr><td align="right">#05</td><td>Program active</td></tr><tr><td align="right">#13</td><td>Emergency Exit EE1 pending</td></tr><tr><td align="right">#14</td><td>Emergency Exit EE pending</td></tr><tr><td align="right">#15</td><td>I_Force calibration active</td></tr><tr><td align="right">#27</td><td>I_Force drift compensation active</td></tr><tr><td align="right">#34</td><td>Rotative reference active</td></tr><tr><td align="right">#36</td><td>Gantry reference active</td></tr><tr><td align="right">#38</td><td>Reference active</td></tr><tr><td align="right">#40</td><td>Command to active bus module not permitted</td></tr><tr><td align="right">#47</td><td>Error response active (e.g. braking ramp)</td></tr><tr><td align="right">#49</td><td>No JSC motor connected</td></tr><tr><td align="right">#65</td><td>Parameter value out of range</td></tr><tr><td align="right">#66</td><td>Command not completed correctly (>5 s between two ASCII characters)</td></tr></tbody></table>

***

{% columns %}
{% column %}

{% endcolumn %}

{% column %}

### Close Socket Connection

{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}

{% endcolumn %}

{% column %}
If the TCP/IP connection on port 10001 is not properly closed, the port may remain in an open state.\
In this case, it is no longer possible to establish a new TCP/IP connection to this port.

There are three ways to subsequently close the port correctly:

* Disconnect and reconnect the Ethernet cable directly at the XENAX® servo controller.\
  Port 10001 will then be released automatically.
* Open a second socket connection on port 9999 and send the command `ENPR` via this socket connection. Port 10001 will then be released again. Note: Port 9999 can be used only for the command `ENPR`.
* Set a timeout using the command `WDxxxx`.\
  After setting a timeout via `WDxxxx`, the connection on port 10001 must send at least one `CR` within the configured interval. If no transmission occurs within this time window, the connection is automatically terminated.
  {% endcolumn %}
  {% endcolumns %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tech.jennyscience.com/control_system/xenax/xenax-xvi-75v8s/ethernet-tcp-ip.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
