# CODESYS network variable lists (NVL)

> Exchange data with CODESYS-based controllers through network variable lists, without programming a communication protocol on the PLC.

Network variable lists are the simplest way to send data out of a CODESYS controller: the PLC broadcasts a list of variables over UDP, and receivers take it over with the same declaration. PLCGateway is such a receiver and can also send a list back to the PLC.

The declaration of the list is pasted into the device form, so the variables appear with their names and types and can be browsed. Large lists are split into telegrams the way CODESYS does it, and a watchdog marks the values as stale when no telegram arrives.

- **Driver id:** `codesys_nvl`
- **Connection:** UDP 1202 · unicast / broadcast / multicast
- **Address browsing:** yes
- **Writing:** yes
- **Included in:** PLCGateway Connect, PLCGateway SCADA, PLCGateway Embedded

## What PLCGateway reads and writes

- BOOL, BYTE to LWORD, SINT to LINT, REAL, LREAL
- TIME, DATE, TIME_OF_DAY, DATE_AND_TIME
- STRING(n) and WSTRING(n)
- One-dimensional arrays
- A send list for values written by PLCGateway
- Unicast, broadcast and multicast; several lists on one port

## Address examples

| Address | Meaning |
|---|---|
| `rTemperature` | Variable of the received list |
| `aValues[3]` | Array element |
| `tx.bStartCmd` | Variable of the send list (writable) |
| `@12 · @0.3` | Raw byte offset / bit |

## Controllers and devices

- [CODESYS-based controllers](https://plcgateway.com/controllers/codesys-plcs.md)
- [Schneider Electric Modicon](https://plcgateway.com/controllers/schneider-electric.md)

## Connect in a few steps

1. In CODESYS add a network variable list (sender) with the variables to send; switch off checksum and acknowledgement.
2. Add a CODESYS NVL device in PLCGateway with the port and list identifier and paste the same declaration.
3. Browse the variables and add them as tags; optionally declare a send list for values that go back to the PLC.
4. Use the values in screens, history, alarms and OPC UA.

## Questions and answers

### Which controllers use CODESYS?

Hundreds of PLC brands are built on CODESYS, for example WAGO PFC, ABB AC500 V3, Schneider Electric Modicon M241/M251/M262, Eaton XC300, Festo CPX-E-CEC and soft PLCs on Raspberry Pi or industrial PCs.

### Is NVL better than OPC UA?

NVL is lightweight and needs no server on the PLC, ideal for cyclic process values. If the controller has an OPC UA server and symbolic browsing of the whole application is needed, the OPC UA client is the better choice.

### What happens when the PLC stops sending?

After the watchdog time the values get the quality Stale, so screens, alarms and OPC UA clients see that the data is old.

## Related protocols

- [OPC UA client](https://plcgateway.com/protocols/opc-ua.md)
- [Modbus TCP / RTU](https://plcgateway.com/protocols/modbus.md)
- [All protocols](https://plcgateway.com/protocols.md)

_Product and model names are trademarks of their owners. They are named only to show which equipment the drivers communicate with; PLCGateway is not affiliated with these companies._

---
Source: https://plcgateway.com/protocols/codesys-nvl
