I am writing a FC for my PLC inside which I need to call FB with it's instance DB.
FB and IDB are variable, and should be passed from user program trough block interface input.
Is there any way to do this, either in STL or SCL? Can anybody provide some example code?
Any help is highly appreciated
I didn't yet figure out how to call FB indirectly, either in STL or SCL. In STL, it is possible to call instance data block indirectly, just defining one of the inputs as "BLOCK_DB" (for example IDBNUM). Then you can make a call:
CALL FB50, #IDBNUM
I still can't figure out how to make this call in SCL syntax.
On the other hand, in STL one can make one input, let's say FBNUM (type "BLOCK_FB"), and make a call:
UC #FBNUM
But this is unusefull for me, because unconditional call does not take IDB into consideration.
On official Siemens support forum one of their platinum experts said that this is possible using pointer of type "ANY". I tried, but no success at all.
So, once more, I need to call FB with it's IDB. Call should be made inside an FC, and FB and IDB number should be defined on the FC interface.
Is this possible at all?
Many thanks.