Repository navigation
v0.20.0
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 checkandnaut run:- an unclosed
(*comment - a POU with no
END_PROGRAM - two operands in a row:
s := a b;used to run ass := a;followed byb; - 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 unclosed
-
An
outputwith noinit:that its program reads before writing is anaut checkerror. Such a read faulted withundefined tagat 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 addinit:. If the read only comes first when a WHILE or a FOR runs zero times, it is a warning instead.naut runis unchanged. (#568) -
An input or output whose driver binding differs only in case is a
naut checkerror. One example is a tagm1_kwagainst a bindingM1_KW. Such a tag never received the driver's value, or never reached the device, and nothing said so.naut runstill starts. (#547) -
Tags a FUNCTION reaches through
VAR_EXTERNALare 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 : INTagainstMode : REAL) now fails to load. Before, the later declaration silently replaced the earlier one. A FUNCTION that reads an undeclared tag is now anaut checkerror. (#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 RETAINglobal that the manifest declares as aninputoroutputnow fails to load ("never retained"). The same applies toretain: trueon an input or output. (#494) -
sparkplug.writablepatterns read[as an array index.[n]matches that index and[*]matches any index. Character classes are gone:- Any other
[(for exampleFill[VW]alve) now failsnaut checkand stopsnaut run. - A pattern like
Pump[12]now names an array element, which a command never writes, andnaut checkwarns. (#577)
- Any other
-
A Modbus source
host:that carries a port is refused.host: 10.0.0.5:5020used to be dialed as10.0.0.5:5020:502and never connected. It is now a load error asking forport:.naut modbus importsplits the address for you. (#473) -
New warnings, same exit code.
naut checknow 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:
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 readsinit:, or the zero of its type, with qualityNotConnecteduntil the first real value arrives. Check the driver's__Onlinetag instead of relying on the fault:- A tag that nothing gives a type stays unseeded, and
naut checkwarns about it. - The
plcnext,optommp,replayandmemorydrivers keep the loud fault. - The
eipdriver gets aneip__Onlinecompanion, and its read no longer errors while the controller is down. Before, in adrivers:set, that error starved every other driver. - Fault transitions are now logged once each way per task. (#458, #459)
- A tag that nothing gives a type stays unseeded, and
- A STRUCT member's
:=initial value is now used. Before, every member started at zero. This applied to a manifest tag of the type withoutinit:, aVARof the type, aVAR_TEMPreset and an FB's internals. A manifestinit:still overrides member by member. (#461) VAR RETAINnow keeps its value. In 0.19, RETAIN was accepted and did nothing. With aretain:section, every program'sVAR RETAINvariables and every libraryVAR_GLOBAL RETAINglobal 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 Modbusrewrite: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)
- Without
HTTP API
-
Writes and forces are checked against the declared type.
POST /api/tagseither 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
memorydriver, usePOST /api/forces.POST /api/forcesapplies 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.writablesays. - 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.writableis 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) - 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
-
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
__Onlinefalse at once and counts one__Outageseach. 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>__Onlinemeans 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 withoutrewrite: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__Onlinealready 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 runnow 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
optommpdriver 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, andonlinefalls 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.
- With
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 withnaut opcua trust, or point it at None. - On first start, the server creates its certificate store in
./pki(set it withopcua.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-urioverrides 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)
- 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 (
Added
- OPC UA server writes (preview).
opcua.writableopens 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-serverrow counts writes and refusals. - Certificates:
naut opcua certslists the store andnaut opcua trust <thumbprint>approves a client. - Labs: for a lab without certificates,
opcua.anonymous-writes: truelets anonymous clients on the None endpoint write whatwritableopens.naut checkand every start warn about it.examples/plclabdrives 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|tagswrites 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)
- It resolves namespace URIs at connect, reconnects on its own, and delivers
- 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: trueon astatetag,VAR_GLOBAL RETAINin a library andVAR RETAINin 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: - Diagram structure warnings in
naut checkand the editor, with a stable rule ID and a "write instead" message for each. A newcheck:manifest section sets thresholds and disables rules. The reference page is/reference/structure-warnings/. (#574) naut newwrites anAGENTS.md(imported byCLAUDE.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: falsesends no rebirth request of any kind. A passive host with it can run on a read-only broker account. A passive host's__Rebirthbutton now works. (#575) - PLCnext:
ch:Nandnaut plcnext import.ch:Nis the channel number printed on the module, so you no longer work outbit:((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 importandnaut optommp importnow write atype:for every tag, so a program can read an imported tag without aVAR_EXTERNAL.naut eip importwrites theeip__Onlinecompanion. (#459, #519) naut new my-plant --template minimalwrites the project without prompting. (#519)- A stale HMI is called out.
naut run,naut buildandnaut checkprint a line whenserver.hmiis older than a mimic, a scene or the HMI's own source. (#466) - Docs:
Changed
naut runon 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 rungives 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 testshows TIME values as literals (Delay = T#2m, want T#1m30s).given:,force:andexpect: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)
CloseSessionhonoursdeleteSubscriptions, and subscription ids are never reused. (#422, #432, #445)- A
Disableditem's queued value is dropped. (#445) ModifySubscriptionand the five previously unsupported services work. (#431, #433, #481, #524)
- A never-delivered local-I/O input is a node from the start, reading
- 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)
- An empty String is served as
- 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
retryminwith 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:
- 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
__WatchdogTripsor__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 taglogic 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+eponce per binary;rt/plcnext-io/README.mdhas the recipe.
- Every naut start on the PLCnext logs one
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
.sveltefile (#409) - mimic resizing, looks and part-anchored ports (#466)
- diagram export and print to PDF or SVG (#557)
nauton 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)