ST OOP fub

I am trying to use the new ST OOP fub but I am running into building issues. But I only added a simple .fub:

afbeelding

The fub is just the declaration:
FUNCTION_BLOCK FUB1
END_FUNCTION_BLOCK

When I build it returns this error:
22 Error 25-7-2025 09:45:11,2446 There is no implementation for the body of the FUNCTION_BLOCK ‘FUB1’. 2000

I am using AS version 6.3.1.32, the documentation and examples on FUB are quite limited. The files inside of AS studio are still ‘Preview Version’. Can you help me get started?

1 Like

Hi

If I simply go by the words of the error message, I would try filling the FUB with anything but emptiness?
Disclaimer: Just guessing here, I did not try any of this myself :slight_smile:

Best regards

1 Like

Declaring input/output/vars/methods also do not help :frowning:

What about actual source code? Because an empty FUB is as useless as a FUB that only has vars and does nothing.
Try at least assigning a value to one of the now created vars or something

Still the same error. Is the FUNCTION_BLOCK fully implemented or still in beta? I am trying to build it in AS 6.3.1.32.

FUNCTION_BLOCK FUB1

VAR_INPUT 
	a : USINT := 1;
	b : USINT := 2;
END_VAR 
VAR_OUTPUT 
 	c : USINT;
END_VAR 

c := a + b;

END_FUNCTION_BLOCK

7 Error 28-7-2025 09:38:56,2896 There is no implementation for the body of the FUNCTION_BLOCK ‘FUB1’. 2000

Hello,

Please have a look at AS-Help
Function blocks with object oriented elements - Example

I had previsly no idea how SToop works, but i was also now curious to lern something new…
I went through the documentation and copied the Examples to my AS6 and was able to Build and Run it in ARsim.

Here is the Programm as Export from AS6 as .zip
SToop_TestFub.zip (1.9 KB)

I hope you can find your issue by looking into the example.

Greetings
Michael

3 Likes

Thank you for your elaborate answer. I am almost there. But now I have run into a ‘IecTranspiler’ issue.

# Category Date/Time Description Error Position File
8 Message 29-7-2025 09:07:43,0350 Compiling C:...\TestFub\Logical\Program\Main.stpp …
9 Message 29-7-2025 09:07:43,0640 Compiling C:...\TestFub\Temp\Objects\Config1\X90CP154_60_00\IecTranspiler\Program\Main.stpp.cpp …
10 Error 29-7-2025 09:07:43,0661 fatal error: C:...\TestFub\Temp\Objects\Config1\X90CP154_60_00\IecTranspiler\Program\Main.stpp.cpp: No such file or directory C:\Program Files (x86)\BRAutomation\AS6\bin-en\cc1plus.exe

I have tried a few different hardware configurations, but these are also missing this IecTranspiler. The build fails for both Main.stpp.cpp and FUB1.stpp.cpp.

In AS Code I have also attempted to build the IEC-ST-OO files. But this resutls with missing the ccp generator.

Is it correct that the hardware configuration is lacking files? Ifso, where can I obtain these?

edit
I just noticed the latter part of the error. It seems that I am missing “cc1plus.exe”.

Hello,

i changed my PLC to the model from your Error Message “X90CP154.60-00”
it did compile without errors.

I think its not an issue with the Hardware. There must be some other issue.
I had a look for the “cc1plus.exe” but i can not find any statement for it in Message Window, and also in the location provided by your error message, i don’t have it.

I did use AS 6.3.1.32 , AR 6.3.2 X90-HW 1.1.0.0

I did not used Automation Studio Code much, only had a short look into it. I only used Automation Studio 6.

Can you provide more information about your test, maybe an export like mine, so we can have a better look at the code.

Greetings
Michael

Hello,

Update: I did now find an “cc1plus.exe” but its in an complete different location.

It looks like it is part of the compiler.
Don’t know if this helps…

Greetings
Michael

With help of my colleague I was able to build it. Not sure what went wrong but it seems to be something to do with coping the files. For additional build options I had to add “-u__cxa_begin_cleanup”.

But now I have run into an error with ARsim 6.3.2
The simulation starts in Diagnosis mode. I have added the console log.

Log

$accsec:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$arlogconn:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$arlogsys:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$arlogusr:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$fieldbus:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$firewall:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$motion:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$safety:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$textsys:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$unitsys:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$versinfo:EventID 1073773104 (INFO, 0, 31280), “ROOT”, “base log module created”
$arlogsys:EventID -2147453620 (WARNING, 0, 30028), “ROOT”, “reboot required - modified hardware description (hwd) and/or firmware available”
$arlogsys:EventID -2147473998 (WARNING, 0, 9650), “ROOT”, “__cxa_begin_cleanup”
$arlogsys:EventID -2147478490 (WARNING, 0, 5158), “ROOT”, “Install: Program”
$arlogsys:EventID -1070584540 (ERROR, 48, 11556), “ROOT”, “object installation failed”
$arlogsys:EventID 1076899103 (INFO, 48, 11551), “ROOT”, “Initial installation”
$arlogsys:EventID -1070584545 (ERROR, 48, 11551), “ROOT”, “”
$arlogsys:EventID -1073733725 (ERROR, 0, 8099), “ROOT”, “::Program”
$versinfo:EventID 1076898062 (INFO, 48, 10510), “ROOT”, “”
$versinfo:EventID 1076898066 (INFO, 48, 10514), “ROOT”, “”

I did try this solution for error 8099. But for error 11556 I could not find on the forum yet. Any idea why my simulation is returning this error?

Hello,

using this Compiler Setting is not a good idea. I never heard of it and after i added it i run also in DIAG mode. Checking my logger we can see that the system tries to find a Function on the PLC with the Name __cxa_begin_cleanup which is not there.


If you want to clean your Automation Studio Project Folder, you can use these Menu.

In some cases you can also just delete the TEMP Folder in the Project-Folder if AS is closed and ARsim is not running.


Please remove the build option, if you are not absolut sure what it will do and how to use it. I could not find an Info in Automation Studio help, so i can’t help here. But to tell that is made it worse on my side.

Greetings
Michael

1 Like

:ok_hand:

Thank you Michael, we finally got our first project running succesfully. Cleaning up the project and configuring it correctly fixed it.

Initialising the .fub and .stpp correctly allows us to communicate easily between function blocks. The only remark on this is that in AS6 there is no variable watch during simulation for stpp files. However in ASCode using breakpoint and debug we are able to validate our project.

3 Likes

Hello,
I am happy that you finaly got Through :slight_smile:
Thanks for the Feedback!

I got the Information that it is currently intended that all SToop Programming will take place in Automation Studio Code. Automation Studio is only the back-end and will currently not support SmartEdit or Monitor-Mode.

The Watch in AS6 can be used via the “Context menu”

Greetings
Michael Bertsch

Hi Micheal,

I ran into an additional issue regarding ST OOP. To validate it I made two similar programs that count to 10 using a TON. For ST it works as expected. For the OOP when I try to use the TON input PT I can not build it. It only builds with IN input.

Programs.zip (3.6 KB)

I get the same error as when I was missing “cc1plus.exe”.

On top of that, when I turn off “simulation” I get the “PV __cxa_begin_cleanup” error. Also after cleaning and removing TEMP folder.

Hello,

I think the error out puthandling is not finished. Because this error is just an hint to an syntax issue. There seems somehow an issue that the compiler can’t unterstand the T#1s Format and convert it correctly into TIME.

I have worked around this by using an Input with type TIME. Then it was compileable.


Greetings
Michael

Hello,

That also compiles for me. But I cannot assign/initialise the T#1s to the PtTime. I have tried to use UINT_TO_TIME() etc or assigning it in the Global.var and using that .

Unfortunately it seems that this is indeed a compiler issue. When I run the simulation and change the value with the watch tool it runs as expected. :frowning:

Greetings,
Pim

Hello,

i have made a report about the issues with TIME to the offical B&R support.

Greetings
Michael Bertsch

Hi,

looks like this is not only a “TIME” issue.

If I try to Initialise a REAL Variable in my ST OOP Funcionblock I get an error also:
image

image

The message here is clearer, could be a similar root cause.

Since all of it is sill in BETA, I’m sure this will be fixed before release…

greetings,
Stefan

Hello,
The 2ten Level Support replied that the issue with the TIME-Datatype should be fixed with AS-Code 6.3.2. Which is, as far as i know, not jet released.
Automation Studio 6.3.2 only contained AS Code 6.3.1 again.

Greetings
Michael

1 Like