Pointers

s7xp.com

Member
Join Date
Jan 2007
Location
Rotterdam
Posts
151
Anybody how knows how to declare a pointer to the previous local data (V).

I: P# I10.0
Q: P# Q10.0
M: P# M50.0
DB: P# DB1.DXB10.0
DI: P# DIX10.0
L: P# L 10.0
V: P# ?????
 
Thanks for the reply. In a function block (instance datablock) you have the possibility to add a pointer as input. The manual of step 7, chapter A3.4.2. Format of the Parameter Type Pointer talks about V.
 
An example of using V type.

I have sent into a block a parameter which is the pointer to a start of a data area, once inside the block I then want to block transfer from the area pointed to, into the TEMP area of the block.

Before calling SFC20, I set up the pointers to both areas, but as the TEMP area is on this block, not SFC20, then I have to change the area to V type in my pointer.

SFC20 will then move the data, into the TEMP area of the calling block.
 
Referencing the V area is almost always done by loading an address register with a pointer to the area. For example, say pPointer is a parameter of type pointer (it can be a parameter of an FC or FB),

Code:
L P#pPointer  
LAR1		   //ar1 will now contain Vx.y
L W[AR1,P#0.0] //this retrieves the db number from the V area
L D[AR1,P#2.0] //this retrieves the area pointer from the V area
 
You've totally confused me there Simon.

As I understand it and have used it, the V area points to the TEMP area of the previous OB/FC/FB that you were in.

If you load P#pPointer and #pPointer is a TEMP, then the resultant pointer would be to the local TEMP area, not the previous TEMP area.

I'm not sure I understand your statement at all.
 
Sorry for the confusion, my original post is incorrect in that different processing applies between FC's and FB's

Here's an example of a call to an FC with an input parameter of type pointer.

point001.JPG

Here's a similar example but with an FB:

point002.JPG
 
Last edited:
Thanks guys for the info, but my question is still ot solved. I declare in a FB a pointer as input. Create instance datablock. Open data block and I want to enter in the actual value a V pointer. But how??
 
None of the editors allow you to enter a V area pointer (because it is only used at parameter transfer time), so if you want the DB to contain a V area pointer then download the DB to the simulator(or a real plc), insert the data using a VAT table and then copy the DB from online to offline.

Why do you want to insert the V area pointer this way ?
 
Last edited:

Similar Topics

Hello, I've just came out of a call where a program that was modified two weeks ago threw the processor into fault. The program has been done...
Replies
9
Views
3,475
I'm trying to get a 5069-L306er to talk to a Automation Direct ProSence Controller by using RA's AOI for modbus client but its stuck not getting a...
Replies
9
Views
1,902
The last time I did anything with Wonderware was just after the dot com bust. Boy, I feel old. Anyway, it looks like I will get the chance to...
Replies
3
Views
1,536
Hi guys, Some pointers needed: Having PC with WIN7 pro X64 and Amsamotion clone of 6ES7 972-0CB20-0XA0 cable and need to backup VIPA cpu...
Replies
14
Views
3,144
Is there any form of Reference Type or Pointer Type like Codesys has? I am aware that you can nut a tag in the index of an array reference. but...
Replies
7
Views
1,916
Back
Top Bottom