![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]()
|
New Here? Please read this important info!!!
![]() |
#1 |
Member
![]() ![]() 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 TelegramType:=2 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 LAR1 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. Grtz, GeHe Last edited by Heino Geerdens; August 31st, 2009 at 09:05 AM. |
![]() |
![]() |
#2 |
Lifetime Supporting Member
![]() ![]() Join Date: Nov 2006
Location: UK
Posts: 5,478
|
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:
|
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Troubleshooting basic code | johnfarrugi | LIVE PLC Questions And Answers | 10 | January 27th, 2009 06:41 PM |
Help: Looping a pointer to ANY-var in Step7 | Balagos | LIVE PLC Questions And Answers | 5 | January 21st, 2009 06:29 AM |
Fix32 7.0: Fanout block and calculation blocks | DoomQuaker | LIVE PLC Questions And Answers | 6 | December 11th, 2008 10:16 AM |
Step7 - BLOCK_DB and ANY parameters | RMA | LIVE PLC Questions And Answers | 10 | June 17th, 2007 08:06 AM |
S7 - More trouble with Timers, or maybe not? | RMA | LIVE PLC Questions And Answers | 19 | September 8th, 2005 05:53 AM |