Protocol

The Antcas TCP protocol is fully open documented. Communication takes place via TCP.

Communication

Communication takes place via TCP with an open connection from Antcas Control. The server can only be connected to one client per interface at a time. The port can be freely chosen. The default is port 5'252. The maximum packet size is limited to 3'000 bytes. Multiple packets can be transmitted consecutively. The interface has a timeout. If no response is given after a certain time, the process starts over.

Note: Characters such as umlauts and special characters are defined in ISO-8859-1 format.

All variables used are case sensitive, meaning that uppercase and lowercase letters are distinguished. Here is an example of how a simple transmission can be structured:

ANTCAS_TCP
OK:3000
TL:x:1:Licht/1. OG/EIN
TL:ui:1:Licht/1. OG/DIM
START
x:1:TRUE
OK
KA
RE

Handshake

As soon as a connection is established, Antcas Control sends a handshake to the client. This can optionally include the maximum buffer size in bytes so that Antcas Control limits each telegram when sending until an acknowledgment is returned. The size of MAX_BUFFER_SIZE should not be chosen too small to keep the interface speed high.

Antcas Control -> Client:

ANTCAS_TCP\n

Antcas Control <- Client:

OK[:MAX_BUFFER_SIZE=3000]\n

Initialization

The initialization takes place after the handshake. All values of the data points are sent from the client to Antcas Control. See Transfer Value. Once the transmission is complete, a start command is triggered. Then Antcas Control sends its values. These are filtered after initialization. Therefore, no data point that does not exist will be transmitted.

Antcas Control <- Client:

START\n

Translation Table

A translation table can also be transferred. This increases performance with many data points. The translation must take place directly after the handshake. Variables can also be defined twice. For example, temperature of type INT and REAL. The data points are treated completely separately.

Antcas Control <- Client:

TL:x:1:Licht/1. OG/EIN\n

Here Licht/1. OG/EIN is translated to x:1 for communication. The server sends only x:1 instead of the name.

Watchdog / Keep Alive

To keep the connection open, a cyclic watchdog is used. This monitors both the client and the server. The timeout occurs after approximately 6 seconds without a response. The client may disconnect the connection after 10 seconds without a response from the server. This is only used when no data is being transmitted.

Antcas Control -> Client:

KA\n

Antcas Control <- Client:

RE\n

Transfer Value

All data is transmitted as a string. The data type is defined as a prefix of the value. A data point may only occur once, even if it has multiple data types. The data point can also contain a path. For example:

x:Licht/1. OG/EIN:TRUE\n

or with translation table:

x:1:TRUE\n

After the string has been transmitted, an acknowledgment must occur; only then will the next value be transmitted:

OK\n

Bool

Antcas Control <-> Client:

x:Datenpunkt:FALSE/TRUE\n

Uint

Antcas Control <-> Client:

ui:Datenpunkt:[0..65536]\n

Note: Other values must be transmitted as a string.

Int

Antcas Control <-> Client:

i:Datenpunkt:[-32768..32767]\n

Real/Float

Antcas Control <-> Client:

r:Datenpunkt:[3.402823E-38..1.175 495E+38]\n

Date

Antcas Control <-> Client:

d:Datenpunkt:D#YYYY-MM-DD\n

Time

Antcas Control <-> Client:

t:Datenpunkt:T#5d4h3m2s1ms\n

DateTime

Antcas Control <-> Client:

dt:Datenpunkt:DT#YYYY-MM-DD[-HH:II:SS]\n

String

Antcas Control <-> Client:

s:Datenpunkt:String[max. 64 characters]\n

Warning: Sending a line feed (\n) is not allowed.

Timeswitch

This data type always communicates only before the data exchange and sends all upcoming events of a timer switch. An implementation at PLC level in Antcas Control is not possible. However, a calendar can be manipulated in the PLC.

Request Number Of Events

Before the start command, the number of desired events is requested. The value range is between 0..255. In addition, the current time in UTC is returned. This currently serves only for error analysis. However, the value is required.

Antcas Control <- Client (before START):

ts:Datenpunkt:s;MAX_USINT;ACTUAL_TIME\n

Transmission Of Switching States

The first time defines the moment for switching on and the second one for switching off. Overlaps can also occur. To not overburden memory too much, a circular buffer is used. This means that a value is replaced and not all values are shifted. Therefore, all values must be considered. After receipt, an acknowledgment is sent back to the server. The value can also be identical to the one above to simplify the program.

Antcas Control -> Client:

ts:Datenpunkt:USINT;DT#YYYY-MM-DD-HH:II:SS;DT#YYYY-MM-DD-HH:II:SS\n

No Switching Time

To prevent an event from being triggered during interrupted communication, all inactive entries are deactivated. This is the case when the on and off switching states are identical. The minimum switching time is therefore one second.

Antcas Control -> Client:

ts:Datenpunkt:USINT;DT#1970-01-01-00:00:00;DT#1970-01-01-00:00:00\n