6/27/2011 11:51 PM | |
Joined: 1/28/2009 Last visit: 9/24/2023 Posts: 6821 Rating:
|
Please check the following links: How do you create and update multiple instances? Information about "Calling blocks and functions" Regards |
6/28/2011 5:05 AM | |
Joined: 10/7/2005 Last visit: 9/23/2023 Posts: 2987 Rating:
|
Hello pici_c while your intended way is not possible, there is a "workaround" to achieve what you are trying to do and its principle isas followed: 1.) Open the desired Instance DB prior to the call of the FB (e.g. via OPN DB [#temp] in your case). 2.) Supply all IN's and IN_OUT's of the the FB by directly putting their values into their rightful place of the just opened Instance DB. 3.) Call the FB without Instance DB via the "UC" command. 4.) Copy the results from theInstance DB's IN_OUT and OUT FB parameterinto whatever variable you need to have them. Attached is a pic that should help in making sense out of the above. P.S: The example callsFB2 fromFB1 and also shows how to restore FB1'sIDB once the call of FB2 is finished aswell ashow to manipulate DB Registers (you may not need all of this, theexample merely shows the principle and I "stole" it from an entry of minein the German forum some time agowhen a similar question was posted). A Multi Instance Solution would of course be the elegant way to do the same and may be the solution for you too. I hope this helps |
Last edited by: fritz at: 6/28/2011 10:10 AMtypos Cheers |
|
This contribution was helpful to
1 thankful Users |
6/29/2011 11:44 AM | |
Joined: 10/7/2005 Last visit: 9/23/2023 Posts: 2987 Rating:
|
Let's put it that way Juergen, I never had a real need to use this method in an actual project. It is however a way to achieve what pici_c wants to do (I could only speculate on the"practical" reasons he may have to do so).
I suppose so, but pici_cwould then have to convert his FB to an FC which he may not be able to do if it is for example a protected FB from the Library or SFB. Apart from the required manual creation of the DB structure it would also meanthat partial addressing is required inside the FC to access the DBvariables so it may end up being more work and/or becomingless maintable as a result. I guess the real question is why pici_c (thinks he) needs to do the indirect Instance DB opening, perhaps he can shed some light on it? |
Cheers |
|
This contribution was helpful to
1 thankful Users |
Follow us on