CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

C0077: Unknown type: 'NULL'
https://forum.codesys.com/viewtopic.php?f=21&t=9504
Page 1 of 1

Author:  truly_bent [ Wed Feb 06, 2019 6:44 pm ]
Post subject:  C0077: Unknown type: 'NULL'

I have been copying some code into the 'Raspberry Pi SL' platform and ran smack into "C0077: Unknown type: 'NULL'" errors. How is this even possible? This same program (https://1drv.ms/f/s!AgeXD5P3kwJIg2tNBt0q05Y4lxuu) compiles on a standard platform without any problems.

I'd really appreciate some advice on this. Is there some compiler switch which enables recognition of NULLs?

Author:  truly_bent [ Thu Feb 07, 2019 3:15 pm ]
Post subject:  Re: C0077: Unknown type: 'NULL'

Did a little more work porting the eFFL Fuzzy Logic library to the RPi platform. By copy/pasting everything individually into the new platform, i found that the compiler had no trouble with NULLs. Everything seemed cool - right up to the moment i switched on the "Use dynamic memory allocation" (see attached pic). Suddenly, NULL is no longer recognized. Is this a compiler bug?

I am adding a link here to the project file (RPi_Fuzzy_eFFL_000 (Unknown type NULL).project) in case anybody is curious. --> https://1drv.ms/f/s!AgeXD5P3kwJIg2tNBt0q05Y4lxuu

The intent here is to provide an open source Fuzzy Logic controller for the IEC 61131-3 (CODESYS) ST language. If I/we can get past this NULL issue then the controller is free to incorporate into the RPi, as it is the Standard platform (see LICENSE).

Any ideas appreciated

Author:  truly_bent [ Thu Feb 28, 2019 2:25 pm ]
Post subject:  Re: C0077: Unknown type: 'NULL'

So, the good folks at CODESYS help sent the following in response to my ticket:

Your problem is that 'NULL' is declared in two different libraries (CDS_MemMan, SoftMotion_CNC_Constants) , both of which do not use the 'qualified_only' attribute. Therefore, there are ambiguous messages for NULL and the related-position messages to track down the problem. In your case, you have to qualify the 'NULL' you want to use.

A bit cryptic, but the answer to the problem is in there. I was able to find the CDS_MemMan library definition of NULL, but i wasn't able to find SoftMotion_CNC_Constants exactly. However, I did find another definition for NULL in the SM3_Basic library. The only way i have been able to 'qualify' anything in the library properties was the 'Only allow qualified access to all identifiers' checkbox (see pic). One or the other library needs to be checked off.

This has broken the log jam. The project now compiles without errors, downloads to the simulation, and runs. There is, however, still some ambiguity going on somewhere because, in my case anyway, every NULL is still underlined and pops up an "Ambiguous use of name 'NULL'" message. That doesn't stop compilation, and for now i'll take that as a win.

Find the new revision of the Fuzzy RPi project (Fuzzy_eFFL_RPi_010.project) at: https://1drv.ms/f/s!AgeXD5P3kwJIg3Y4BOsecXPf920K

Thanks to the CODESYS folks for the direction.
8)

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/