Differences compared with TwinCAT 2
Library versions
- Several versions of a library are possible in the same project. Unambiguous accesses are ensured by specifying the namespace.
- Installation in repositories (databases with libraries in various versions)
- Automatic updating
- Debugging possible
- Library profiles and placeholders facilitate version compatibility
Compatibility with projects in other file formats
- The command Add Existing Item … can be used to automatically convert projects with different formats to the TwinCAT 3 format. You can define how integrated libraries should be handled.
- A converter for the TwinCAT 2 format is part of the standard programming system. However, if you want to use a TwinCAT 2 project in TwinCAT 3, you have to take into account some prerequisites and restrictions.
Data types
The following data types are new:
- any_type
- UNION
- LTIME
- BIT
- References
- Enumerations: Base data type can be specified.
di : DINT := DINT#16#FFFFFFFF :
not permitted
Editors
ST editor:
- Bracketing, breaks, code completion, inline monitoring, inline set/reset assignment
FBD/LD/IL editor:
- FBD, LD and IL can be converted to each other and have a common editor.
- IL editor as table editor
- The main output in function blocks with multiple outputs can be set.
- Branches and “networks in networks”
SFC editor:
- Only one step type, macros, multiple selection of independent elements, no syntax check during editing
Visualization concept
- By default, the visualization editor cooperates with a toolbox and an editor for the element properties.
- Parts of the visualization functionality are implemented in accordance with IEC 61131 and are therefore made available through libraries. An internal runtime system performs the main visualization functions.
- Text lists and image pools are used for managing texts and image files.
- A visualization manager deals with different visualization clients (such as web client, standalone client...), which can be used flexibly and with little effort for a wide range of custom PLC projects.
- Visualization profiles define which library versions and which elements are currently available.
- Visualization styles facilitate adaptation of the “look and feel” of the visualizations.
Operators and variables
- New validity range operators, extended namespaces
- Init method replaces the INI operator
- Exit method
- Output variables in function and method calls
- VAR_TEMP, VAR_STAT
- Any expressions for variable initialization
- Assignment as expression
- Index access with pointers and strings
Object orientation
- Extensions for function blocks: properties, interfaces, methods, inheritance, method call
Further parameters
- Configurable menus, toolbar and keyboard operation
- Unicode support
- Single-line comments: // Comment
- CONTINUE in loops
- Conditional compilation
- Conditional breakpoints
- Debug: Run To Cursor, Step Out
Changes from TwinCAT 2 PLC:
- FUNCTIONBLOCK is no longer a valid keyword for function blocks, in place of FUNCTION_BLOCK
- TYPE (declaration of a structure) must be followed by a “:”.
- ARRAY initialization must be enclosed in parentheses.
- INI is no longer supported and must be replaced by the Init method.
- In function calls, it is no longer possible to mix explicit parameter assignments with implicit assignments. The order of the parameter input assignments can therefore be changed:
fun(formal1 := actual1, actual2); // → Fehlermeldung
fun(formal2 := actual2, formal1 := actual1); // gleiche Semantik wie ...
fun(formal1 := actual1, formal2 := actual2);
- Pragmas (import of TwinCAT 2 pragmas is not yet implemented)
- The TRUNC operator now converts to the data type DINT instead of INT; during a TwinCAT 2 import, a corresponding type conversion is added automatically.
- Direct addressing of allocated variables:
The direct addressing of allocated variables has changed. Whereas the starting point was always the same with TwinCAT 2 irrespective of the data type, a distinction is made with TwinCAT 3:
TwinCAT 2: W0 contains B0 and B1, W1 contains B1 and B2, W100 contains B100 and B101
TwinCAT 3: W0 contains B0 and B1, W1 contains B2 and B3, W100 contains B200 and B201