Hello guys. New to codesys here, and trying to write into a position. What i want is the following: For the positions between 42 and 60, if tool "status" is valid, that tool gets the positions number, if not continue. My code does not work, i get values between 45 and 65. Code: //====================Write Tool Numbers X3 ================= FOR X3:=42 TO 60 DO FOR Index3:=1 TO 22 DO IF DbAutomatic.PosX3.Index = 3 THEN IF DbAutomatic.PosX3.Status[Index3] THEN DbAutomatic.PosX3.ToolNumber[Index3]:=X3;...