Skip to content

Library

nXPico W’s WiFi/lwIP network stack is reachable from ST through three routes:

SysSocket

Standard CODESYS system library — raw TCP/UDP sockets. Already part of CODESYS, nothing to install.

X.509 device identity

Firmware functions — generate the device key pair and certificate, read them back. Full reference →

MQTT / MQTTS

Firmware functions — publish/subscribe client, plain TCP or TLS with client-certificate authentication. Full reference →

nXPicoX509nXPicoMQTT
What it gives youDevice identity: EC key pair and certificate generated on the boardMQTT client, plain TCP or TLS
Functions88
nXPico——
nXPico Wyesyes
nXPico Myesno — the modem carries MQTT, see nXPico M › Modem
Needs the other onenofor any TLS: the trust anchor is stored only if the device identity exists
Fileprecompiledprecompiled

Both are declaration-only: the code lives in the firmware, so installing them adds nothing to your application’s memory footprint. A board whose firmware does not carry a function rejects the download with an explicit error — it never fails quietly at runtime.

The X.509 and MQTT functions are implemented in the runtime, not in IEC code: these libraries declare them for you.

  1. Download:
  2. Tools → Library Repository → Install… → select the file → Close. Repeat for the other one.
  3. Library Manager → Add Library… → search for nXPicoX509 / nXPicoMQTT.

All firmware functions share the runtime’s error codes:

ValueNameMeaning
0ERR_OKdone
1ERR_FAILEDgeneric failure (usually: resource missing)
2ERR_PARAMETERinvalid parameter
3ERR_NOTINITIALIZEDa prerequisite is missing
10ERR_PENDINGrequest accepted, result comes later
11ERR_NUMPENDINGtoo many pending requests, retry
15ERR_BUFFERSIZEbuffer too small, or data too large
17ERR_NOMEMORYqueue full or out of memory

10 is not an error: it means the request was taken up and the outcome must be checked with the matching status function.