TwinCAT as master PLC

A higher-level controller (PC or CX with TwinCAT) can operate as a master PLC (control system) for the Bus Terminal Controller (BC9x20, BC9050, BC9191 or BX9000). It queries the PLC variables depending on the set task time of the Bus Terminal Controller. This enables the higher-level controller to receive data from the Bus Terminal Controller or to send data to it. The following communication options are supported:

TwinCAT as master PLC 1:
Communication settings

GetHostByName: This function enables the IP address to be found based on the name (this only works if the IP address of the Bus Terminal Controller was assigned via DHCP)

PLC Variables: Data for the cyclic data connection. This must be linked into at least one task. 256 words of input or output is the maximum. Should more data be required for the transfer, these can be read or written acyclically via the flag area of the Bus Terminal Controller.

Diagnostic Data:

Coupler State: Should always be zero. "1" is set if, for example, the K-bus reports an error
BoxState: see Comment in the dialog
MissedCnt: Should not count up if possible. Because TwinCAT operates in real time, but neither TCP nor UDP are real-time protocols, is not impossible that the counter will increase under certain circumstances. The counter is incremented every time that data that is been transmitted at the beginning of the task has not yet returned by the time the task starts again.

The task time should be set in the following way

For ADS TCP, cyclic

Measure the required PLC time of the Bus Terminal Controller, add 20 to 30% and set the task time of the Bus Terminal Controller accordingly. Now take three times this task time; the result corresponds to the task time on your master controller.

Example:
Measured PLC time: 5 ms
Set a task time of 7 ms for the Bus Terminal Controller and
set a task time of 3 x 7 ms = 21 ms for the Master PLC.

If you operate several Bus Terminal Controllers below the Master PLC, the Bus Terminal Controller with the slowest PLC time sets the task time for the Master PLC.

For ADS UDP, cyclic

Measure the required PLC time of the Bus Terminal Controller, add 20 to 30% and set the task time of the Bus Terminal Controller accordingly. Now take two times this task time; the result corresponds to the task time on your master controller.

Example:
Measured PLC time: 5 ms
Set a task time of 7 ms for the Bus Terminal Controller and
set a task time of 2 x 7 ms = 14 ms for the Master PLC.

If you operate several Bus Terminal Controllers below the Master PLC, the Bus Terminal Controller with the slowest PLC time sets the task time for the Master PLC.

For ModbusTCP, cyclic

Measure the required PLC time of the Bus Terminal Controller, add 20 to 30% and set the task time of the Bus Terminal Controller accordingly. Now take two times this task time; the result corresponds to the task time on your master controller.

Example:
Measured PLC time: 5 ms
Set a task time of 7 ms for the Bus Terminal Controller and
set a task time of 2 x 7 ms = 14 ms for the Master PLC.

If you operate several Bus Terminal Controllers below the Master PLC, the Bus Terminal Controller with the slowest PLC time sets the task time for the Master PLC.

Different PLC cycle times

If the Bus Terminal Controllers in your system require different cycle times for their local PLC processing, you can also adjust the time after which the Master PLC queries each individual Bus Terminal Controller individually.

TwinCAT as master PLC 2:
Individual adjustment of the time after which the Master PLC queries the individual Bus Terminal Controller

Divider

Use the divider for this purpose. The divider takes as its basis the cycle time of the higher-level Master PLC, for example 10 ms. If the divider is now set to 2, a telegram is sent to the Bus Terminal Controller every 2 x 10 ms, i.e. every 20 ms.

Modulo

Modulo can be used to set the timing for the higher-level Master PLC.

Example:
Divider 3, Modulo 0, means that a telegram is sent after the 1st task cycle and then after every 3rd task cycle.
If the Modulo is set to 1, a telegram is only sent after the 2nd task cycle and then after every 3rd task cycle + 1.

In systems with many Ethernet nodes this enables the number of Ethernet packets to be distributed more evenly, which results in more uniform network load and avoids network load peaks.