steveb1475
Member
Structured text looks like fun, but unfortunately I'm using ladder logic. There doesn't appear to be a way to create alpha characters.
If there is a way to initiate a string with 'abcdef' using ladder logic, I'd be very interested.
Yes, it's the same as the ST. The ladder equivalent to:
Ascii_Area.LEN := 4;
Ascii_Area.DATA[0] := 65;
Ascii_Area.DATA[1] := 114;
Ascii_Area.DATA[2] := 101;
Ascii_Area.DATA[3] := 97;
Would be:
MOV 4 Ascii_Area.LEN
MOV 65 Ascii_Area.DATA[0]
MOV 114 Ascii_Area.DATA[1]
MOV 101 Ascii_Area.DATA[2]
MOV 97 Ascii_Area.DATA[3]
In a string, each of the .DATA[X] SINT's holds the numeric ascii value. You simply just need to look at the table and move in the ascii decimal equivalent.
When you create the MOV, the destination .DATA[X] is going to show the character, not the number - don't worry about that, it works. If you go to your tag editor and change the style to decimal, you'll see the numeric value for the ascii symbol.
Last edited: