Overview
The TwinCAT 3 function enables serial data communication for the TwinCAT 3 PLC.

The following three options are available for the communication:
Option 1: PC COM ports
You can address your physical COM port directly from the PLC.
Option 2: Beckhoff Terminals
The network-based fieldbus system from Beckhoff can be used to access serial terminals at a distance of up to 100 m.
The following Beckhoff terminals are supported:
- KL6xxx Bus Terminals
- EL60xx EtherCAT Terminals
Option 3: Virtual COM ports
The function provides an ADS server for accessing virtual COM ports of the operating system from the PLC.
This enables the use of USB devices that come with a proprietary USB-To-VirtualCom driver.
The COM port must register in Windows as 'COM1' ... 'COM255'.
In the TwinCAT/BSD operating system, the COM port must be registered as `ttyu0`...`ttyu255`.
In the Beckhoff RT Linux® operating system, the COM port must register as `ttyUSB0`...`ttyUSB255` or `ttyACM0`...`ttyACM255`.
![]() | Installation required To use virtual COM ports, it is necessary to install the TwinCAT 3 Function Setup or the corresponding XAR package on the system where the virtual COM port exists. |
Components of the TwinCAT 3 Function:
- PLC library Tc2_SerialCom: The PLC library provides function blocks and data structures for communicating with serial devices. Various function blocks for sending, receiving and configuration are available.
All function blocks can be instantiated multiple times, so that any number of serial interfaces can be operated in parallel, depending on the performance of the PC.
In addition to the basic functions of sending and receiving transparent data, the 3964R protocol is supported. A fail-safe protocol for transmitting any data is implemented. A checksum in combination with repetition of data telegrams in the event of an error are used for error protection.
The RK512 protocol is used for transmitting data blocks, like those used in Siemens controllers. The user only has to parameterize the RK512 function block. It uses the 3964R protocol and handles the necessary telegram traffic. It supports the transmission of data blocks with a length of up to 128 data words. - TwinCAT TcAdsSerialCommServer: Is a service that is started and stopped together with TwinCAT. It is used to communicate with virtual COM ports of the operating system. Otherwise, this component can be omitted during installation.
