-

Semantic Error: The data type '...' of variable '...' is not valid. It is required to be of type '...'.

In an LD code worksheet, the variable mentioned in the error message which is assigned to an LD object is not of the data type BOOL.

Double-clicking the error message opens the code and marks the variable. To modify the variable declaration, right-click the variable and select 'Go to definition' from the context menu. In the 'Variables' table, set 'Type' to BOOL.