indirect addressing

Amr Hassan

Member
Join Date
May 2005
Posts
340
i have an array of words in db1

i want to display the content of word 0 on the first positve edge
of m10.0 word 2 on the seond and so on


the way i naturlly do so is that i calculate the address and

then :

l mw[md 100]
t mw 200


how can i do so using pointers ?

thanks
 
What will you display before the first positive edge, what happens when you reach the end of the array, can you reset the index back to zero at any time ?
 
i want a display the first entry , if reached the end to display lat entry and yes i want to be able to reset
 
So, before the first edge, the display shows entry 0, after the first positive edge, the display shows entry 0, after the second positive edge, the display shows entry 1 etc.
(The array is 0 based
Array[0]
Array[1]
Array[2]....
)
 
i have tried this

OPN DB 1
LAR1 P#DBX 0.0
L W [AR1,P#0.0]
T MW 2


this pointed to the first word in the data block
when i wrote

OPN DB 1
LAR1 P#DBX 0.0
L W [AR1,P#2.0]
T MW 2


it pointed to the second word


now is there a way to increase this offset through the program?
 
Assume your array index is held in MD1000, then the following code could be used:

Code:
	  OPN   DB	 1
	  LAR1  P#DBX 0.0
	  L	 MD  1000
	  SLD   4
	  +AR1  
	  L	 W [AR1,P#0.0]
	  T	 MW	 2
 

Similar Topics

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
617
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
665
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
Hi All, which the best way to do the indirect addressing in an optimize DB? Ccurrently this is my partial code inside an FB...
Replies
7
Views
2,270
Hey everyone, Just used the PLC5/Logix migration utility to convert a program, and while addressing the PCEs, I noticed a lot of errors for "XIC...
Replies
12
Views
1,961
Back
Top Bottom