Protocol Description

A text-based transfer protocol for TCP/IP has been defined for the communication between the Crestron controller and the TwinCAT 3 controller. The TwinCAT 3 controller is the TCP server and the Crestron controller is the TCP client. The TCP port 48798 is used. The Crestron controller cyclically sends a keep-alive packet to establish the connection to the TCP server. Some commands can be initiated both by the Crestron controller and by the TwinCAT 3 controller. A request data packet is sent by one controller. The other controller always responds with a response data packet.

Each data packet begins with the start character STX (0x02) and ends with ETX (0x03) and the string termination (0x00). The first field of a data packet defines the type of the data packet (request, response, etc.). The further structure then depends on the respective type of the data packet. All numerical values are transmitted in ASCII format, the most significant byte (MSB) being transmitted first. Numerical values are transmitted as hexadecimal numbers. The Invoke-Id is a 32-bit random number that is returned with the response. This ensures that the response received actually belongs to the request sent beforehand. The following file contains a precise description of the respective data packets.

The following graphic, for example, shows the data packets for reading several signals from a Crestron controller. The TwinCAT 3 controller sends the request in which the desired elements are specified (start offset and number of elements). The Crestron controller responds with a data packet containing the individual values.

Protocol Description 1:

 

The following illustrations show the recording of the command ReadBoolArray (FB_CrestronReadBoolArray) from a TwinCAT 3 controller to a Crestron controller. 5 signals are read from start offset 7.

Request

Protocol Description 2:

Response

Protocol Description 3: