Attribute ‘monitoring’¶
The effect of this pragma is that you can monitor values of properties or function calls in the online view of the IEC editor or in a monitoring list. There are two possible auxiliary attributes for this, 'variable'
and 'call'
Syntax:
{attribute 'monitoring' := 'variable'}
{attribute 'monitoring' := 'call'}
Use for the monitoring of properties
This concerns the monitoring of the variables that are used in the Get
and Set
methods of a property. In order for these to be displayed in the online view of the IEC editor or in a monitoring list, you must insert the attribute 'monitoring'
together with one of the two auxiliary attributes 'variable'
or 'call'
into the declaration of the property.
Example
CODESYS displays the value for Minutes
at the calling point only because the attribute 'monitoring'
was inserted in the declaration of the property.
Check carefully for each application which attribute pragma is suitable for displaying the desired value. This depends on whether further operations with the variables are implemented within the property.
1. Pragma {attribute 'monitoring':='variable'}
:
An implicit variable is created for the property, which is then always given the current property value when the application calls the Set or Get method. The value stored last in this variable is displayed in the monitoring.
2. Pragma {attribute 'monitoring':='call'}
:
You can use this attribute only for properties that return simple data types or pointers, not for structured types. The value to be monitored is read or written by directly calling the property. This means that the monitoring service of the runtime system executes the Get
or Set
method of the property function.
Attention
If you select this type of monitoring instead of using an implicit variable (as in the case of {attribute 'monitoring':='variable'}
), you must consider possible side effects. These kinds of side effects can occur if additional operations are implemented in the properties function.
Attention
The monitoring
pragma is also evaluated for the symbol configuration. Only read access is possible for the variable
value.
Note
With the context menu command
, a variable on which the cursor is presently positioned is adopted directly into the monitoring list in online mode.Note
The forcing or writing of functions is not supported. However, you can implicitly implement forcing by adding an additional input parameter for the respective function, which serves as an internal force flag.
Note
Function monitoring is not possible in the compact runtime system.
See also