Implicit Checks “CheckBounds”

Description

There are some built-in POUs in the CODESYS software to do checks on you project. One is called Check Bounds discussed here Check Bounds POU .

Utilizing the built-in CODESYS POU “Check Bounds” function and not doing the below modification will cause the CODESYS IDE system to hang during a project download into the P2CDS-622 CPU.

If this occurs, you need to cancel the download Task and incorporate the following workaround.

Note

Incorporating this modification will not alter the intended functionality for the “Check Bounds” Function.

Workaround

The following illustrates the steps to implement this function and the associated edits to be made to the CODESYS generated code.

Add the POU and Function

Add the Object into the project from drop-down menu Project >…

alternate text

Select the Bounds Checks

alternate text

Note

The Check Bounds Function is the only function affected by this errata. The others, e.g. Range Checks require no edits.

Inspect Generated Code

The following shows the CheckBounds Function code generated and the areas that will be modified.

alternate text

Modify Generated Code

Make the following edits to the function.

1). Move the VAR declarations into the Declaration section.

2). Move the _pApp code line under the Conditionals- IF and ELSIF.

alternate text

Future Resolution

This issue is not planned to be addressed further.