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 makes it possible to use 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 register as `ttyu0`...`ttyu255`.
Installation required To use virtual COM ports, it is necessary to install the TC3 Function Setups on the system in which 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 support multiple instances, so that, depending on the processing capacity of the PC, any number of serial interfaces can be operated in parallel.
In addition to the basic send and receive functions for transparent data, the 3964R protocol is supported. A fail-safe protocol for transmitting any data is implemented. A checksum in combination with repetition of faulty telegrams provide the error protection.
The RK512 protocol is used to transmit data blocks such as are 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: The service 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.