Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

W0002: a direct address in a body, deprecated since Ed.3

A direct address (%IX0.0, %QW2) belongs in a declaration: lamp AT %QX0.0 : BOOL;. Using one in a statement or a condition is deprecated since Ed.3 (Annex B: “Use of directly represented variables in the body of POUs and methods”). Declare a name for the address and use the name.

%QX0.0 := %IX0.1;          (* W0002, twice *)

VAR
    lamp AT %QX0.0 : BOOL;
    button AT %IX0.1 : BOOL;
END_VAR
lamp := button;            (* fixed *)