Codesys compiler warning, cannot clear and would like to

AlfredoQuintero

Lifetime Supporting Member
Join Date
Feb 2015
Location
Yokohama
Posts
1,551
Hello. I am trying to use the Codesys function FILE.DirOpen from the CAA File library. For the eError output parameter I declare a CAA.ERROR type variable, but the compiler shows the warning below.

Operand 'EDirOpenERR' (Impl)): C0327: Implicit conversion from one enumeration type (ERROR (caa file, 3.5.17.0 (caa technical workgroup))) to another (ERROR (caa types extern, 3.5.17.0 (caa technical workgroup)))

What would be the correct data type that I must use to clear this warning? o_O

Thanks for any hint.

20210801_CodesysCompilerWarning.png
 
It seems like you have multiple libraries with a definition for CAA.ERROR in your project and you need to specify which one to use when you define your variables.

I seem to remember a question about this on the CoDeSys forum a while back. You can search or ask here:
https://forge.codesys.com/forge/talk/
Thanks very much for this hint. I have checked the CoDeSys forum but I cannot find the related post. The search capabilities for the forum seem not so good, certainly less capable than the search in plctalk.net. For example, nothing shows up if I search for "C0327" or " CAA.ERROR".
In the past I have had issues declaring variables of data types defined in specific libraries registered in the project, and the workaround I found is to add a prefix to the data type with the name of the library. I cannot figure out the prefix for the CAA File library. The documentation does not seem to explain how to fully qualify a data type. Or maybe it does but I am unable to find such explanation. Like I had to do for RTS_IEC_RESULT data types in below code. I wonder how I can do the same for CAA ERROR data type.

20210802_Codesys_VaribaleDeclaration.png
 
Compiler warning problem solved after worstation reboot

OK, AustralIan and ndzied1, the warning disappeared after I had to reboot the workstation in which I am developing this program. Go figure.o_O So the program syntax was OK, but somehow the CoDeSys development environment was not correctly setup or updated. Sometimes when I add libraries to a project (or EDS files, GSDML files, etc.) it seems I need to reboot the CoDeSys development environment to fix compiler issues.

Thanks for the hints. Now I have realized that what I am trying to do may be much easier to achieve using CoDeSys persistence mechanisms. I may initiate another post regarding such functionality, which I have never used, in case I get stuck again.🍻

2021-08-02_CAA_ERROR_Fixed.png
 
AustralIan, as always you are right. With the FILE.ERROR data type the compiler warning disappears. The error is "wrong parameter" though. But if the directory exits there is no error and there is no compiler warning. Again and again, thanks for your patience. I would have expected:
NOT_EXIST | 5104 | Directory or file does not exist
As per table below:
https://product-help.schneider-elec.../core_CAALibraries/topics/file_error_enum.htm

20210820_CompilerWarning.png
 

Similar Topics

Hello New job on the horizon which will involve using Codesys. I've been doing my homework and getting on very well with it up to now. Can...
Replies
3
Views
2,274
Hello, I am using a Hitachi Micro EHV+ for a small project, and I wanted to have a Web visu, done with Codesys V3.5 SP13 Patch 2. I test the...
Replies
6
Views
294
Hello, I have a requirement to manage the text alignment dynamically. So, for example: 1. English Texts should be displayed from Left in...
Replies
0
Views
90
Hello, I am new to Codesys, and am trying to learn about it for a project we're developing. I've got a couple questions, but first a little...
Replies
1
Views
156
Hi everyone, as this is my first experience with Rockwell Software i would like to know what's the best way to make Enumerations?
Replies
10
Views
509
Back
Top Bottom