SA0026: Possible truncated stringsPermalink

Detects string assignments and string initializations that do not use sufficient string length

Justification: When strings of different lengths are assigned, a string could be truncated. This can have unexpected results.

Importance: Medium

Example

PROGRAM PLC_PRG
VAR
	strVar1 : STRING[10];
	strVar2 : STRING[6];
	strVar3 : STRING[6] := 'abcdefghi';  // SA0026
END_VAR

strVar2 := strVar1;					  // SA0026

--> SA0026: Truncation of string 'abcdefghi'
--> SA0026: Possible truncation of string 'strVar1'