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.



