ECMC PLCs provide deterministic real-time logic in the ecmc cycle for:
${SCRIPTEXEC} ${ecmccfg_DIR}loadPLCFile.cmd, "FILE=<filename>, INC=<include_dirs>, SAMPLE_RATE_MS=<rate_ms>, PLC_MACROS='<custom_macros>'"
${SCRIPTEXEC} ${ECMC_CONFIG_ROOT}loadYamlPlc.cmd, "FILE=./plc.yaml, ECMC_TMPDIR=/tmp/"
YAML PLC loading supports both parser backends:
jinja (default, Python-based)ecb (C++ backend via ECMC_CFG_TOOL=ecb, see ecb)loadPLCLib.cmd, function signatures, and constraints.ecmccfg supports three styles:
All keys are mandatory:
id: unique PLC id (uint)enable: start enabled/disabledrateMilliseconds: execution rate in ms (-1 means every cycle)code: list of PLC code linesplc:
id: 1
enable: no
rateMilliseconds: 10
code:
- 'ec0.s2.binaryOutput07:=global.test|'
- '${PLC_ID}.enable:=plc0.enable|'
- 'ec0.s2.binaryOutput05:=not(ec0.s2.binaryOutput05)|'
Use file: to keep large PLC logic in text files:
plc:
id: 1
enable: yes
rateMilliseconds: 10
file: plc1.plc
If file is set, entries in code are overwritten.
YAML is indentation-sensitive.
Use 2-space indentation.
PLC statement line terminator remains | in YAML-based code lines.