Message: Use of 'THIS' is not allowed in this context
Possible error cause: In order to be assigned to the current instance, THIS can be used only in a method, action, transition, or in the body of a function block. This error message appears for all other positions.
Error correction: Use THIS in an allowed context only.
Example of the error:
PROGRAM PLC_PRG VAR test1: INT; END_VAR THIS^.test1 := 19; --> C0018: 'THIS^.test1' is not a valid assignment target --> C0062: 'THIS^' is not a structure variable --> C0045: Use of 'THIS' is not allowed in this context