Configuration | Rules 4.2.1.6.11 SA0147: Unusual shift operation - strict | SA0147: Unusual shift operation - strict See also non-strict rule SA0052: Unusual shift operation [ } 43] . Samples: PROGRAM MAIN VAR nBYTE : BYTE := 16#45; nWORD : WORD := 16#0045; nUINT : UINT; nDINT : DINT; nResBYTE : BYTE; nResWORD : WORD; nResUINT : UINT; nResDINT : DINT; nShift : BYTE := 2; END_VAR nResBYTE := SHL(nByte,nShift); // no error because BYTE is a bit field nResWORD := SHL(nWORD,nShift); // no error because WORD is a bit field nResUINT := SHL(nUINT,nShift); // => SA0147 nResDINT := SHL(nDINT,nShift); // => SA0147 4.2.1.6.12 SA0148: Unusual bit access - strict | SA0148:
Unusual bit access - strict See also non-strict rule SA0018: Unusual bit access [ } 28] . Samples: PROGRAM MAIN VAR nINT : INT; nDINT : DINT; nULINT : ULINT; nSINT : SINT; nUSINT : USINT; nBYTE : BYTE; END_VAR nINT.3 := TRUE; // => SA0148 nDINT.4 := TRUE; // => SA0148 nULINT.18 := FALSE; // => SA0148 nSINT.2 := FALSE; // => SA0148 nUSINT.3 := TRUE; // => SA0148 nBYTE.5 := FALSE; // no error because BYTE is a bitfield TE1200 70 Version: 2.11.1 Function Determines bit shift operations that are not performed on bit field data types (BYTE, WORD, DWORD, LWORD). Reason The IEC 61131-3 standard only allows bit access to bit field data types.
However, the TwinCAT 3 compiler also allows bit shift operations with unsigned data types. Importance Low Function Determines bit access operations that are not performed on bit field data types (BYTE, WORD, DWORD, LWORD). Reason The IEC 61131-3 standard only allows bit access to bit field data types. However, the TwinCAT 3 compiler also allows bit access to unsigned data types. Importance Low