beckhoff TE1200 — 4.2.1.6.8 SA0134: Explicit signed/unsigned conversions

Configuration | Rules fLREAL : LREAL; nBYTE : BYTE; END_VAR nDINT := UINT_TO_DINT(nUINT) * UINT_TO_DINT(nUINT); // no error nDINT := nUINT * nUINT; // => SA0130 nLINT := nDINT * nDINT; // => SA0130 nULINT := nUSINT * nUSINT; // => SA0130 nLWORD := nUDINT * nUDINT; // => SA0130 fLREAL := nBYTE * nBYTE; // => SA0130 4.2.1.6.7 SA0133: Explicit narrowing conversions | SA0133: Explicit narrowing conversions Samples: PROGRAM MAIN VAR nSINT : SINT; nDINT : DINT; nLINT : LINT; nBYTE : BYTE; nUINT : UINT; nDWORD : DWORD; nLWORD : LWORD; fREAL : REAL; fLREAL :

LREAL; END_VAR nSINT := LINT_TO_SINT(nLINT); // => SA0133 nBYTE := DINT_TO_BYTE(nDINT); // => SA0133 nSINT := DWORD_TO_SINT(nDWORD); // => SA0133 nUINT := LREAL_TO_UINT(fLREAL); // => SA0133 fREAL := LWORD_TO_REAL(nLWORD); // => SA0133 4.2.1.6.8 SA0134: Explicit signed/unsigned conversions | SA0134: Explicit signed/unsigned conversions Samples: PROGRAM MAIN VAR nBYTE : BYTE; nUDINT : UDINT; nULINT : ULINT; nWORD : WORD; nLWORD : LWORD; nSINT : SINT; nINT : INT; nDINT : DINT; nLINT :

LINT; END_VAR nLINT := ULINT_TO_LINT(nULINT); // => SA0134 nUDINT := DINT_TO_UDINT(nDINT); // => SA0134 nSINT := BYTE_TO_SINT(nBYTE); // => SA0134 nWORD := INT_TO_WORD(nINT); // => SA0134 nLWORD := SINT_TO_LWORD(nSINT); // => SA0134 TE1200 68 Version: 2.11.1 Function Determines explicitly performed conversions from a larger to a smaller data type. Reason A large number of type conversions can mean that incorrect data types have been selected for variables. There are therefore programming guidelines that require an explicit justification for data type conversions. Importance Low Function Determines explicitly performed conversions from signed to unsigned data types or vice versa.

Reason Excessive use of type conversions may mean that incorrect data types have been selected for variables. There are therefore programming guidelines that require an explicit justification for data type conversions. Importance Low