Skip to content

CODESYS NVL

Beta

Exchanges Network Variable Lists (NVL) with any CODESYS-based controller (CODESYS Control, ctrlX PLC, WAGO, KEB and others). It is the UDP interface with the framing CODESYS NVL.

Choose CODESYS NVL (UDP) (beta) in Add Interface to exchange Network Variable Lists with any CODESYS-based controller (CODESYS Control, ctrlX PLC, WAGO, KEB and others). It is the UDP interface with the framing CODESYS NVL (Type: Udp, preset CODESYS-NVL). NVL is cyclic and connectionless: after a controller download or restart the next cycle writes the full state again, so no resynchronisation is needed, and a missing list shows up as a timeout.

Set up in CODESYS

  1. Add a global variable list (GVL) with the property Network variables. Use Pack variables, switch Transmit checksum and Acknowledgement off, and note the List identifier.
  2. A list the controller sends (Sender) is received by CONNECT. A list the controller receives (Receiver) is sent by CONNECT. Set the sender’s target to the CONNECT PC’s address (unicast; broadcast usually does not reach it through routers or virtual adapters) and port 1202.
  3. Open UDP port 1202 in the controller’s and the PC’s firewall. CONNECT and a CODESYS runtime on the same PC cannot both bind port 1202: use another port on both sides.
  4. Export the list with Link to file (*.gvl).

Import in CONNECT. In the interface’s ⋮ → Edit… dialog choose Import .gvl…, select the file and, if the lists use structures or enumerations, add the TYPE … END_TYPE declarations. The dialog previews the list, its bytes and telegrams and the signals (arrays as Name[i], structure members as Name.Member). Choose whether the controller sends or receives the list and the target interface. Importing again replaces the list with the same identifier and its signals. The import also sets list id, pack, interval and minimum gap from the file. Signals already mapped to a model signal keep the model’s type; a mismatch is listed in the preview and shown as a signal issue, never changed silently.

ParameterDefault
FramingCodesysNvl
Local bind address / port0.0.0.0 / 1202
Remote host / portPLC address / 1202
String encoding (NvlStringEncoding)UTF-8 (alternative Latin-1); WSTRING is always UTF-16LE

Each list has these settings:

SettingUnitDefaultMeaning
List ID-1CODESYS list identifier, unique across both directions
Direction-ReceiveReceive: the controller sends. Send: CONNECT sends
Pack-onCODESYS Pack variables
Intervalms50Send: cyclic interval (0 = off)
On change / Min. gap- / msoff / 20Send: additionally on change, with a minimum distance
Timeoutms1000Receive: no complete list for this long marks the data stale (0 = off)

Signal addresses are <listId>/<offset>:<TYPE>, for example 1/0:BOOL, 1/2:INT or 2/0:STRING(80). The offset is the byte offset in the list’s data, counted without padding. In this form INT is the 2-byte IEC INT, unlike the raw UDP address where INT is 32 bits.

IEC typeSizeSignal type
BOOL, BYTE, SINT, USINT1 byteBool (BOOL) or Int
WORD, INT, UINT2 bytesInt
DWORD, DINT, UDINT, TIME4 bytesInt (UDINT above 2 147 483 647 is reported as out of range)
REAL, LREAL4 / 8 bytesFloat (LREAL loses precision)
STRING(n), WSTRING(n)n+1 / 2·(n+1) bytesText, n = 1…255

LINT, ULINT, LWORD, LTIME, DATE, TOD and DT are counted in the layout so later offsets stay correct, but get no signal.

Behaviour. Lists are matched by identifier only, never by sender port. CONNECT publishes a received list once every telegram of it has arrived. If a list stays silent longer than its timeout, the interface shows an error naming the list; it returns to Connected when every list is healthy again and sends all send lists once immediately. Send lists are also sent once right after connecting. Writing needs Allow writing to the partner.

Limits. Transmit checksum and Acknowledgement are not supported: switch them off (received telegrams with the checksum flag are accepted and reported as unverified). A single item larger than 256 bytes cannot be transmitted by CODESYS either. Lists are limited to 65 535 bytes. Controllers with big-endian byte order are not supported. A list whose layout differs from the import is reported as a layout mismatch: import the .gvl again.

Version compatibility: CONNECT 1.11 or newer is required; release CONNECT before realvirtual. With an older CONNECT the preset, the framing selection and the import are not offered, and an NVL configuration copied into an older CONNECT shows every signal as an address error.

  • Manually. First import the .gvl, which creates the list and its layout. Signals then use the address form <listId>/<offset>:<TYPE>, for example 1/0:BOOL, 1/2:INT or 2/0:STRING(80). The offset is the byte offset in the list’s data, counted without padding.
  • Browse. No browse: NVL is cyclic and connectionless, so there is nothing to ask the controller. Use the .gvl import instead.
  • File import. Yes. Import .gvl… (in the interface’s ⋮ → Edit… dialog) reads the *.gvl file exported with Link to file in CODESYS and previews the list, its bytes and telegrams and the signals before anything is created.
  • From the model. Use Addresses → Import address table… in the signal-mapping section of the CONNECT panel: a CSV or TSV with name;address[;dataType[;topic]] rows, where the name is the model’s signal name. New signals take direction and type from the same-named model signal; signals that already exist keep their configured type. Fill from controller… has nothing to match, because this protocol cannot be browsed. See Configuring interfaces.

How direction, data types and write access are decided is explained in Common concepts and Configuring interfaces.