Indirect Addressing

P

Thread Starter

plcstudent

Hi,

Can I use indirect addressing in Step7? For example when using RSLogix 500 you enter F8:[N7:1] giving the double word location according with the value of N7:1

I was wondering if I could enter somenthing similar in Step7.
 
<p>Hi all:

<p>Of course you can do it.

<p>In the nexts two lines, you can load the data stored in DBWX, where X is the number you load on "Puntero", and transfer this data to "Tipopieza"
<pre>
L DBW [#Puntero]
T #TipoPieza
</pre>
<p>Best regards.

<p>Aquilino
 
Of course you have many more possibilities/programing techniques for indirect addressing on S7 against A-B. Some of them (from S7) it is dificoult to realise with A-B because A-B simply have no such functionality integrated.
For example: you can work with address registry directly, you have a data type on 'ANY', and so on... A-B indirect addressing possibilities are very poor compared with S7.

Take a look in docu from S7, you will be wondering. I'm sure.

Pavel
 
M
<p>Step 7 has both arrays and pointers. However, the arrays are rather pointless as you cannot index the array in any meaningful way other than directly. e.g. Array[1] as opposed to Array[MW 222]

<p>You can indirectly address bytes within a block,
<pre>
L MW 100 //Register containing byte
//number
SLD 3 //Shift register 3 bits to the
//left (the 3 lowest bits of
//contain the bit address
T MD 222 //Indirect address
...
...
...
T QB[MD 222] //Write Outputs Indirectly
...
...
...
L MD 222 //Increment pointer by one byte
L P# 1.0
+D
T MD 222
...
...
...
L MD 222 //Increment pointer by one word
L P# 2.0
+D
T MD 222
</pre>
<p>I have found no way (yet) of programmatically addressing the block.

<p>In AB you can address N[fIndex]:[wIndex]. In Step5
you can do the following, <pre>
L 12
T MW 222
DO MW 222
C DB 0 // Call (or Load) Data Block 12.
</pre>
 
Top