You are not registered yet. Please click here to register!

plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!

Go Back - Interactive Q & A > - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Thread Tools Display Modes
Old August 31st, 2009, 10:02 AM   #1
Heino Geerdens

Heino Geerdens is offline
Join Date: Aug 2005
Location: Hasselt
Posts: 60
Passing Pointer in Block Call

Hi all,

I struggling for a few days now, with passing a pointer value in a block call.

In the following example I call FC650, BronDW & DoelDW are declared as pointers.

CALL "Send Data samenstellen"
BronDB :=#DBNr
BronDW :=P#12.0 // Declared as Pointer in FC650
DoelDB :=611 // Data Ring Buffer Send
DoelDw :=P#12.0 // Start Adress Send Buffer Declared as Pointer in FC650
DataLength :=W#16#8 // Panelnaam = 8 Char
ButtonNr :=#Index_BtNr
StatusNr :=#Index_StatNr

When I try an load then the address register in the called FC, using on the following methods, it loads a different value in AR1 then the one I pass???
L P##BronDW

And this method is not permitted.

LAR2 P##DoelDw

I also tried passing the value as an ‘Integer’ or as ‘any’, but still it doens’t work.

The only thing that Works is loading the address directly using LAR1 P#value.

I would definitely appreciate some help on this one.



Last edited by Heino Geerdens; August 31st, 2009 at 10:05 AM.
  Reply With Quote
Old August 31st, 2009, 02:04 PM   #2
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
Join Date: Nov 2006
Location: UK
Posts: 5,635
All FC parameters are passed as area pointers. When you pass a pointer type variable (db pointer to be correct), you are actually passing a pointer to a pointer. See example code below:
Attached Images
File Type: jpg ppp9.JPG (71.2 KB, 38 views)
  Reply With Quote
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Troubleshooting basic code johnfarrugi LIVE PLC Questions And Answers 10 January 27th, 2009 07:41 PM
Help: Looping a pointer to ANY-var in Step7 Balagos LIVE PLC Questions And Answers 5 January 21st, 2009 07:29 AM
Fix32 7.0: Fanout block and calculation blocks DoomQuaker LIVE PLC Questions And Answers 6 December 11th, 2008 11:16 AM
Step7 - BLOCK_DB and ANY parameters RMA LIVE PLC Questions And Answers 10 June 17th, 2007 09:06 AM
S7 - More trouble with Timers, or maybe not? RMA LIVE PLC Questions And Answers 19 September 8th, 2005 06:53 AM

All times are GMT -5. The time now is 08:29 AM.