Undefined reference error in C - Language task for LoopConR Library

Dear all,

I am getting an error of undefined reference to ‘LCRMovAvgFlt’ Function block. I have added the logical part as per the example given in the help file. How can this error be resolved. It occurs with LoopCont and LoopConR both the libraries.

PLC - X20CP0410
AS Version - AS4.12.6
GCC Version - V4.1.2

Similar error occurs if GCC version is upgraded.

PFA Screenshot of error and do let me know what things can be checked for the same.

image

Hi,
this is an error from Linker process.
You normally get this if you call a function but did not include the library into Logical View.
Did you ? It’s difficult to analyze without to have the source …

if you are new to B&R system find a simple example attached how to call this function block in ANSI C

xxx.zip (219.6 KB)

Using function blocks in ANSI C / C++

That is not completely correct. You would get a compiler error if the library was not deployed in the Logical View and you get a linker error if it is present in the logical view but not deployed to the software configuration. (*.sw file).

You would also get this error if the library was not compiled / compatible for this target (SG4 ARM if not simulation was used).

I suspect that the issue here is that the LoopConR version used here is smaller than V4.01.0 and therefore does not yet have SG4 ARM support.

Please remove the library from the logical view and re insert the version V4.x and then make sure to deploy it in the Software Configuration. This will fix your issue.

That is right.
But AS 4.12 in this case does an ‘automatic’ deployment.

Manual deployment:

If you now remove the ‘LoopConR’ form Software View the next Rebuild results in:

(and no compile error)