Object POUs for implicit checks

Object Create POU for implicit checks

1. Select a folder in the PLC project tree.
2. In the context menu select the command Add > POU for implicit checks...
The dialog Add POU for implicit checks opens.
3. Activate the desired functions.
4. Click on the Open button.
The selected POUs are inserted in the PLC project tree.
5. Open the POUs in the editor.
6. Adapt the implementation proposal to your requirements.

In order to prevent multiple integration, a monitoring function that may already have been integrated is no longer available for selection in the Add POU for implicit checks dialog.

Object POUs for implicit checks 1:

Do not change the declaration part

To maintain the functionality of the monitoring functions, the declaration part must not be modified. The only exception is to add local variables.

Object POUs for implicit checks 2:

No online change possible

After removing implicit monitoring functions, such as CheckBounds, from the project, online change is no longer possible, only a download. A corresponding message is issued.

Object POUs for implicit checks 3:

Implicit checks for function blocks from libraries

TwinCAT does not perform implicit checks on function blocks from libraries. However, you can use the compiler definition "checks_in_libs" to extend the check to function blocks from libraries. To do this, enter the compiler definition "checks_in_libs" from the PLC project properties in the Compiler defines field, which you can find in the Compile category. This affects source libraries (*.library).

As of TC3.1 Build 4026, the check can also be extended to function blocks from protected libraries (*.compiled-libraries). To do this, you must activate the "Allow implicit checks for compiled libraries" option in the Common category in the PLC project properties before saving and installing it as a library. In addition, you must also enter the compiler definition "checks_in_libs" for protected libraries.

Object POUs for implicit checks 4:

Excluding individual POUs from the check

You can disable the checking of special POUs in the project with the attribute 'no_check'.

Dialog Add POU for implicit checks

Available functions

Monitoring function

Type

CheckBounds

Bound checks:

Appropriate treatment of field bound violations (e.g. by setting an error flag or by changing the field index).

CheckDivDInt

Division checks:

Monitoring of the divisor value, to avoid division by 0.

CheckDivLInt

CheckDivReal

CheckDivLReal

CheckRangeSigned

Range checks:

Monitoring of the range bounds of a subrange type at runtime. Applies to the data types DINT/UDINT

CheckRangeUnsigned

CheckLRangeSigned

L range checks:

Monitoring of the range bounds of a subrange type at runtime. Applies to the data types LINT/ULINT

CheckLRangeUnsigned

CheckPointer

Pointer checks:

For this function you have to complete the entire implementation code yourself. See the help page for POU CheckPointer. The purpose of the function is to monitor whether the transferred pointer points to a valid memory address, and whether the orientation of the referenced memory area matches the type of variable to which the pointer points. If both conditions are met, the pointer itself is returned. Otherwise, CheckPointer should perform appropriate troubleshooting. In the same way, CheckPointer also monitors variables of type REFERENCE TO

See also: