信息 :此处不允许使用 "THIS"。
可能的错误原因 :要将 THIS 分配给当前实例,只能在方法、操作、转换或功能块的主体中使用。所有其他位置都会出现此错误信息。
纠错 :仅在允许的情况下使用THIS。
错误示例
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