Skip to content

v0.20.0

Choose a tag to compare

@github-actions github-actions released this 05 Nov 17:41
· 858 commits to main since this release
b6f6a59

OPC UA writes and an OPC UA client; outputs that hold up through outages and failovers

The OPC UA server now takes writes from trusted clients, over secure endpoints with a certificate store you manage with naut opcua certs|trust. Every limit listed for it in 0.19 is fixed. A new opcua-client driver reads other OPC UA servers. The write path is now the same for every way in: HTTP, OPC UA and Sparkplug commands are all converted and range-checked against the tag's declared type. The Modbus, EtherNet/IP and OptoMMP drivers were hardened for outages and failovers, and a hung scan now closes the write gate. VAR RETAIN keeps state across a restart. naut check gained diagram structure warnings and refuses several mistakes it used to let through. Both OPC UA features are still preview. The groov EPIC and PLCnext targets are still experimental. The EPIC's new standby behaviour was run on the bench unit with two replicas on a real Kubernetes Lease (below); the PLCnext changes in this release have not been run on the controller yet.

Upgrading from 0.19

These can make a project that passed 0.19 fail naut check or naut run, or behave differently while running.

naut check and naut run refuse more

  • The ST parser no longer skips what it does not understand. In ST, and in the ST that LD, FBD and SFC compile to, these are now parse errors in both naut check and naut run:

    • an unclosed (* comment
    • a POU with no END_PROGRAM
    • two operands in a row: s := a b; used to run as s := a; followed by b;
    • a name alone as a statement
    • a string that is not closed on its own line
    • an unknown $ escape

    "…" is now a WSTRING literal, held as a STRING; it used to be dropped character by character. $' no longer ends a '…' string. (#610)

  • An output with no init: that its program reads before writing is a naut check error. Such a read faulted with undefined tag at run time, and a seal-in faulted on every scan. The error sits on the tag's line, names the program, and tells you to add init:. If the read only comes first when a WHILE or a FOR runs zero times, it is a warning instead. naut run is unchanged. (#568)

  • An input or output whose driver binding differs only in case is a naut check error. One example is a tag m1_kw against a binding M1_KW. Such a tag never received the driver's value, or never reached the device, and nothing said so. naut run still starts. (#547)

  • Tags a FUNCTION reaches through VAR_EXTERNAL are now bound like the calling program's own: seeded, typed and snapshotted each scan. As a result, a FUNCTION or FB that declares a tag with a different type than the program does (Mode : INT against Mode : REAL) now fails to load. Before, the later declaration silently replaced the earlier one. A FUNCTION that reads an undeclared tag is now a naut check error. (#615)

  • Two programs that declare the same enumeration TYPE differently now fail to load. "Differently" means different members, values or default member. Before, a tag of that type started from whichever declaration compiled last. (#520)

  • A library VAR_GLOBAL RETAIN global that the manifest declares as an input or output now fails to load ("never retained"). The same applies to retain: true on an input or output. (#494)

  • sparkplug.writable patterns read [ as an array index. [n] matches that index and [*] matches any index. Character classes are gone:

    • Any other [ (for example Fill[VW]alve) now fails naut check and stops naut run.
    • A pattern like Pump[12] now names an array element, which a command never writes, and naut check warns. (#577)
  • A Modbus source host: that carries a port is refused. host: 10.0.0.5:5020 used to be dialed as 10.0.0.5:5020:502 and never connected. It is now a load error asking for port:. naut modbus import splits the address for you. (#473)

  • New warnings, same exit code. naut check now reports ladder, FBD and SFC structure warnings (LD001–LD006, FBD001–FBD003, SFC001–SFC002) and warns on an integer where a TIME is expected (PT := 30000). It still exits 0:

    • Most hand-written ladder will show LD005, a rung with no comment.
    • To switch a rule off, add check: {disable: [LD005]} to the manifest, or put (* @allow LD005: reason *) in a POU's header.
    • naut logix import writes a file-wide @allow, so imported ladder stays quiet. (#574, #497)

The runtime behaves differently

  • Inputs from a communications driver start at init: or zero instead of faulting. This covers the Modbus, EtherNet/IP, Sparkplug host, OPC UA client, SNMP, Redfish and Prometheus drivers. Before, a program that read a tag from a device that was down at start faulted on every scan, which also stopped any local-I/O logic in the same program. Now the tag reads init:, or the zero of its type, with quality NotConnected until the first real value arrives. Check the driver's __Online tag instead of relying on the fault:
    • A tag that nothing gives a type stays unseeded, and naut check warns about it.
    • The plcnext, optommp, replay and memory drivers keep the loud fault.
    • The eip driver gets an eip__Online companion, and its read no longer errors while the controller is down. Before, in a drivers: set, that error starved every other driver.
    • Fault transitions are now logged once each way per task. (#458, #459)
  • A STRUCT member's := initial value is now used. Before, every member started at zero. This applied to a manifest tag of the type without init:, a VAR of the type, a VAR_TEMP reset and an FB's internals. A manifest init: still overrides member by member. (#461)
  • VAR RETAIN now keeps its value. In 0.19, RETAIN was accepted and did nothing. With a retain: section, every program's VAR RETAIN variables and every library VAR_GLOBAL RETAIN global are saved and restored on a restart and on a takeover. A counter or edge detector (CTU, R_TRIG) declared there keeps its edge memory. Timers and PID start over. (#494)
  • A program's write to one struct member or one bit no longer overwrites the rest. The scan used to commit the whole struct tag, or the whole integer word, when the program assigned any member or bit. That put back the copy it took at scan start over a write that landed mid-scan from HTTP, OPC UA, Sparkplug or another task. Now only the members and bits the program assigned are committed, and the program still wins on the same member or bit. Setting the sign bit of a signed integer (INT.15 := TRUE) now gives the negative value; before, it stored 32768. (#581, #623)
  • A hung scan closes the write gate, with or without redundancy:. A scan still running after twice its period counts as hung; the check never waits less than 1 s or more than 2 s. A scan that genuinely takes longer than 2 s will trip it:
    • Without redundancy:: the Modbus, EtherNet/IP and OPC UA client drivers close their write gate 4 s after the last live check, about 5–8 s into the hang. Their queued writes and Modbus rewrite: keep-alives stop, so a device's own watchdog can act. When the scans resume, the gate reopens and every output is pushed once.
    • With redundancy:: a hung leader stops renewing its lease and hands over, and a hung replica never takes over. (#627)

HTTP API

  • Writes and forces are checked against the declared type. POST /api/tags either converts a value to the tag's declared type exactly or refuses it:

    • An integer outside its type's range, or a fraction of a millisecond to a TIME, gets a 400.
    • A REAL takes no NaN or infinity.
    • An enumeration takes only a member's name or value.
    • The wrong kind of value for a whole tag is still a 422, but a refused write no longer retypes the tag.

    A whole-tag write to a driver-owned input is now a 400, as member writes already were. To hold an input, also with the memory driver, use POST /api/forces. POST /api/forces applies the same checks; before, it held 70000 on an INT. TIME tags accept IEC literals ("T#1m") on writes and forces. (#497, #501, #515, #519)

Sparkplug

  • Edge node commands are checked like any other write. NCMD and DCMD now go through the same path as HTTP and OPC UA writes:

    • A value the declared type can't hold, a value out of range, or a command to a forced tag is refused, logged once per tag and counted in commandsRefused.
    • A command to an input is refused, whatever sparkplug.writable says.
    • A String metric writes only a STRING or an enumeration.
    • A name that is not declared is refused. Before, it created a new tag.
    • A template command is judged member by member.

    sparkplug.writable is now matched against the tag's declared spelling, not the host's. A host can no longer get past a pattern by changing case, so a pattern that relied on the host's spelling may need updating. (#514, #620)

  • The edge node waits for the primary host's STATE after a lost connection. With primary-host: set, after a reconnect the node waits for a STATE on the new connection before it births and replays its store-and-forward backlog. A retained ONLINE still births at once. A UInt32 metric at or above 2^31 is no longer sign-extended. (#462, #503)

  • The Sparkplug host takes every node offline when it loses its broker. Every node and device it tracks goes __Online false at once and counts one __Outages each. Values are kept and bindings read Stale. Each site comes back at its next birth. A command raised during the outage now waits for that site's birth (a device command waits for its DBIRTH), not for the reconnect. A binding whose node is online but waiting for a birth now reads Stale until the NBIRTH arrives. (#549, #575)

Modbus

  • <source>__Online means the device answers, not that TCP is up. It goes true on the device's first answer on a connection. It goes false once every block's latest read has failed and three gateway no-answers (0x0A/0x0B) have come in a row. A write-only source without rewrite: is still online on connect. An idle source now notices a dead link through TCP keepalive and goes offline within about 15 s. Each source also delivers <source>__Outages (DINT); a binding of your own with that name is now refused, as __Online already was. (#550, #537, #572)

Redundancy

  • A takeover commands every output. The Modbus, EtherNet/IP, OptoMMP and OPC UA client drivers now check the write gate when their queue goes out, not only when a command is queued. A replica that loses leadership drops what it queued as leader:
    • A replica that has been a standby has no start-up baseline, so its first push as leader writes every output, changed or not.
    • The first push after a reopened gate does the same, so a write-to-trigger register is written again on every takeover.
    • In a cluster, naut run now waits up to 5 s for the elector's first decision before it starts the drivers and the scan. (#598, #604, #614)
  • groov EPIC: a standby leaves the unit alone. A standby's optommp driver now only polls. It no longer clears latches, points the stream at itself, sets the watchdog or writes custom-area pointers, and a takeover moves the stream on the same connection:
    • With watchdog: above 0 s, a standby holds no connection at all, so a leader that loses the unit lets the watchdog trip. The standby's tags go Stale, and online falls without counting an outage.
    • On takeover, the runtime waits up to 2 s for a fresh read of the unit before it runs logic. (#622, #628)
    • Checked on the bench EPIC with two replicas: about 35,700 standby requests, all reads; four takeovers (SIGTERM, a paused leader, a lapsed lease), each moving the stream on the same connection and commanding all 12 outputs. With watchdog: 2s, a paused leader let the unit trip after 3.45 s of silence, and the new leader had the outputs back under command 0.1 s after taking the lease.

OPC UA server

  • Secure endpoints and stricter sessions:
    • Every advertised address now also offers Basic256Sha256, Aes128_Sha256_RsaOaep and Aes256_Sha256_RsaPss under SignAndEncrypt. A client left to pick the strongest endpoint will pick one of these and be refused (Bad_CertificateUntrusted) until you trust it with naut opcua trust, or point it at None.
    • On first start, the server creates its certificate store in ./pki (set it with opcua.pki). Keep the store out of git.
    • A session belongs to the channel that created it, so a client that reconnects opens a new session.
    • Only anonymous identity tokens are accepted; a user-name token gets Bad_IdentityTokenInvalid.
    • The server announces ApplicationUri urn:joyautomation:nautilus:<project>; opcua.application-uri overrides it.
    • Operation limits are enforced: 500 nodes per Browse, 100 per TranslateBrowsePaths and per Call, 10 000 per Write.
    • The static diagnostic nodes, MaxArrayLength and MaxStringLength are gone (Bad_NodeIdUnknown).
    • An enumeration tag's DataType is now an enumeration node in the project namespace; its value is still an Int32.
    • A node's DataType follows the tag's declared type. (#479, #487, #490, #501, #508, #520, #524, #525)

Added

  • OPC UA server writes (preview). opcua.writable opens tags and members to writes from a session on a SignAndEncrypt endpoint with a trusted client certificate:
    • Trust: the trust list is read again on every Write, so withdrawing a certificate stops its writes on the channel it already has.
    • Batching: each request's items land in one scan, all or none.
    • Refusals: inputs are never writable. A standby refuses writes with Bad_InvalidState.
    • Arrays: elements of an array of scalars are written by node id (Levels[2]). Whole arrays and IndexRange writes are refused for now.
    • Audit: every write is an audit line, and the opcua-server row counts writes and refusals.
    • Certificates: naut opcua certs lists the store and naut opcua trust <thumbprint> approves a client.
    • Labs: for a lab without certificates, opcua.anonymous-writes: true lets anonymous clients on the None endpoint write what writable opens. naut check and every start warn about it. examples/plclab drives a project from MHJ PLC-Lab this way; it has been tested with asyncua, not yet with PLC-Lab itself. (#487, #490, #501, #506, #555, #577)
  • OPC UA client driver (preview). driver: {type: opcua-client} polls one OPC UA server per driver in batched Reads:
    • It resolves namespace URIs at connect, reconnects on its own, and delivers opcua_client__Online.
    • On a secure endpoint it pins the server certificate on first use.
    • Writes are opt-in per tag.
    • naut opcua browse|import|tags writes the manifest and tag file.
    • So far it has been tested only against gopcua's in-process server, not yet against Ignition, Kepware or a PLC's embedded server. (#465)
  • OPC UA server services: ModifySubscription, ModifyMonitoredItems, SetPublishingMode, TransferSubscriptions (same application only), TranslateBrowsePathsToNodeIds and Call (GetMonitoredItems, ResendData). Enumerations are served as their own DataTypes, so clients get member names. The Server object describes nautilus and carries the standard mandatory variables. (#479, #481, #520, #524, #535)
  • Retained state the logic owns. retain: true on a state tag, VAR_GLOBAL RETAIN in a library and VAR RETAIN in a program all go into the retain store beside the setpoints. (#494)
  • Outage counters on every protocol driver. Each of these drivers delivers status tags beside __Online, so a program can latch an outage and hold its outputs until an operator acknowledges it:
    • Modbus sources and Sparkplug host nodes and devices: __Outages. A manifest names it with outagestag.
    • optommp and plcnext: __Outages and __WatchdogTrips, through a status: binding on PLCnext.
    • The bench examples show the pattern with an IoHold block. (#456, #537)
  • Diagram structure warnings in naut check and the editor, with a stable rule ID and a "write instead" message for each. A new check: manifest section sets thresholds and disables rules. The reference page is /reference/structure-warnings/. (#574)
  • naut new writes an AGENTS.md (imported by CLAUDE.md) into manifest projects. It keeps AI-written LD, FBD and SFC readable and names the structure warning that checks each rule. A new guide, AI assistants, covers adding it to an existing project. (#556, #630)
  • Sparkplug host rebirth-requests: false sends no rebirth request of any kind. A passive host with it can run on a read-only broker account. A passive host's __Rebirth button now works. (#575)
  • PLCnext: ch:N and naut plcnext import. ch:N is the channel number printed on the module, so you no longer work out bit:((n+7) mod 16) yourself. naut plcnext import <plcnext_devices.yaml> writes the module list and bindings. Neither has been run on the controller yet. (#455)
  • Typed imports. naut modbus import and naut optommp import now write a type: for every tag, so a program can read an imported tag without a VAR_EXTERNAL. naut eip import writes the eip__Online companion. (#459, #519)
  • naut new my-plant --template minimal writes the project without prompting. (#519)
  • A stale HMI is called out. naut run, naut build and naut check print a line when server.hmi is older than a mimic, a scene or the HMI's own source. (#466)
  • Docs:
    • a step-by-step beginner tutorial (#554)
    • Your first program (#512)
    • an HTTP API reference (#513)
    • which tag role fits which job (#511)
    • the structure-warnings reference (#574)

Changed

  • naut run on a terminal logs terse, word-wrapped lines (time of day, message, attributes). Output to a pipe, a file or systemd is unchanged. (#446)
  • Stopping is orderly. On a stop, naut run gives the HTTP port back first. It then waits for the last scan and one more retain save, at most 5 s. A loop overrunning its period now stops. (#475, #534, #617)
  • Errors point at the cause. A parse error is reported with its file, line and column, not as a missing TYPE. Manifest errors are located at nautilus.yaml:line:col. A manifest tag error is reported as itself, not as undeclared identifiers in the programs. (#474, #495, #516)
  • naut test shows TIME values as literals (Delay = T#2m, want T#1m30s). given:, force: and expect: convert values, including struct members, by their declared type. (#497, #502, #519)

Fixed

  • OPC UA server: every limit listed in 0.19 is fixed:
    • A never-delivered local-I/O input is a node from the start, reading Bad_NotConnected. (#420, #488)
    • A quality change with no value change is pushed to subscribers. (#419, #480)
    • A client arriving through a NAT address or DNS alias gets its session. (#430, #445)
    • CloseSession honours deleteSubscriptions, and subscription ids are never reused. (#422, #432, #445)
    • A Disabled item's queued value is dropped. (#445)
    • ModifySubscription and the five previously unsupported services work. (#431, #433, #481, #524)
  • OPC UA server, other fixes:
    • An empty String is served as "", not null. (#434, #482)
    • A Browse naming an abstract reference type without subtypes could crash the whole controller process; any handler panic is now answered Bad_InternalError. (#521)
    • Shutdown with a session open is prompt. (#423, #475)
    • Publish requests past the queue limit, or with no subscription, get their proper status codes. (#588, #589)
  • Modbus write path:
    • A scan's contiguous writes go out as one FC16, never split by a mid-scan poll. (#594)
    • A broken flush re-sends only the write that broke and the ones after it, so it can't put back an old value over another master's. EtherNet/IP gets the same fix. (#597, #614)
    • A write answered 0x0A, 0x0B or 0x06 (it did not run) is retried once per retrymin with one warning, instead of being dropped; 0x04 stays a refusal. (#603)
  • Sparkplug: a Template member with no timestamp takes its metric's. Cirrus Link's MQTT Engine rejected the whole NBIRTH without one. (#463)
  • Forces and failover:
    • A force made before the first scan now holds on a single controller. (#500)
    • During an orderly failover, a standby re-sends a forwarded API request the old leader refused, instead of answering 502. (#505)
  • Retain: a setpoint written just before an orderly stop survives it. (#534)
  • HMI: a rebuilt HMI is no longer answered 304 with the old ETag. (#412)
  • HTTP API: CORS allows PUT, shelving an unknown alarm is a 404, and the journal filters before it limits. (#517)

Known limits

  • OPC UA server (preview):
    • Sessions are anonymous; no user names are offered.
    • Whole-array and IndexRange writes are Bad_WriteNotSupported.
    • A monitored item's queue size is always 1, and its filter is not acted on.
    • MaxNotificationsPerPublish and Priority are not acted on.
    • There is no retransmission queue.
    • A subscription can't be transferred from a dropped connection.
  • Write gates are looked at, not pushed. A driver that loses and regains its gate between two looks does not see it. The window is about a second while a source is connected, and up to retrymax (60 s by default) while every source is down.
  • groov EPIC under redundancy: latch events at the takeover edge can be lost or delivered twice. A watchdog trip that happens during a failover is not counted in the new leader's __WatchdogTrips or __Outages, so a program that holds its outputs after an outage (the bench examples' IoHold) does not hold them after such a failover.
  • Known, on the bench:
    • Every naut start on the PLCnext logs one undefined tag logic error per scan until the driver has published its tags; local-I/O inputs keep the loud fault by design.
    • SCHED_FIFO on the PLCnext needs setcap cap_sys_nice+ep once per binary; rt/plcnext-io/README.md has the recipe.

The release carries the CLI for Linux (amd64, arm64, armv7), macOS and Windows. The PLCnext in-process I/O shim is attached as nautilus-plcnext-io_0.20.0_linux_armv7.tar.gz, and logixd.zip with install-logixd.ps1 as before.

With the VS Code extension and the HMI packages

Use the VS Code extension's stable 0.20.0 with this release; it requires naut 0.20.0. Since stable 0.18.0 it has gained:

  • the 3D scene editor and a kind editor for *.kind.json (#413, #415)
  • a component preview pane beside a .svelte file (#409)
  • mimic resizing, looks and part-anchored ports (#466)
  • diagram export and print to PDF or SVG (#557)
  • naut on the terminal PATH, with consent and undo (#566)
  • structure warnings in the Problems panel and on the diagrams (#574)

The pre-release channel is at 0.21.0.

@joyautomation/nautilus-hmi 0.9.0 adds mimic equipment that resizes to width × height, ports anchored to parts, and ISA-101 and realistic looks. Breaking: <Tank> is a plain vessel; tempC and heaterPct are gone, and the coil is its own <Heater>. @joyautomation/nautilus-hmi-3d 0.3.1 reads the kind files the editor writes. (#415, #466)