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 5ceea2272d8bb03d0a317f3464799117_4847f162f816809ec0a8640e014154c8 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 a 5ceea2272d8bb03d0a317f3464799117_4847f162f816809ec0a8640e014154c8 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.

As from version 3.5.7.0 of the l:code:NetVarUdp library not any longer a receiver channel will be used if you use acknowledged transfer. So also network variables exchange between 2 controllers on 1 hardware device is possible.

Attention

  • If the exchanging devices are supposed to 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 box 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, or
    • 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

An alternate to data exchange between controllers is the use of a DataServer. 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