Attribute 'monitoring'

The pragma enables you to monitor values of properties or function calls in the online view of the IEC editor or in a watch list. There are two possible attribute values for this: 'variable' and 'call'.

Syntax:

{attribute 'monitoring' := 'variable'}

or

{attribute 'monitoring' := 'call'}

Monitoring of properties

You can monitor the subordinate properties in addition to the local variables in the online view of a function block or a program. You can thus monitor the values of the Get and Set methods.

Add either the {attribute 'monitoring' := 'variable'} or the {attribute 'monitoring' := 'call'} pragma in the declaration of the property. Then the current values of the property are automatically displayed in the IEC editor or in a watch list.

Sample:

TwinCAT displays the value for Minutes at the call position inline during online operation, because the declaration of the Minutes property contains the pragma {attribute 'monitoring' := 'variable'}.

Attribute 'monitoring' 1:

For each application, check carefully which attribute pragma is suitable for displaying the required value. This depends on whether further operations involving the variable are implemented within the property.

Pragma 1 {attribute 'monitoring':='variable'}:

An implicit variable is created for the property, which is always assigned the current property value when the PLC program calls the Set or Get method. The last value stored in this variable is shown in the monitoring.

Pragma 2 {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 calling the property directly. This means that the monitoring service of the runtime system executes the Get or Set method of the property function.

Attribute 'monitoring' 2:

If you choose this monitoring type instead of using an implicit variable (as with {attribute monitoring': =' variable'}), you must consider possible side effects. Such side effects can occur when additional operations are implemented within the property function.

Attribute 'monitoring' 3:

The context menu command Add to Watch causes a variable, on which the cursor is currently positioned, to be added directly to a watch list in online mode.

Attribute 'monitoring' 4:

Forcing or writing of functions is not supported. You can, however, implement forcing implicitly by adding an additional input parameter for each function, which is used as internal force flag.

Attribute 'monitoring' 5:

Function monitoring is not possible in the compact runtime system.

Note: Windows CE is not a compact runtime system. A compact runtime system does not support multitasking and usually has no file and operating system. A typical processor of a compact runtime system is for example an ARM Cortex™-M.