Mari
I'm taking the first steps in the "OpenPLC Editor".
Please tell me according to which standard (Year) IEC 61131-3 the project is compiled in "OpenPLC Editor v.4.06".
If by 2013 year, then the question is. How can I update the compilation to the new standard: 2022-2025?
Thank you for your help.
Reply 0 0
thiagoralves
OpenPLC uses MatIEC compiler, which is based on IEC 61131-3 v2. To update it to any other standard version, MatIEC source code needs to be changed.
Reply 0 0
Mari
OpenPLC uses MatIEC compiler, which is based on IEC 61131-3 v2. To update it to any other standard version, MatIEC source code needs to be changed.
Can you tell me how to update the MatIEC source code (up to IEC 61131-3 v3 or v4)?
Reply 0 0
thiagoralves
Can you tell me how to update the MatIEC source code (up to IEC 61131-3 v3 or v4)?
Sure!
  1. Clone the official MatIEC repository from here: https://github.com/beremiz/matiec
  2. Get familiarized with compiler theory (lexing, parsing, semantic analysis, ASTs, and code generation).
  3. Get familiarized with Flex/Bison (docs here: https://www.gnu.org/software/bison/manual/bison.html
  4. Study the IEC 61131-3 v3 and v4 changes. Identify syntax, semantics, and type system differences. Give special attention to classes, interfaces, methods and inheritance that were added in v3 and v4.
  5. Extend the grammar and parser in absyntax.def, iec_bison.yy, and iec_flex.ll. Modify other relevant files as consequence of the changes in these files.
  6. Revise code generation (stage 3 and 4) to output equivalent C structures for new elements (e.g., object methods as struct function pointers).
  7. Add conformance and regression tests to validate the new behavior.
Reply 0 0
Reply