Network VariablesΒΆ

The values of network variables can be exchanged between different controlling devices in a network. The variables must be defined in strict, identical lists on both the sender device and receiver device, and only one device application defines the network variables. The lists can be in one or more projects.

The network variable list in the sender is a global variable list where specific log and transfer parameters are defined in their object properties. By adding these properties, you create a “network variable list (sender)” from an ordinary GVL. You can also insert a Network Variable List (Sender) object directly into the device tree when this object already has these parameters set.

The network variable list in the receiver is of type Network Variable List (Receiver). When creating one, select the respective network variable list of the server. As an alternative, you can read this variable list from an export file that was generated from the sender list. An export file is required anyway for defining the sender list in another project.

The network variables are transmitted as broadcasting in one direction only: sender to receiver. However, it is also possible for a device to contain both sender and receiver lists.

For the NetVarUdp library version 3.5.7.0 and later, a receiver channel is no longer assigned when confirmed transfer is not selected. In this way, network variable exchange is also possible between two controllers on one hardware device .

Hint

  • If the exchanging devices should be senders and receivers, then the variable list identifiers must be unique in order to prevent abnormal operation. The variable list identifiers are defined in the Properties dialog of an object GVL.

  • Data exchange via network variables is not possible when:

    • The device (target system) does not support it.
    • A firewall blocks the communication.
    • Another client or application is using the UDP port that is set in the properties of the network variable list.
    • More than one application per sender device and receiver device use network variable lists.
  • Only arrays that have limits defined with a literal or constant are transmitted to the receiver application. Constant expressions are not permitted for this purpose.

    Example: “arrVar : ARRAY[0..g_iArraySize-1] OF INT ;” is not transmitted, but “arrVar : ARRAY[0..10] OF INT ;” is transmitted.

  • The maximum size of a network variable is 255 bytes. The possible number of network variables is unlimited.

Note

Communication by means of network variables is also possible when the PLCs operated with applications from different versions of the development system (V2.3, V3). However, in this case, you cannot use the export/import mechanism for matching the variable lists exactly in the sender and receiver projects. The reason is that an variable export file (*.exp) that is generated from V2.3 does not include the required amount of information necessary for creating a receiving NVL in V3. There is no respective network parameter configuration as a GVL file, which you exported from the sender previously. To get this file, you must recreate the V2.3 NVL in V3 first. Then you can generate an export file and create a receiving NVL in V3 based on this.

Note

An alternate to data exchange between PLCs is the use of data sources. As opposed to the broadcasting method for exchanging network variables, defined point-to-point connections are created between one application and a remote data source.

See also