OOP Global instance Question

I’ve created a function block with object-oriented elements (using .fub and .stpp files). I’m able to create and use an instance of it (MyFUBInstance) within the same package where the function block is defined.

My goal is to be able to access this same instance from other programs and packages in my project. I’ve tried a few methods but haven’t been successful.

Hello,
i did a little search on the current documentation.
SToop

But i could not find a hint about global usable Library Objects in SToop. In reference to Standard ST i would expect to have a possibility to add them to a IEC-Library but this seams currently not possible.

The Help does mention the not finalised implementation Status of SToop…

So lets see if someone else does have a deeper look in the Technology and the Roadmap.

Greetings
Michael

I have also tried adding them to a library without any success. The other thing i have noticed is it seems I can not use B&R Function blocks inside of the OOP Function Block. I tried to create a variable of type MpAxisBasic and i keep getting the error that no such filie or directory exists and i have added the MpAxis Library to the project and it is in the .cpu.

In the previous Thread about SToop here in the Community we used the TON-Functionblock in SToop successfuly, so its not a general Problem with Libraries. It must be a more spezific issue to your current implementation or the MpAxisBasic.

Can you make a Printscreen of the Error message?

Greetings
Michael

Michael,

Here is a screenshot of the error. Also I did create a variable of type MpAxisBasic in the .var file and it didnt give me any issues so i know the MpAxis library is in and working.

Hello,

ok that Filename looks quite strange. The normal Headerfiles which, for example are used if you program in ANSIC are just Named MpAxis.h (Libraryname.h).

As the technology is quite new for B&R i do not have much expierience with it… and so the community as well. I think this must be clarified with the official B&R Support.

Greetings
Michael Bertsch

Hi @Aaron_Rice, have you found solution for your issue, can you update us?

Yes I contacted B&R Support and they told me that dynamic variables have not been implemented yet since it is still beta.

1 Like