Guidelines and compatibility
Backward compatibility is always considered in the development of the Plastic Base Application. On the other hand, changes that involve the removal of old items are only handled as an addition. This means that items that are renamed, changed, or redesigned are always added to the project, and the old version remains in the project with the "Obsolete" label. However, updates with new features and items can conflict with the existing end application. It is recommended that you follow the following guidelines to ensure compatibility:
Prefixes
In the Plastic Base Application, internal variables of a class are given a data type-dependent prefix. This allows a distinction to be made between variables and properties. A list of the usual prefixes can be found in the TE1000 XAE PLC documentation. The following prefixes are used differently to this definition:
Type | Prefix | Instead of | Description | Declaration example(s) |
---|---|---|---|---|
|
|
| Instance of a safely assigned interface. |
|
|
|
| Instance of an optionally assigned interface. |
|
|
|
| Instance of a bitwise coded integer |
|
|
|
| Global variable list as declaration space for global instances (e.g.:) |
|
Use of a property
Properties in object-oriented PLC programming consist of a Get
and a Set
method. In principle, this means that each property could also be programmed using two methods. For this reason, the Plastic base application defines some scenarios for selecting the action object to be used:
Scenario | Sample | Note |
---|---|---|
Access to an actual state |
| Actual values can only be read |
Access to a setting value |
| Parameters can be read and (possibly conditionally) written |
Access to a sub-object |
| Access to sub-objects is controlled via |
Interface to the HMI |
| Properties offer the option of calculating values for the HMI according to requirements. This eliminates the need to copy values, especially for use in the HMI. |
The following guidelines should be considered in all scenarios:
- The basic rule for Plastic Base Application properties is that they represent passive access to an object. This means that a
Set
orGet
should not result in any immediate action. - If a property is to be used to access a structured sub-object, the property must allow reference access. It must be ensured that a valid instance is always returned for this reference access.
- Since no prefix is used when naming a property, the data type of the property can be specified by using a specific name. Samples:
- Has, Is or Enable indicates a Boolean property.
- Number, Idx, ID indicates an integer property.
- Value indicates a floating point property.
- Name indicates a string property.
- _Property indicates a property reserved for internal purposes.
- Adding the attribute
{attribute „monitoring“ := „call“}
to the declaration of a property allows the current value of the property to be displayed live in the PLC's online view. This attribute is also a prerequisite for accessing a property from the HMI. - As obsolete variables are converted to properties, address accesses to the variables of a class should be avoided. In this case, an address access would cause a compilation error and a necessary change.
![]() | Deviations from the guidelines possible Different usage scenarios may occur in the Plastic Base Application for practical and/or historical reasons. The following cases, for example, were selected for simplification (practicability):
|
Use of a method
In contrast to the properties of the Plastic Base Application, methods are fundamentally used for triggering active functions. Accordingly, a list of scenarios can also be compiled for methods:
Scenario | Sample | Note |
---|---|---|
Executing a command |
| A command can be actively enabled and disabled by passing a |
Call for a one-time action |
| This type of method is designed for an event-based (one-time) call. |
Index-based access to a sub-object |
| Access to sub-objects is controlled via |
Cyclic processing |
| Cyclic program code whose cyclic call can also be carried out via a |
Cyclic subroutines |
| Division of the cyclic program code into individual routines. These methods can only be called within the class and inheriting classes using the access modifier |
Help Functions |
| Class-internal auxiliary functions avoid multiple occurrences of identical code. A method with the access modifier |
Initializing a reference |
| Enables a successful reference initialization to be checked. |