SA0005: Invalid addresses and data types
Function | Determines invalid address and data type specifications. The following size prefixes are valid for addresses. Deviations from this lead to an invalid address specification.
|
Reason | Variables that lie on direct addresses should, if possible, be associated with an address that corresponds to their data type width. It can be confusing for the reader of the code if, for example, a DWORD is placed on a BYTE address. |
Importance | Low |
![]() | If the recommended placeholders %I* or %Q* are used, TwinCAT automatically performs flexible and optimized addressing. |
Samples:
PROGRAM MAIN
VAR
nOK AT%QW0 : INT;
bOK AT%QX5.0 : BOOL;
nNOK AT%QD10 : INT; // => SA0005
bNOK AT%QB15 : BOOL; // => SA0005
END_VAR