S7 Indirect Addressing

Join Date
Jun 2007
Location
Oxford, UK
Posts
163
Hey Guys,

Im sure this has been asked a million times on this forum but how exactly does indirect addressing work within Siemens S7. i have a basic idea of it but i want to clear that out and learn from scratch to save confusion.

not only how it works would be helpful though but where it could be used, thats the biggest problem i have at the moment; i understand stuff but i cant practically use it which isnt any use to anybody.

if there is any websites that explain it that would be helpful.
 
Here's a simple example to start you off. The following function accepts a byte and bit address and a boolean to select between the I and Q area. The output of the function is the value of the I/O specified. I use this function for connecting an arbitrary I/O point to my machine horn so I can check it's state (when working on my own and I can't see my laptop or the i/o modules for example).

As has already been suggested, Berger's book will be a good reference.

Code:
FUNCTION FC 277 : VOID
TITLE =
VERSION : 0.1

VAR_INPUT
  iByteAddress : INT ; 
  iBitAddress : INT ; 
  bTrueForQFalseForI : BOOL ; 
END_VAR
VAR_OUTPUT
  bMonitoredBool : BOOL ; 
END_VAR
BEGIN
NETWORK
TITLE =monitor i/o specfied by parameters
	  L	 #iByteAddress; 
	  AW	W#16#FF; 
	  SLD   3; 
	  L	 #iBitAddress; 
	  AW	W#16#7; 
	  +D	; 
	  A	 #bTrueForQFalseForI; 
	  JC	qmon; 
	  LAR1  P#I 0.0; 
	  JU	sum; 
qmon: LAR1  P#Q 0.0; 
sum:  +AR1  ; 
	  A	  [AR1,P#0.0]; 
	  =	 #bMonitoredBool; 
END_FUNCTION
 
Take a look at the help manual, in the appendix at the back is a description of data formats and quite good ones of the POINTER and ANY data formats.

Should help to understand the build of the addresses.
 
cheers for that, ill give that a go and see how i get on. what is this book you speak of? where can i get it? is it online or can i buy it from amazon?
 

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
620
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
667
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,378
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,272
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,970
Back
Top Bottom