CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Thu Apr 25, 2019 7:30 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Feb 06, 2019 6:44 pm 
Offline

Joined: Wed Dec 05, 2018 3:00 pm
Posts: 11
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?


Top
   
PostPosted: Thu Feb 07, 2019 3:15 pm 
Offline

Joined: Wed Dec 05, 2018 3:00 pm
Posts: 11
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


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Thu Feb 28, 2019 2:25 pm 
Offline

Joined: Wed Dec 05, 2018 3:00 pm
Posts: 11
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)


You do not have the required permissions to view the files attached to this post.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited