Danfoss PLUS+1 controllers: custom C SAST, PLCopen XML control logic, component list from a manifest #976

Open
opened 2026-11-11 20:25:17 +00:00 by sharang · 1 comment
Owner

A prospective customer builds mobile machinery controllers with Danfoss PLUS+1. Prüfwerk reads nothing PLUS+1-specific today. This issue collects what we can support and the open questions. It waits on a sample project.

What PLUS+1 work looks like

From Danfoss release notes and the tool certificate; not yet checked against a real project:

  • Applications are drawn in PLUS+1 GUIDE. The project file is .p1x; Danfoss publishes no spec for it.
  • GUIDE translates the graphical code to C and builds it with an external C compiler. Developers can add their own C code.
  • The controller gets a .p1d download file. GUIDE 12.2 can compare two P1D files from the command line.
  • Every controller model has a hardware description file (HWD) with its own version.
  • GUIDE 7.2.9 lists "updated support for PLCopenXML file format". It doesn't say whether that is import or export.
  • Danfoss's IEC 61508 certificate covers graphical and GUIDE-generated C code, "but not … externally developed C-code".

Routes

  1. Custom C code, available today. The customer's own C code goes through the C/C++ SAST (cppcheck, our CRA C rules) when the source files come with the upload or repo. To check against the sample:

    • that the file layout of a GUIDE project with C blocks is detected as C, and not as a PLC project without an export;
    • that Danfoss's headers and the generated C are excluded as vendor code (the same treatment as vendor folders);
    • whether the compiler dialect parses.
  2. Control logic via PLCopen XML, if GUIDE exports it. In that case the existing PLC control-logic SAST (ST plus FBD/LD) runs on the export. Rules to review for mobile machinery: the Ethernet port rules (Modbus 502, Telnet, FTP) don't fit CAN/J1939 machines; CAN/J1939 checks may be worth adding.

  3. Component list (SBOM) from a manifest, to build. A short text or CSV manifest next to the project lists:

    • the GUIDE version;
    • the HWD per controller, with its version;
    • the function-block libraries, with versions;
    • the C compiler and its version.

    This avoids parsing the binary .p1x. Components become pkg:generic/danfoss/... (purl type to decide). CVE hits will be rare, but the CRA needs the component list either way.

  4. Danfoss advisories. Danfoss publishes advisories at danfoss.com (DSA-YYYY-MM-NN), and CISA re-publishes some as CSAF (e.g. ICSA-25-140-03, AK-SM 8xxA). Add Danfoss to the CSAF feed (csaf_feed.rs) through the CISA CSAF repository. No PLUS+1 advisory has been found so far.

Out of scope

  • Parsing .p1x / .p1d directly: the same rule as for the binary CODESYS .project.
  • Firmware analysis and live tests of the controllers.

Open questions for the customer

  • Which GUIDE version do they use?
  • Do they write custom C blocks?
  • Does their GUIDE offer a PLCopen XML export?
  • Can they give us one sample project, with the C sources and, if available, the PLCopen XML export?

Sources

A prospective customer builds mobile machinery controllers with **Danfoss PLUS+1**. Prüfwerk reads nothing PLUS+1-specific today. This issue collects what we can support and the open questions. It waits on a sample project. ## What PLUS+1 work looks like From Danfoss release notes and the tool certificate; not yet checked against a real project: - Applications are drawn in **PLUS+1 GUIDE**. The project file is `.p1x`; Danfoss publishes no spec for it. - GUIDE translates the graphical code to C and builds it with an external C compiler. Developers can add their own C code. - The controller gets a `.p1d` download file. GUIDE 12.2 can compare two P1D files from the command line. - Every controller model has a hardware description file (**HWD**) with its own version. - GUIDE 7.2.9 lists "updated support for PLCopenXML file format". It doesn't say whether that is import or export. - Danfoss's IEC 61508 certificate covers graphical and GUIDE-generated C code, "but not … externally developed C-code". ## Routes 1. **Custom C code, available today.** The customer's own C code goes through the C/C++ SAST (cppcheck, our CRA C rules) when the source files come with the upload or repo. To check against the sample: - that the file layout of a GUIDE project with C blocks is detected as C, and not as a PLC project without an export; - that Danfoss's headers and the generated C are excluded as vendor code (the same treatment as vendor folders); - whether the compiler dialect parses. 2. **Control logic via PLCopen XML, if GUIDE exports it.** In that case the existing PLC control-logic SAST (ST plus FBD/LD) runs on the export. Rules to review for mobile machinery: the Ethernet port rules (Modbus 502, Telnet, FTP) don't fit CAN/J1939 machines; CAN/J1939 checks may be worth adding. 3. **Component list (SBOM) from a manifest, to build.** A short text or CSV manifest next to the project lists: - the GUIDE version; - the HWD per controller, with its version; - the function-block libraries, with versions; - the C compiler and its version. This avoids parsing the binary `.p1x`. Components become `pkg:generic/danfoss/...` (purl type to decide). CVE hits will be rare, but the CRA needs the component list either way. 4. **Danfoss advisories.** Danfoss publishes advisories at danfoss.com (DSA-YYYY-MM-NN), and CISA re-publishes some as CSAF (e.g. ICSA-25-140-03, AK-SM 8xxA). Add Danfoss to the CSAF feed (`csaf_feed.rs`) through the CISA CSAF repository. No PLUS+1 advisory has been found so far. ## Out of scope - Parsing `.p1x` / `.p1d` directly: the same rule as for the binary CODESYS `.project`. - Firmware analysis and live tests of the controllers. ## Open questions for the customer - Which GUIDE version do they use? - Do they write custom C blocks? - Does their GUIDE offer a PLCopen XML export? - Can they give us one sample project, with the C sources and, if available, the PLCopen XML export? ## Sources - GUIDE ReadMe 7.2.9 (P1D on compile, PLCopenXML, project format 005C): https://files.danfoss.com/download/PowerSolutions/Product%20Archive/PLUS1%20GUIDE%20history%20files/Version%207.2.9/GUIDE%20ReadMe%20v7.2.9.pdf - GUIDE ReadMe 9.0.8 (P1X format): https://files.danfoss.com/download/PowerSolutions/Product%20Archive/PLUS1%20GUIDE%20history%20files/Version%209.0.8/GUIDE%20ReadMe%209.0.8.pdf - GUIDE ReadMe 12.2.8 (P1D compare via CLI): https://files.danfoss.com/download/PowerSolutions/Software/Software%20Development%20Tools/PLUS1%20GUIDE/GUIDE_ReadMe_12.2.8.pdf - IEC 61508 certificate, development tools 10.0.x: https://files.danfoss.com/download/PowerSolutions/Software/Software%20Development%20Tools/PLUS1%20GUIDE/PLUS2B1_Development_tools_IEC_61508-2010_certificate_of_version_10.0.x.pdf - Danfoss security advisories: https://www.danfoss.com/en/service-and-support/coordinated-vulnerability-disclosure/danfoss-security-advisories/
Author
Owner

Public GUIDE projects found

Two public repositories on GitHub hold real GUIDE projects. Neither has a licence, so they are for format research only and can't be committed as fixtures:

  • i2t-repo/BattBox_DM430: GUIDE 2023.1.4, a DM430E display, the full project with build output.
  • robertoricotti/stonex_mc: three .p1x files from GUIDE 2025.1.2 (MC024-130 controllers) inside an Android app.

What the project is made of

The format is much more open than the release notes suggested.

File Format What it holds
.p1x XML, ISO-8859-1, about 1 KB The project manifest: GUIVersion; per programmable hardware PartNumber, HwdName, HwdVersion and the system file (70298408v170.sys, the controller OS); the main module; the referenced PLCopenXML file; the output hex file
.scs (main module) binary ("GM Data Service Sweden ... BinStream", compressed) The graphical top-level logic
.ssd (screens/submodules) XML Display screens with their buses and nets (inputs and outputs, data types)
PLCFile1.xml PLCopen XML tc6_0201, productName="PLUS+1 GUIDE" IEC 61131-3 ST POUs (functions) written inside GUIDE
*.c, *.h C, generated by GUIDE ([ProjectToC], [ChParGU2], [TDSToC]) The whole application as C, when the build output is in the repo
MKFILE*.MAK make The toolchain: GCC ARM arm-none-eabi 5.4.1 (v5.4-2016q3) bundled with GUIDE
ProjectParameters.json, DebugSettings.xml, DynamicNVData.xml JSON/XML Parameters, debug and non-volatile data settings

What this changes in the routes

  • Component list (route 3), without a manifest. The .p1x already names the GUIDE version, each controller's HWD with its version and the system (OS) file with its version. The makefile names the compiler. A small XML parser covers it, much like the CODESYS .projectarchive libraries.

  • Control logic (route 2), works today. GUIDE writes its ST blocks as PLCopen XML tc6_0201 itself. Our PLC parser should read that as it is; still to check against the sample. The graphical main logic (.scs) stays binary and out of scope.

  • C (route 1). Besides custom C, GUIDE-generated C is in the repo whenever the build output is committed. It needs a decision:

    • scanned, because it is the real application code;
    • or excluded as generated, because findings in it can't be fixed in the C, only in GUIDE.

    Its /*Danfoss PLUS+1 GUIDE Software: [...]*/ banner makes it easy to detect either way.

  • Detection. A .p1x next to the code should mark the target as a PLC project, like a .projectarchive.

  • A candidate rule. The .p1x can carry a <ToolKey Parameters="LOGKEY:..."> in clear text. The sample also repeats it in its README. If that key protects the controller's log or service access, a committed key is a hardcoded-credential finding (CWE-798). Danfoss's docs need to confirm what it protects.

## Public GUIDE projects found Two public repositories on GitHub hold real GUIDE projects. Neither has a licence, so they are for format research only and can't be committed as fixtures: - `i2t-repo/BattBox_DM430`: GUIDE 2023.1.4, a DM430E display, the full project with build output. - `robertoricotti/stonex_mc`: three `.p1x` files from GUIDE 2025.1.2 (MC024-130 controllers) inside an Android app. ## What the project is made of The format is much more open than the release notes suggested. | File | Format | What it holds | |---|---|---| | `.p1x` | **XML**, ISO-8859-1, about 1 KB | The project manifest: `GUIVersion`; per programmable hardware `PartNumber`, `HwdName`, `HwdVersion` and the system file (`70298408v170.sys`, the controller OS); the main module; the referenced `PLCopenXML` file; the output hex file | | `.scs` (main module) | binary ("GM Data Service Sweden ... BinStream", compressed) | The graphical top-level logic | | `.ssd` (screens/submodules) | XML | Display screens with their buses and nets (inputs and outputs, data types) | | `PLCFile1.xml` | **PLCopen XML tc6_0201**, `productName="PLUS+1 GUIDE"` | IEC 61131-3 **ST** POUs (functions) written inside GUIDE | | `*.c`, `*.h` | C, generated by GUIDE (`[ProjectToC]`, `[ChParGU2]`, `[TDSToC]`) | The whole application as C, when the build output is in the repo | | `MKFILE*.MAK` | make | The toolchain: GCC ARM `arm-none-eabi` 5.4.1 (`v5.4-2016q3`) bundled with GUIDE | | `ProjectParameters.json`, `DebugSettings.xml`, `DynamicNVData.xml` | JSON/XML | Parameters, debug and non-volatile data settings | ## What this changes in the routes - **Component list (route 3), without a manifest.** The `.p1x` already names the GUIDE version, each controller's HWD with its version and the system (OS) file with its version. The makefile names the compiler. A small XML parser covers it, much like the CODESYS `.projectarchive` libraries. - **Control logic (route 2), works today.** GUIDE writes its ST blocks as PLCopen XML tc6_0201 itself. Our PLC parser should read that as it is; still to check against the sample. The graphical main logic (`.scs`) stays binary and out of scope. - **C (route 1).** Besides custom C, GUIDE-generated C is in the repo whenever the build output is committed. It needs a decision: - scanned, because it is the real application code; - or excluded as generated, because findings in it can't be fixed in the C, only in GUIDE. Its `/*Danfoss PLUS+1 GUIDE Software: [...]*/` banner makes it easy to detect either way. - **Detection.** A `.p1x` next to the code should mark the target as a PLC project, like a `.projectarchive`. - **A candidate rule.** The `.p1x` can carry a `<ToolKey Parameters="LOGKEY:...">` in clear text. The sample also repeats it in its README. If that key protects the controller's log or service access, a committed key is a hardcoded-credential finding (CWE-798). Danfoss's docs need to confirm what it protects.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#976