Problem Upgrading Project from AS4.0 to AS 4.7 - Automation Runtime - Compiler Erros

Hello everybody,

first time posting here with an issue I currently have. I have not yet contacted B&R Support but might have to eventually.

The problem I’m facing is with a project I have to upgrade from AS4.0 to AS4.7 and additionally the AR Version. The reason is the project does use a X20CP3585 which is getting replaced with an X20 CP3685

As a first step I upgraded the AS Version to 4.7 (Opened project and converted)

  • This works without issue. I can compile and download to the existing X20CP3585
  • I did not change the AR Version here!

But for the 3685 i also have to upgrade the AR Version and as soon as i change it to for example F4.73 i get compiler errors like “field ‘Stop’ has incomplete type”:

Please note this is happening without yet changing the PLC in the project Hardware Tree.

I tried to clean up the configuration and also update the library declarations.

However none of that did really help. So appreciate any inputs on how to get this going :slight_smile:

I might end up having to contact B&R support but wanted to give this a try in case it might be useful to others in the future.

Thank you

Robert

In the output results, scroll to the right and check (include in the picture) the file and error number columns, this will help pinpoint which file contains the issue and what the compiler sees as the issue.

Based on the error description, I’m guessing it might be OPC or VC4 related as those features/functionalities kept track of the variable type in their own config files as well.

Attaching the right of the output window.

It seems it has problems with the header files.

Its still interesting as to why there is no problem with older AR Version compared to newer ones..

Hello,

There was one Thread in Community with this error Text
Sharing variables between PLC programs

Do you use c or c++ Programs in your Automation Studio Project or only IEC Languages.

Greetings
Michael

Hi Michael,

thank you for the link. The project unfortunately does use IEC and C both.

However the C Code is only used for very few tasks and all others do use IEC. The errors also do appear to only appear in libraries done with ST.

Would it make sense to disable all the tasks and libs done in C for testing if this could resolve the issue? Obviously would require a solution to the C part but at least we would know where the culprit is.

Thanks!

Most common mistake is missing dependencies on your user created libraries. Check if the types that are complaining uses also types from other libraries. And check the order of the types definition.

2 Likes

Hello,

An additional Topic i remember which has been changed for Datatypes in IEC was that they do not allow empty Structs anymore. This was allowed in the past, but now you have to have a element in the struct, at least a place holder.

But i think it will have more to do with the Default include mechanism.
I only know that there are some Options in Automation Studio Settings about it, were you can change the behaviour. But as you mentioned the Errors came only with the new AR-Version not with the AS-Version. I am not sure if it is right to search here, as this would be AS-Spezific.

If you are in time need you can send Project to local B&R for analysis. If you still have time, you can continue this thread with more updates on your findings.

Greetings
Michael

1 Like

Hi Michael, Job,

thank you again for the answers!

I do suspect a problem with the dependencies of the libraries (as Job mentioned) but so far my efforts did not really get me a satisfying result (if any :slight_smile: )

I did try to add the declarations done in other libs in the Properties / References window for the libs complaining but eventually ran into a circle condition so quite lost at this point.

I have opened up a ticket with B&R Support now where they most likely ask for the project to be sent but will have to wait for a upload invite as its quite big even if zipped (> 200MB) however i will update this thread with any updates and hopefully a solution for future reference as I’m sure I will not be the only one facing this issue.

Thank you very much for the help so far!

2 Likes

Hi all,

Good news is I got to a resolution thanks to the (as always) outstanding support from B&R Support.

There were several things necessary to do to get this project working again on my new X20CP3685 which I will summarize in an additional post hope it will be helpful for others in the furutre. Just wanted to give a quick update.

3 Likes

Here are the steps I had to take to make the project work with the Upgrade to AS4.7 and from a X20CP3585 to a X20CP3685.

First step was to convert the project from AS4.0 to AS4.7 which did not cause major issues.

Afterwards i had to upgrade the AR Version as stated in my initial post where the errors appeared.

As a first resolution which allowed to compile the project was to deactivate the “Use default ‘include’ mechanism for ANSI C/C++ programs”:

This works in my case because the Ansi C sources did have all includes done manually.

However during downloading i still was not able to make this run on my new PLC being given this error:

This was caused by multiple issues with some of the B&R Libraries did not update automatically but did stay with the “old” version:

This was also mentioned in the Logger of the plc that its unable to load certain libraries (even mentioning the names like ASiCMP). The solution (again thanks to B&R Support) was to simply delete and re-add the libs to the project. After a rebuild my new plc finally got into a run status! Success

BUT B&R Support mentioned that whenever we want to go to AS6 it would be better to adjust the project accordingly to make the default include mechanism also work.

This was done by manually adjusting the dependencies of our own libs. Right click on the library / Properties / Dependencies and add the necessary libs as dependency. This was a bit of a problem additionally because with the change to the new AR Version the compilation is more strict and in one case we had a circle dependency of two libs. This was fixed by declaring the types in a new additional typ definition. With this the “field ‘xyz’ has incomplete type” errors went away! again success but i still received “Array type has incomplete element type”:

This was the last problem i had and this was caused by the fact that in “Logical View” i had the “Global.typ” file AFTER the “Global.var” File. According to B&R during the BUILD of a project the files get parsed top to bottom. So the solution was to simply move the typ file before the var file so the build can succesfully find the types.

With all this its now possible to compile the project and load to the plc without issues.

1 Like