Indirect addressing stl

robjongen

Member
Join Date
Apr 2008
Location
Eindhoven
Posts
14
Hello,

Can someone help me with this one?

I have an array db1.step.step[1..32]
I am making a function in STL that give me the first bit that is 1

One I have never worked with STL so it's kind'a difficult.

I now i have to work with indirect addressing but i have no idea on how to start.

Beacause it is a function the DB hase to be selecteble. DB1 DB2 etc

I found this already in the forum

http://www.plctalk.net/qanda/showthread.php?t=7641&highlight=indirect+addressing+stl

Thanks

Rob
 
You could use absolut adressing as in parameter
Example: P#DB2.DBX0.0 BYTE 2
Now we are only checking the first 2 bytes. If you use this function in many places or have a lot of bytes that you loop through its better to use FC45 or FC102 as they are much faster
 
Last edited:
You can specify the array name within the UDT, e.g.

Code:
	  CALL  FC	99
	   iArray :="Bits".ArrayOfUDT[1].ArrayOfBools
	   RET_VAL:=MW10
 
Bratt said:
You could use absolut adressing as in parameter
Example: P#DB2.DBX0.0 BYTE 2
Now we are only checking the first 2 bytes. If you use this function in many places or have a lot of bytes that you loop through its better to use FC45 or FC102 as they are much faster

Thanks Guys!

That worked

Rob
 
L D[AR2 said:
Of course it worked, but is it what you want ?

I agree with out i never use absolut adressing anymore and its much better to use symbolic adressing. It was just the fastest and easiest way i could think about without rewriting anything.
 

Similar Topics

Hi all I need to read the values of many variables from a stl cycle. For example, suppose I have 3 variables: tag1,tag2,tag3. Is it possible to...
Replies
1
Views
1,311
I have this code: L P#0.0 T MD 20 L #Index +D T MD 20 L 32 +D T...
Replies
1
Views
1,639
Howdy folks, I am an Allen Bradley guy currently living in an Emerson world. Working with Rx3i on PacSystems Machine Edition v. 9.6? i think...
Replies
3
Views
619
Hello, I'm very new to programming with absolutely zero schooling in this field and pretty hands off training in my new role, it's been fun...
Replies
4
Views
666
Hello Friends, I am trying to index M Bits, however GX Works2 is not allowing it with following message. https://ibb.co/zPcqj6M...
Replies
3
Views
1,375
Back
Top Bottom