S7 (STL) - Access Instance Data

pethoek

Member
Join Date
Apr 2009
Location
Järbo
Posts
105
I have declared an array of bool in my STAT

Instead of using Logic OR to chech if any of the bits in the array are true. I Would simply like to check if the Word consisting of the bits in the array is greater than 0.

This is not working but will illustrate what i meen.

LAR1 P##MyArray
L W [AR1, P#0.0]
L 0
>I
"
"
"

I think i've heard that AR2 is involved somehow when dealing with instance data.

So if anyone understand what i'm trying to do, and can show me the proper way of doing it, it would be appreciated.

Best Regards
Pethoek.
 
This code seem to work, but i'm sure this is not the correct way.

LAR1 P##MyArray
TAR1
L W [AR1,P#0.0]
SRD 8
 
Create a word/int variable and use SFC20 to copy the array of bits to the word/int. Use the word/int to test for non-zero

bbbb.JPG
 

Similar Topics

Hi All, I'm trying to write (STL) a function(blok) in S7 I just want to in-output a "byte" and use it in my function as "byte.bit" format. I...
Replies
14
Views
3,585
Hello, I want to access the elements of an array with the aid of a variable (indirect accessing the elements of an array). For example, an...
Replies
3
Views
3,323
i am new to simatic manager and i am trying to figure what this part do in the code : A I 5.6 = DB50.DBX 4.6...
Replies
3
Views
132
Hello everyone, can anyone help me with covert the STL code to ladder. Iam using plc s71200. A %DB1.DBX33.7 // angel of vaccum...
Replies
2
Views
208
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
317
Back
Top Bottom