TwinCAT PLC as Master

A PC or a CX can act as master for the BC9x20/BC9050/BX9000. It then polls the PLC variables, in accordance with the set task time. In this way it is possible to transfer data between a control system and a BC9x20/BC9050/BX9000. The following communication methods are permitted:

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)

TwinCAT PLC as Master 1:

GetHostByName - searching for the IP address by name

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 the K-bus reports an error, for example
BoxState: see comment in the dialog
MissedCnt: This should, if possible, not increment. 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 PLC time required on the Bus Terminal Controller and set the task time on the Bus Terminal Controller by adding 20-30 %. Now take three times this task time; the result corresponds to the task time on your master controller. Example: measured PLC time is 5 ms; set a task time of 7 ms for the Bus Terminal Controller and 3 x 7 ms = 21 ms ms for the master PLC. If several Bus Terminal Controllers are used, the one with the slowest PLC time determines the task time for the master controller.

For ADS UDP cyclic

Measure the PLC time required on the Bus Terminal Controller and set the task time on the Bus Terminal Controller by adding 20-30 %. Now take two times this task time; the result corresponds to the task time on your master controller. Example: measured PLC time is 5 ms; set a task time of 7 ms for the Bus Terminal Controller and 2 x 7 ms = 14 ms ms for the master PLC. If several Bus Terminal Controllers are used, the one with the slowest PLC time determines the task time for the master controller.

For ModbusTCP cyclic

Measure the PLC time required on the Bus Terminal Controller and set the task time on the Bus Terminal Controller by adding 20-30 %. Now take two times this task time; the result corresponds to the task time on your master controller. Example: measured PLC time is 5 ms; set a task time of 7 ms for the Bus Terminal Controller and 2 x 7 ms = 14 ms ms for the master PLC. If several Bus Terminal Controllers are used, the one with the slowest PLC time determines the task time for the master controller.

Different PLC cycle times

If the Bus Terminal Controllers used in your system have different cycle times for local PLC processing, you can adjust the time, based on which the higher-level TwinCAT PLC queries each individual Bus Terminal Controller.

TwinCAT PLC as Master 2:
Adjust the time after which the TwinCAT PLC queries a Bus Terminal Controller

Divisor

Use the divisor for this purpose. The divisor used the cycle time of the higher-level TwinCAT PLC, e.g. 10 ms. If the divisor is 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 TwinCAT PLC.
Example:
Divisor 3, Modulo 0 means a telegram is sent after the 1st task cycle and then after each 3rd task cycle.
If Modulo is set to 1, a telegram is sent after the 2nd task cycle and then after each 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.