(0)| 10/18/2012 4:16 PM | |
|
Posts: 1121 Rating:
|
Hi All, i Have Structure of 32 bits (bool). in Stat of an FB, I have to transfer the value to Dword at out. I have used the Ar1 and Ar2 concept, But when i call the Fb11 in another Fb12, it over laps with main FB12. I have attached the Project. Any ideas, AttachmentTest_4.zip (200 Downloads) |
| 10/19/2012 1:31 AM | |
|
Joined: 10/7/2005 Last visit: 1/22/2026 Posts: 3054 Rating:
|
Hello Tagolover AR2 contains the Multi Instance offset and it's value MUST be taken into account when doing indirect addressing in an FB's to its variables. You code does not take AR2 into account which causes your "overlapping" problem. There's a few ways to fix this and the links below have all the info on this: Adress Absolut with multi instance How do you parameterize blocks, which have "ANY"-type or "Pointer" type parameters? (see bottom of page) access to one multi-instance I hope this helps |
|
Cheers |
|
This contribution was helpful to
|
|
| 10/23/2012 4:37 AM | |
|
Joined: 10/7/2005 Last visit: 1/22/2026 Posts: 3054 Rating:
|
Hello Tagolover I'll try to make it clearer: Your FB12 has two BOOL input parameters. Your FB11 is called as a Multi Instance call from FB12. Result: FB11'svariables will be located after FB12's IN variables and in your case start asof address 2.0 in the Instance DB of FB12. As such you MUST take AR2's multi instance offset into account when doing indirect addressing inside FB11 and the attached picture will hopefully help with this explanation and also shows you how to fix it. Note too that I omitted using any indirect addressing for the output variable "#State", as it is already declared as a DoubleWord and might as well be used symbolically. I hope this helps |
Last edited by: fritz at: 10/23/2012 5:51 AMtypos Cheers |
|
This contribution was helpful to
|
|
| 11/7/2012 1:26 PM | |
|
Posts: 1121 Rating:
|
Hi Well thank you for your support i think i got a hang on topic. Thank you once again. |
This contribution was helpful to
|
|
Follow us on