Incomplete Type Error for Library Function Blocks

Hi, I have a library function block within a library function block. When I originally implemented this everything seemed to be fine. I made it a VAR_OUTPUT

Then when I closed and reopened AS, every time I build the project again, I am having
“field ‘fbA’ has incomplete type ‘FunctionBlockA’”
and
“field ‘fbA’ has incomplete type” and it all points to the Temp folder.

image

Hello Adam,

Have you tried cleaning your project?:

Project / Clean configuration / selecting all checkboxes

After this i recomend doing a rebuild.

Regards,
Tobias

This is possibly caused by a missing dependency. When using C this is more strict then using pure IEC languages.

So are u using a type from an other library ? If so add that to the dependency.
If not could you post your fub interface.

Yes, first thing I did before posting haha.

Oddly it started working again until now where the error is occuring again.

Sorry could you describe what you mean?

As example shown the screenshot.
The user library “General” has a function block with a internal variable which is a function block from the library “brsystem”. To always compile correctly and not based on luck the dependency should be defined in the property of your user library.

Hi @adamkujawinski,

Do you have a global data type which includes an array with a non-zero starting index?

Here’s an example. I had this issue happen to me before here.
The conditions are:

If you start to mix C and IEC programs, this behavior will start to occur. A header file DoorLib.h cannot be automatically generated for C programs when there’s a non-zero starting index array.

You could either revise the scope of your data type to not be global, or include a starting index of 0.

Hi, I found a solution which worked for me, and looks to be much simpler.

image
simply deploying the nested library above the library I am using has completely solved the issue.

I guess your solution is more properly articulated, as if these two libraries happen to reference each other, then we have a chicken and egg issue.