AMiT Websocket communication protocol
Supported device types and versions
Communication line configuration
Communication station configuration
I/O tag configuration
Literature
Changes and modifications
Document revisions
Supported device types and versions
The protocol supports communication with AMiT devices via Websockets. The communication does not require the installation of any additional drivers. The communication was tested and debugged on the ADiS4 (Gen2 E+) device with the AD4-CPS central unit.
Communication line configuration
- Communication line category:TCP/IP-TCP.
- Host: URL address of the PLC (e.g., ws://192.168.1.1 or wss://192.168.1.1 for secure web sockets)
Note: In the used version (DetStudio 3.4 build 43), wss (TLS) communication did not work, as AMiT PLC used too weak encryption keys, which no longer matched the SSL library used in D2000. This problem could be solved by configuring TLS via a utility, e.g., stunnel. - Port: port number. If the default port is used (80 for ws://, 443 for wss://), it is also possible to enter a value of 0.
Communication line parameters
Communication line - configuration dialog box - the Protocol parameter tab.
Parameters defined in the field have an effect on some optional protocol parameters. The following line protocol parameters can be defined:
Table 1
| Full name | Description | Units / size | Default value |
|---|---|---|---|
User Name | Username used for communication. If not specified, the username/password will not be used for communication. | - | - |
Password | Password used for communication. | - | - |
Protocol | The protocol used for communication. The following variants are available:
AMiT devices have a limit of 16 KB for the size of received and sent Websocket messages, so both requests and responses must fit within this size. Therefore, the MessagePack variant is recommended, as it is also less CPU-intensive. | MessagePack JSON | MessagePack |
Wait Timeout | Response waiting time. In case of larger requests, or due to higher latencies (e.g., on a mobile network or when communicating over WAN/VPN), this value may need to be increased. | ss:mss | 01:000 |
Communication station configuration
- Communication protocol: AMiT Websocket.
- The station address is the device address in not specified.
Communication station parameters
Communication station - configuration dialog box - tab Protocol parameter.
Parameters defined in the field influence some optional protocol parameters. The following station protocol parameters can be defined:
Table 2
| Full name | Meaning | Unit/ size | Default value |
|---|---|---|---|
Batch Size | Batch size when reading, i.e. the number of I/O tags that are read at once. AMiT devices have a limit of 16 KB for the size of received and sent Websocket messages, so both requests and responses must fit within this size. In the case of larger objects (fields, text variables), it may be necessary to reduce the default value, or create multiple stations on the line - one for arrays (small Batch Size value), the other for simple variables (larger Batch Size). | 1-1000 | 256 |
I/O tag configuration
Possible I/O tag types: Ai, Ao, Ci, Co, Di, Do, TxtI, TxtO, TiA, ToA, TiR, ToR.
I/O tag address consists of:
- Name - text name of the variable
- Bit - for integer variable types, a specific bit can be specified. It can be in the range 0 to 15 for WORD/INT types or 0 to 31 for DWORD/DINT types.
Note: It is currently not possible to write to an I/O tag with a specified bit. - Row, Col - Position of the value in two-dimensional arrays, the first row or column has the value 0.
- Row count, Col count - For two-dimensional arrays, the number of rows and columns read (the default value of the number of rows and the number of columns is 1). If the configured row count/column count is above 1, the values of the whole matrix or part of the matrix are read into the target column of a structure. A part of matrix [Row, Column .. Row+ Row count -1, Column+ Column count - 1] will be read.
Example: Row =1, Col =2, Row count=20, Col Count =30. Rows 1 to 20, columns 2 to 31 are read, i.e. part of the matrix [1,2 .. 20,31].
Note: if neither of Row, Count, Row count, Col count is specified, the entire array is read. - Bit - bit number for value types Di, Dout. It can be in the range 0 to 15 for WORD/INT types or 0 to 31 for DWORD/DINT types.
- Passive - the I/O tag is not read. Such an I/O tag can be intended for writing only, or it can be configured as an element of an array that is read by another I/O tag (which is not passive).
Note: An I/O tag of type TiA/ToA is understood as the number of seconds since 1.1.1970 (Unix time), since AMiT does not have objects of type absolute time.
Literature
- AMiT MessagePack, JSON (Websocket) - messagepack_ws-json_dec_cz_102.pdf
Changes and modifications
- June 6th, 2026 – document created
Document revisions
- Ver. 1.0 - June 6th, 2026 - Implementation of reading and writing simple objects and arrays
Related pages: