Beckhoff network variables - Settings

Beckhoff network variables (NWV) can be used for cyclic or acyclic sending of data between Windows-based PCs. In a device declared as a publisher (sender), such a network variable is received on the other side by a subscriber declared as the same type. As the name suggests, this data traffic is network-based, and the configuration is directly based on the protocols used.

A choice of two protocols is available:

The telegram with the process data arrives at the recipient device (network port) via these addressing modes. In the Ethernet device/TwinCAT several transported process data are allocated via a variable ID

All network variables must be declared in the System Manager before they can be used.

The following intervention options are then available during operation:

Diagnostic variables on the publisher and subscriber side provide information about the connection quality.

If network variables are used, the temporal boundary conditions for the network topology used must be taken into account: In switched mode (MAC addressing) communication cycles of approx. 10 ms and below can be achieved, in routed mode (IP addressing) a few 100 ms may be achievable in some cases.

Beckhoff network variables - Settings 1:

Diagnostic variable "quality"

If the processing tasks operate with different cycle times or the user changes the DataExchangeDivider, this must be taken into account in the analysis of the diagnostic variables. In conjunction with a fast Subscriber (e.g. 10 ms), a slow Publisher (e.g. 100 ms) leads to poor connection quality (as reported by the diagnostic variable "Quality").

Dynamic temporary blocking of sending a Publisher must also be taken into account. In this case the Subscriber registers poor quality.

Beckhoff network variables - Settings 2:

Diagnostic variable "CycleIndex"

Please note the following information in order to decide whether you have to serve the variable CycleIndex.

Basic principles of Beckhoff network variables

Beckhoff network variables - Settings 4:

Selecting the variable ID

In order to achieve unambiguous allocation we recommend using different IDs for each data communication between connected PCs.

Reason: In Fig. Example for communication via network variables, PC2/subscriber2 not only receives the designed ID=8-variable from PC1/Publisher2, but, since it is sent as a broadcast (!), it also receives the NWV from PC3/Publisher1. Differentiation is then no longer possible in PC2.

Beckhoff network variables - Settings 5:
Example for communication via network variables
Beckhoff network variables - Settings 6:

Data representation on different platforms

Please note that simple and complex data (WORD, ARRAYs, REAL, STRING, user-defined structures) are represented internally in a different manner on different platforms! x86 platforms use byte-alignment, others (ARM) 2-byte or 4-byte alignment.
This means that if a complex structure is created in an x86/PC PLC project and an ARM PLC project, they can each have a different effective size and a different internal structure.
In Fig. Example for different size and structure in PC and CX, the structure in the CX (and hence the network variable to be created there) is larger than in the PC; also the word and real variables do not match each other because a variable can begin at any byte position in the PC, but only at every even-numbered one in the CX.

Recommendation for structures that are identical on both end devices

- firstly, all 4-byte variables (must lie at an address that is divisible by 4)

- then all 2-byte variables (must lie at an address that is divisible by 2)

- then all 1-byte variables

Further recommendations

- if STRING(x) is used, the "EndOfString" zero is also interpreted as a character, otherwise x+1 must be divisible by 4

- the above rules also apply to sub-structures.

Please refer to the notes in the Structure section of the Infosys.

Use of Bus Terminal Controllers (BCxxxx, BXxxxx)

Since the representation of floating point numbers (REAL) on Bus Terminal Controllers (BCxxxx, BXxxxx) differs from that in the x86, these cannot be transmitted. "SINT", for example, can be used for signed values.

Beckhoff network variables - Settings 7:
Example for different size and structure in PC and CX

Settings in the System Manager

Beckhoff network variables - Settings 8:

Appearance of the variables

Depending on the platform used (PC or EL66xx), the publisher/subscriber will appear differently. A Publisher/Subscriber can be created.

    The following settings options are available in the Beckhoff System Manager TwinCAT 2.10 build 1328:

    Publisher, Box

    Beckhoff network variables - Settings 9:
    Publisher RT Ethernet settings

    RT Ethernet settings:

    Beckhoff network variables - Settings 10:

    Use of broadcast and multicast

    Network variables sent as broadcast or multicast at MAC or IP level can generate high network load (depending on the cycle time), since they are multiplied into the whole connected network. This may cause simple network devices such as printers to crash. With short cycle times all network traffic may become blocked.

    We strongly recommend using unicast addressing, taking into account variable identification, as described above.

    Advanced Settings:

    Beckhoff network variables - Settings 11:
    Publisher settings - UDP/IP

    UDP/IP settings - the addressing technique of the IP network layer with IP addresses is used. UDP is a connection-less protocol without feedback.

    Beckhoff network variables - Settings 12:

    Use of broadcast and multicast

    Network variables sent as broadcast or multicast at MAC or IP level can generate high network load (depending on the cycle time), since they are multiplied into the whole connected network. This may cause simple network devices such as printers to crash. With short cycle times all network traffic may become blocked.

    We strongly recommend using unicast addressing, taking into account variable identification, as described above.

    Advanced Settings:

    Publisher, Variable

    Beckhoff network variables - Settings 13:
    Publisher variable settings

    Settings:

    Subscriber, Box

    Beckhoff network variables - Settings 14:
    Subscriber settings

    Settings:

    Process data:

    Subscriber, variable

    Beckhoff network variables - Settings 15:
    Subscriber variable settings

    Settings:

    Process data: