Skip to content

v0.16.0 — Logix projects in as nautilus source

Choose a tag to compare

@github-actions github-actions released this 13 Oct 04:29
· 1378 commits to main since this release
9d14cbb

Logix projects in, as nautilus source, and the language catches up to IEC 61131-3

The headline is naut logix import --project: it takes an L5X export of a Studio 5000 project and writes a whole nautilus project from it, with no Rockwell software on the machine. Around it, the language gets most of the IEC 61131-3 it was missing (case-insensitive names, enumerations, the full conversion matrix, a force table, SFC timed qualifiers), and the language server gains signature help, the Outline and Find All References.

Logix: export → text → nautilus project

  • naut logix import --project <dir> <file.L5X> writes a project: the manifest with target: logix filled in from the controller, the tags with their descriptions, UDTs as IEC types, every ladder routine as a PROGRAM in ladder source (rung comments and initial values included), and Add-On Instructions as FUNCTION_BLOCKs in lib/. A rung with no nautilus form is kept as a comment and counted under not carried; it is never guessed at. --programs picks which programs come in, and --comm-path / --host say how to reach the controller. On the generic DemoLine fixture:
    $ naut logix import --project demoline DemoLine.L5X
    wrote demoline/MainProgram.ld
    wrote demoline/nautilus.yaml
    wrote demoline/tags/logix.yaml
    1 ladder routine, 1 complete; 2 rungs, 2 carried
    
    The MainProgram.ld it writes:
    PROGRAM MainProgram
    VAR
        StartPB    : BOOL; (* P-101 start pushbutton, field-wired NO *)
        ...
        HiLevelSP  : REAL := 85.0; (* LAH-101 high-level alarm setpoint *)
    END_VAR
    LD
      RUNG r0 (* P-101 pump seal-in: Start latches the run command, Stop drops it out *)
        [ StartPB | RunCmd ] /StopPB ( RunCmd )
      RUNG r1 (* LAH-101 high-level alarm when tank level is at or above the setpoint *)
        GE(LevelPct, HiLevelSP) ( HiLevelAlm )
    END_LD
    END_PROGRAM
    
  • The whole path is in one guide. guides/logix goes naut logix convert (ACD → L5X through logixd), then import --project, then naut logix serve with live values in the editor. Each step names the release it needs.
  • logixd is built from source on the licensed Windows machine: run tools\logixd\install.ps1 from a clone or from this release's Source code (zip). There is no binary because it links Rockwell's SDK client, which only the SDK install provides. naut finds it via --agent/--token or NAUTILUS_LOGIXD_URL/NAUTILUS_LOGIXD_TOKEN.
  • Authoring for Logix (experimental): write ladder or ST in nautilus and deploy it to a ControlLogix/CompactLogix controller, with Studio 5000 running headless behind logixd. This adds naut logix write, naut logix deploy (--online, --download --yes), naut logix mode, naut test --target logix, naut check --target logix, a target: logix manifest section, dialect: logix, and I/O as alias: tags. ST programs now get controller tags for the manifest tags they use (#251). naut logix drift --logic compares logic only. See Authoring for Logix. (#225)

Language (IEC 61131-3)

  • Identifiers are case-insensitive: variables, tags, POUs, types, FB pins, members, SFC steps. Names display as declared. (#241)
  • Enumerations: TYPE Mode : (Idle, Run := 10, Fault), Mode#Run, enum-typed tags, CASE on members. Live values show the member name, and writes take the name, including through member paths like Recipe.Steps[2].Mode. (#242, #247, #250)
  • The full conversion matrix: every <A>_TO_<B>, the overloaded TO_<type>(x) and TRUNC_<int>. Narrowing wraps to the target width as on Codesys, and a REAL or STRING with no value in the target faults the scan. (#244)
  • VAR_TEMP, REGION, VAR_GLOBAL CONSTANT project constants, CASE on named constants, partial access w.%X3/%B1/%W0, EN/ENO in ST and FBD, and parse errors that name the token they expected. (#242, #236)
  • Project model: manifest tags are in scope in every PROGRAM without VAR_EXTERNAL. type: takes any elementary type, UDT, enum or ARRAY. Codesys-style GVL files work, and a library's errors are reported once, at the library. (#243)
  • Force table: forces on inputs, outputs and struct members, plus Set Active Step and Fire Transition for SFC, and force:/unforce: steps in acceptance tests. (#234)
  • SFC: timed qualifiers L/D/SD/DS/SL, IEC textual associations, and step supervision with MAXTIME/ERROR. (#235)

Language server and editor

  • Signature help (#168), document symbols for the Outline, breadcrumbs and Go to Symbol (#172), and Find All References, including from the diagrams (#171, #237).
  • Ladder, FBD and SFC editor parity work (#232, #233, #236). It ships in the VS Code extension: pre-release 0.13.3 today, stable 0.14.0 to follow. Both need this CLI.

Also

  • oplog, a replicated log of operator intent agreed by a majority (library + /api/oplog, /api/quorum) (#158). Eight more operator-view UDTs in hw (#157). Sparkplug sends no DATA between a Rebirth NCMD and its NBIRTH (#166).
  • /verified/ proof pages on the docs site, built from the last green rig and CI runs (#161–#164).

Upgrading from 0.15

Run naut check after upgrading. These used to pass and now don't:

  • Names that differ only in case in one scope are now a duplicate declaration (a Running tag and a running local, say). Rename one. (#241)
  • A program local with a tag's name now shadows the tag, and naut check warns. A tag a program uses with neither type: nor a typed init: is an error; add type:. A VAR_EXTERNAL that disagrees with the tag's type: is an error. (#243)
  • #name (SCL's prefix) is rejected; write the bare name.
  • Conversions are typed to their target. REAL_TO_INT / TIME_TO_INT give a 16-bit INT, so REAL_TO_INT(40000.0) now faults the scan; use REAL_TO_DINT. REAL_TO_WORD and its kin are a compile error that names what to write. (#244)
  • A bit index past the type's width (w.16 on a WORD) is a compile error. (#222)
  • API clients: an enum value is its member name (a string) in /api/state and the stream, and /api/meta carries declared types. POST /api/tags to a forced tag returns 409. (#250, #234)

The VS Code extension that goes with this CLI is 0.13.3 on the pre-release channel, with stable 0.14.0 to follow. Install it from the Marketplace or Open VSX (joyauto.vscode-iec). The VSIX attached here is the same extension code, built at this tag before the version bump, so it reports itself as 0.13.2.