Logix 5000 Question: Using Index in For loop for indirect addressing of an [array]

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.

Ascii_Area.jpg Ascii_Area_Lad.jpg
 
Last edited:

Similar Topics

hi , I need to sorry for my bad English first. I'm newbie at plc programming ,I had been asked about E/IP protocol information for some system...
Replies
3
Views
383
So I have a PID loop on an 1756-L61 running V17 software just for background. Also the PID PV is a pressure transmitter and the CV is speed sent...
Replies
1
Views
899
Good morning guys, I have a machine that fills bags of prepared food at a variable speed, and a machine that checks the weight of the bag. What...
Replies
23
Views
6,841
Hello Please Help, I want to use a FSC instruction that will scan 20 DINT arrays. If the arrays are greater than 1000 display the value. How do I...
Replies
4
Views
1,769
Hey all, I just joined today. Not sure if this question is in the right place or if anyone has asked it before. I am monitoring a machine from...
Replies
2
Views
1,448
Back
Top Bottom