BECKHOFF KL6031, KL6041: Access from the User Program

Operation with TwinCAT PLC Software

KL6031 + KL6041 in 22-Byte Mode

The standard versions, as supplied, of the Beckhoff serial bus terminals  KL6031 and KL6041 are operated in 22-byte mode. 3 PLC cycles are needed for the exchange of a data block with the serial PC interface. The maximum effective data transfer rate in bits per second depends on the cycle time, T, of the PLC (10 ms), and on the number of useful bits needed to transfer one data byte  (LB):

Bps = (LB x PA / 3) / T

LB = 1 start bit + n data bits + p parity bits + m stop bits
PA = number of data bits (process data length)
T = cycle time of the PLC

The maximum effective data transmission rate is limited by the physical baud rate programmed into the terminal.

Bps = (10 bits x 22/3) / 0,010 s 7333 Bps

Note_A4
Note
TwinCAT Version
Pay attention to the K-Bus update time if bus terminals KL6031, KL6041 and bus couplers BKxxxx are used. For further information regarding the configuration and operation of the TwinCAT Software go to the Beckhoff Info-Sys at  http://infosys.beckhoff.com.

KL6031 + KL6041 in 5-Byte Mode

The serial bus terminal can be re-configured offline so that, in 5-byte mode, 5 data bytes at a time can be transferred to or from the terminal. 3 PLC cycles are still necessary for each exchange. The effective data rate for a given cycle time is thus 5/3 greater than in 3-byte mode. The bus terminals cannot be re-configured while the PLC is running, since the 3-byte and 5-byte modes differ in the register mapping and in the TwinCAT System Manager configuration.

Bps = (10 bits x 5/3) / 0,010 s 1666 Bps

Note_A4
Note
TwinCAT Version
Pay attention to the K-Bus update time if bus terminals KL6031, KL6041 and bus couplers BKxxxx are used. For further information regarding the configuration and operation of the TwinCAT Software go to the Beckhoff Info-Sys at  http://infosys.beckhoff.com.

KL6031 + KL6041 in 3-Byte Mode

In 3-byte mode, a bus telegram can transmit or receive 3 data bytes to or from the terminal. Since every data exchange between the PLC and the bus terminal requires 3 PLC cycles, the effective transfer rate is one byte per cycle.

Bps = (10 bits x 3/3) / 0,010 s 1000 Bps

Note_A4
Note
TwinCAT Version
Pay attention to the K-Bus update time if bus terminals KL6031, KL6041 and bus couplers BKxxxx are used. For further information regarding the configuration and operation of the TwinCAT Software go to the Beckhoff Info-Sys at  http://infosys.beckhoff.com.

Serial PC Interface

The serial PC interface (COM1, COM2 etc.) is handled by the TwinCAT system similarly to the serial bus terminal, but use larger data transfer buffers than the serial bus terminal. COMlib uses a 64 byte buffer, so up to 64 data bytes are transferred at once between the PLC and the interface driver. 3 PLC cycles are again needed for the exchange of a data block with the serial PC interface.

Bps = (LB x 64/3) / T