STL_Any_Code

Hello Everyone...

Can you please elaborate below code for me...


L P##SourceArray

LAR1

L B [AR1,P#0.0]

L B#16#10

<>I

L W#16#8101

JC Err



L B [AR1,P#1.0]

L B#16#1

==I

JC DtX

TAK

L B#16#2

==I

JC DtB



TAK

L B#16#4

==I

JC DtW



TAK

L B#16#6

==I

JC DtDW



L W#16#8102

JU Err

DtX: L W [AR1,P#2.0]

T #BoolLength

JU ChLe



DtB: L 8

JU rep



DtW: L 16

JU rep



DtDW: L 32

JU rep



rep: L W [AR1,P#2.0]

*D

T #BoolLength



L B [AR1,P#9.0]

L 2#111

AW

L W#16#8103

JN Err



ChLe: L #BoolLength

L 0

<=I

L W#16#8104

JC Err



L #BoolLength

L 32766

L W#16#8105

JC Err



L B [AR1,P#6.0]

L B#16#81

==I

JC IaM



TAK

L B#16#82

==I

JC IaM



TAK

L B#16#83

==I

JC IaM



TAK

L B#16#84

==I

JC IaDB



TAK

L B#16#85

==I

JC IaDB



TAK

L B#16#86

==I

JC IaM



TAK

L B#16#87

==I

JC IaM

L W#16#8106

JU Err





IaM: L D [AR1,P#6.0]

LAR1

JU chk





IaDB: L W [AR1,P#4.0]

T #DBNumber

L 0

==I

L W#16#8107

JC Err



L D [AR1,P#6.0]

L DW#16#FFFFFF

AW

L DW#16#84000000

OW

T #StartAddr

LAR1

OPN DB [#DBNumber]

JU chk

Thanks in advance....
 
I suggest you read and learn about the S7 instructions used, and especially indirect addressing and pointers. If you have no idea, you better get an experienced S7-programmer look into whatever your challange is.
 
The code loads an ANY pointer, and based on the content of the ANY pointer it dynamically does something.
The code checks for the size of the data (bit, byte, word, doubleword), and the location (Merker, DB, ..).
I think that the code is not complete.
There are jumps to "chk", but no chk jump label.
edit: I think there should be some recursion to loop through the data, but there is no recursion in the code sample.
 

Similar Topics

Hi, I am trying to make a small code which is checking on the status of a bit struct which has 32 bits DB602.DBD72. It want to flag if any of...
16
Replies
695
Views
Hey everyone, In the middle of deciphering STL code in S7 plc and I'm confused. I interpret the following code to be load the register "#Step"...
11
Replies
3,465
Views
Hi, Anyone know why this network is not longer shown in LAD format but only in STL ? O "RB 20878".EinfV O "RB 20878".EinfR...
11
Replies
3,456
Views
Hi people, could any one tell me if i have converted this STL code correctly A M 30.7 O M 31.0 A M 105.7...
3
Replies
2,255
Views
What does the following code meas ? = Q i 0.10 thanks
3
Replies
2,775
Views
Top