Import Guidelines from other third party IDEs

From Axel Public Wiki
(Redirected from Import Codesys Guidelines)
Jump to navigation Jump to search

As part of the PLCOpen organization, Axel provides PLCOpenXML features to import/export PLC source codes from/to other third party IDEs.

However, since there are 3 different levels of certification to the standard IEC-61131-3 (see all Logic certified products), there are also different levels of compliance to the standard itself.

For this reason, in some cases things are made differently among different environments and the PLCOpenXML features cannot solve these gaps.

The aim of this page is to help the software developer to write a PLC sorce code and do the proper manual substitutions, in case the PLCOpenXML features could not translate correctly from an IDE to the other.

You can also find at this page the table of all IEC-61131-3 topics currently not supported by LogicLab.

IEC-61131-3 non-conformities of other third party IDEs

# Codesys Comments and LogicLab behavior
1a Possibility to omit a succeeding semicolon “;” to the following constructs:
  • END_IF
  • END_FOR
  • END_WHILE
  • END_CASE
  • END_REPEAT
⚪ The standard IEC-61131-3 says that the succeeding semicolon “;” is mandatory.
✅ LogicLab automatically adds all the succeeding semicolons “;” to the listed constructs, when the source code is imported.
1b Usage of a point “.” character as separator for enum values.
For instance: enumVar.enumField
⚪ The standard IEC-61131-3 says that only a sharp “#” character can be used as separator for enum values (for instance: enumVar#enumField).
❌ LogicLab does NOT support the point as separator for enum values.
1c Enum values cannot be written alone, without the leading enumerative type name.
For example:
  • enumType.enumValue
  • enumType#enumValue
⚪ The standard IEC-61131-3 allows to write enum values in both the following ways:
  • enumType#enumValue
  • enumValue
✅ LogicLab supports both the syntaxes, when the source code is imported.
1d Possibility to define nested arrays:
nestArr : ARRAY[0..N] OF ARRAY[0..M]…OF INT;
⚪ The standard IEC-61131-3 does not allow nested arrays. Only multidimensional arrays are allowed.
❌ LogicLab does NOT support nested arrays.
1e Nested arrays are accessed with the following syntax:
nestArr[3][4]…[1];
⚪ The standard IEC-61131-3 does not allow nested arrays.
❌ LogicLab does NOT support nested arrays.
1f Reference declaration is possible only by using a REFERENCE TO keyword. For instance:
ref1 : REFERENCE TO INT;
⚪ The standard IEC-61131-3 says that references shall be declared with the keyword REF_TO. For instance:
ref1 := REF_TO INT;
✅ LogicLab automatically substitutes all the "REFERENCE TO" occurrences with "REF_TO", when the source code is imported.
1g Reference initialization is possible only by using a REF= construct. For instance:
ref1 REF= int1 means that ref1 is a reference to int1
⚪ The standard IEC-61131-3 says that references shall be initialized with the operator REF. For instance:
ref1 := REF(int1);
✅ LogicLab automatically substitutes all the "REF=" occurrences with the "REF" operator, when the source code is imported.
1h Dereferencing a reference is possible without a succeeding ^ character. For instance:
x := ref1; means that the value contained into the variable referenced by ref1 is assigned to x.
⚪ The standard IEC-61131-3 says that references shall be dereferenced only by using a succeeding ^ character. For instance:
x := ref1^;
❌ LogicLab does NOT support dereferentiation without a succeeding ^ character. This means that all dereferentiations must be modified manually when the source code is imported.
1i Strings may be declared with a size enclosed by round brackets. For instance
str : STRING(32);
⚪ The standard IEC-61131-3 says that strings shall be declared with square brackets. For instance:
str : STRING[32];
✅ LogicLab automatically substitutes round brackets with square brackets for all strings, when the source code is imported.
1l Methods can be called without a THIS specifier within the owning function block ⚪ The standard IEC-61131-3 says that the THIS specifier is mandatory. ❌ LogicLab does NOT support a method call inside the owning function block without a preceding THIS.

IEC-61131-3 extensions of other third party IDEs

# Codesys Comments and LogicLab behavior
2a Pointers to arrays ⏳ Soon in LogicLab
2b Pointers are implemented using the character ^ ✅ LogicLab implements pointers by using the character @. When a source code is imported, LogicLab automatically do the proper substitutions.
2c Generic types __XWORD, __UXINT depending on the architecture (32/64 bits) ✅ A possible workaround is to declare typedefs in LogicLab. PVOID type is also available.