Skip to content

Exchange data types and global variables as PLCopen XML

eaxPLCHow-to guideFreeProView as Markdown

You move data types and global variables between eaxPLC and another IEC 61131-3 engineering tool, or between two eaxPLC projects, as PLCopen XML (TC6 XML 2.01, the IEC 61131-10 exchange format).

Travels Not yet
Data types: structures, enumerations (values and base type), subranges, arrays, alias types; unions between eaxPLC projects Programs, function blocks and functions: their bodies follow in a later release
Global variable lists: CONSTANT and RETAIN lists, initial values, addresses Tasks and program instances
Documentation (description; unit, display format and notes between eaxPLC projects)
The enforced attributes access, write_range, was (between eaxPLC projects) The project compile settings

TC6 has no place for our attributes, for unit, display format and notes, or for unions. eaxPLC writes them as addData in its own namespaces: another tool ignores them, and an eaxPLC import reads them back, so an eaxPLC-to-eaxPLC round trip keeps everything byte for byte.

  1. Click Tags, then PLCopen export (at narrow widths: More (⋯) → PLCopen export).
  2. In Export, keep Every data type and global variable list, or pick one of them. The dialog lists the programs, function blocks and functions it does not export in this version, greyed.
  3. Click Export. You need the engineer role: the file holds the source of your declarations.

The file holds the current revision’s data type and global variable list POUs with their documentation. The same revision always exports to the same bytes. Array bounds written with constants (ARRAY[1..NumRecipes]) are exported with their numbers, with the constant kept as extra data so an eaxPLC import restores it.

  1. Click PLCopen import, choose the .xml file, click Preview.
  2. The preview lists every data type and list the file holds, as Add (a new POU), Change (a POU of that name and kind whose text or documentation differs), Same, Error or Needs lock, followed by everything Skipped, each with its reason.
  3. Fix errors in the file and preview again.
  4. Click Apply N changes. When items need POUs you have not checked out, the Studio offers Check out and apply. All or nothing: refused while any item is an error (409, the clashes listed) or needs a lock you do not hold (423).

Apply creates each new data type or list as a POU checked out by you, writes changed ones to your drafts, and saves the documentation. It never saves an existing POU’s text and never deploys: save the POUs, then Test edits or Build & Deploy.

Nothing is dropped silently: every part the import does not take is listed under Skipped.

Skipped Reason given Why
A POU of any kind … POUs are not imported yet: this version imports data types and global variables only POU bodies come in a later release.
A POU in LD, FBD, SFC or IL … with a body in X: only ST bodies will be importable Only Structured Text bodies are planned.
Tasks and program instances tasks and program instances are not imported (the task configuration stays as it is) Tasks are configured in the Studio.
A default value on a data type a default value on a data type is not supported: the data type is imported without it Give the variables initial values instead.
Attributes on a data type attributes on a data type are not imported (they go on its members) Access and ranges are per variable or member.
A structure initial value structure initial values are not supported (set the members in the program)
A type eaxPLC lacks (pointers, references, …) type <X> is not supported by eaxPLC A data type with such a member is not imported at all: its layout would change.
A PERSISTENT list PERSISTENT is not supported: the list is imported as RETAIN (kept across deploys and online edits, not across a power cycle) There is no persistent retain yet.
Another tool’s extra data data of another tool: not imported
A name used twice in the document the name is already used by another data type or list of this document

An item is an Error (not applied) when its name is a POU of another kind in the project, or a global it declares is already declared by another list.

  • At most 16 MB, 64 levels of nesting and 400,000 elements.
  • A <!DOCTYPE (or any other directive) is refused.
  • Every name must be an identifier that is not a keyword.
  • Every value is re-read by the PLC’s compiler and must print back to itself, so nothing can escape its declaration.
  • A document that holds a {project ...} pragma is refused: compile settings are never imported. Set them on the project instead (Set the project compile settings).