agentleFS
SmailGSmailG/plc-programming/skills/schneider/SKILL.md

schneider

Skill0 starsChanged 37 days agoMITView on GitHub

Schneider Electric PLC programming: EcoStruxure Machine Expert (CODESYS-based; Modicon M241/M251/M262 logic and motion; V2.5/V2.6 platform changes), EcoStruxure Control Expert 16.x (ex-Unity Pro; M340/M580 incl. HSBY and Safety; MAST/FAST/AUX, DFB/DDT, %MW/%S/%SW), Machine Expert – Basic (M221) and Automation Expert (IEC 61499). Covers tasks and watchdogs, retain/persistent behaviour on download, online change, OPC UA server/client and Symbol Configuration, Modbus TCP/RTU (READ_VAR/WRITE_VAR, ADDM, unit IDs, 4x↔%MW), EtherNet/IP, MQTT, TCP/UDP, PLC_R diagnostics, cybersecurity defaults and exchange files (XEF/XSY/PLCopenXML). Use whenever the target is a Schneider/Modicon controller or Machine Expert/Control Expert/SoMachine/Unity Pro is mentioned.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After Build › Clean no online change is possible.

    line 54
  2. Distinctive:

    One writer task per variable, and one task per I/O: Use handshake flags between tasks.

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Schneider Electric: Machine Expert, Control Expert, Automation Expert

Which tool and dialect (as of 2026-09)

ControllerToolDialectExchange
M241 / M251 / M262EcoStruxure Machine Expert. V2.3 uses CODESYS 3.5.20 and V2.5 uses 3.5.21; release notes exist for V2.6 (2026-04-30), but its CODESYS base is unverifiedCODESYS IL/ST/FBD/SFC/LD/CFC with OOP, plus Schneider librariesPLCopenXML (tc6_0200); file-based storage from V2.5
M340 / M580 (plus Quantum, Premium, Momentum)EcoStruxure Control Expert 16.4 (manuals dated 07/2026)IEC LD/FBD/ST/SFC/IL, plus LL984; DFB/DDT; located %M/%MWXEF/ZEF/XSY and section files
M221Machine Expert – Basic 1.4Ladder / IL / Grafcet.smbp
distributedEcoStruxure Automation Expert (IEC 61499, CATs)61499 + STsee the iec-61499 skill

Ask which tool and version the user runs. "Schneider PLC" alone is ambiguous: the two main worlds have different languages, memory models and file formats. For Machine Expert, also ask about the licence, because the Free licence has no online change, simulation or breakpoints.

M262 / Machine Expert: the traps that cost the most

  1. Only PERSISTENT survives a download from ME. VAR and RETAIN are re-initialised. PERSISTENT values are also lost on an SD-card download or reset origin, and when a persistent variable is renamed or retyped.
  2. The M262 does not retain %MW implicitly, unlike older M2xx controllers. Use VAR_GLOBAL RETAIN … AT %MWn.
  3. The OPC UA server restarts on every download, online change and reset, so clients must reconnect and resubscribe.
  4. Symbol Configuration changes reach the controller only with the next download. %MX/%IX/%QX bits cannot be exposed. A GVL appears only if one of its variables is used in code. The default access is read-only, the limit is 10 000 variables, and there are at most 2 sessions by default.
  5. Anonymous OPC UA login is refused by default. User rights are on, the policy is Basic256Sha256 with SignAndEncrypt, and the PKI in /usr/pki is shared by the server and the client.
  6. There are no default credentials. The first ME connection must create an administrator. Modbus TCP 502 is disabled by default.
  7. A task watchdog means HALT (PLC_R.i_wLastApplicationError = 16#0010). Watchdogs are off in simulation. A system watchdog reboots to EMPTY.
  8. Task priorities must be unique (0–31). Outputs in one byte written from two tasks fail the build. Referencing a PROPERTY in an event task causes a watchdog exception.
  9. Online change: pointers keep their old values, so reassign them every cycle. After Build › Clean no online change is possible. Only one ME instance can log in.
  10. ME V2.5 dropped ME-Safety, SVN and Vijeo-Designer. An M262 with embedded safety cannot move to V2.5.
  11. Schneider communication FBs (Modbus, TCP/UDP, MQTT, OPC UA client) must keep being called while active. Errors clear only by disabling the FB. The TCP/UDP methods block until ResetResult is called.

Control Expert (M340/M580): the traps that cost the most

  1. A watchdog overflow means HALT, which STOP cannot clear; the application must be re-initialised. A period overrun only sets %S19.
  2. %S15, %S18 and %S20 (string error, arithmetic error or ÷ 0, index overflow) are per task, and the application must reset them. %S78 turns them into a HALT.
  3. Unlocated variables are re-initialised on download. Give a variable a located address to keep it across an application transfer.
  4. The M340 has no AUX tasks and no %MD/%MF/%KD/%KF. M580 HSBY runs MAST + FAST only.
  5. Use %S21 (first cycle of the task) or %SW10.0, not %S0, to detect the first scan.
  6. READ_VAR/WRITE_VAR: respect the activity bit, set the timeout in 100 ms units, and make the EF timeout longer than the configured timeout × retries.
  7. One writer task per variable, and one task per I/O. Use handshake flags between tasks.

References

  • references/machine-expert-platform.md: versions and the V2.5 changes, licences, M262 hardware, tasks and watchdogs, the remanence table, the %MW map and Relocation Table, online change, debugging, static analysis, cybersecurity.
  • references/machine-expert-communication.md: the OPC UA server (parameters, Symbol Configuration, certificates, diagnostic IDs) and client, the Modbus server/Slave Device/client (READ_VAR, ADDM, CommError), EtherNet/IP, TCP/UDP, MQTT, CANopen.
  • references/machine-expert-diagnostics.md: PLC_R/PLC_W, error classes and logs, a table of typical M262 faults, safety (TM5CSLC / M580 Safety), motion (PLCO / GMC).
  • references/control-expert.md: Control Expert tasks, data, DFB/DDT/IODDT, the %S/%SW tables, debugging, the READ_VAR management table, ADDM, HSBY.
  • references/modbus.md: the protocol-level data model, addressing (40001 = PDU 0), function codes and limits, exceptions, Unit ID, serial timing, word order.
  • references/exchange-files.md: Machine Expert PLCopenXML limits, Control Expert XEF/ZEF/XSY with a skeleton, Machine Expert – Basic.

Language syntax, pragmas and Static Analysis for Machine Expert are the CODESYS ones: ../other-platforms/references/codesys.md. Validate XEF/XSY and PLCopenXML with python3 ${CLAUDE_PLUGIN_ROOT}/scripts/plc_validate.py (rules CX0xx and PX0xx).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.