How do you resolve build error C0035 and C0046? (Identifier not defined)

How do you resolve build error C0035 and C0046? (Identifier not defined)
none 0.0 0

Hey there. I recently started putting a project together and have been going through the tutorial videos. I have figured out a few hurdles and am now stuck on generating a simple PLC program. The last few steps I followed along with in the video was creating the “symbol configuration” under “application” and then when selecting the PLC_PRG, it builds with no errors, but when I generate code under “build” tab, i get a ton of errors and they are all similar:

[ERROR] Testing: C0035: Program name, function or function block instance expected instead of ‘Ethernet.Initialize’
[ERROR] Testing: C0046: Identifier ‘Ethernet’ not defined
[ERROR] Testing: C0035: Program name, function or function block instance expected instead of ‘Modbus_TCP_Master.Initialize’
[ERROR] Testing: C0046: Identifier ‘Modbus_TCP_Master’ not defined
[ERROR] Testing: C0035: Program name, function or function block instance expected instead of ‘iR_ETN_192_168_0_212_.Initialize’
[ERROR] Testing: C0046: Identifier ‘iR_ETN_192_168_0_212_’ not defined
[ERROR] Testing: C0035: Program name, function or function block instance expected instead of ‘Ethernet.Initialize’
[ERROR] Testing: C0046: Identifier ‘Ethernet’ not defined
[ERROR] Testing: C0035: Program name, function or function block instance expected instead of ‘Modbus_TCP_Master.Initialize’
[ERROR] Testing: C0046: Identifier ‘Modbus_TCP_Master’ not defined
[ERROR] Testing: C0035: Program name, function or function block instance expected instead of ‘iR_ETN_192_168_0_212_.Initialize’
[ERROR] Testing: C0046: Identifier ‘iR_ETN_192_168_0_212_’ not defined
Build complete – 12 errors, 0 warnings : no download possible!

Any help would be appreciated. I’d really like to overcome all of these basic problems so I can make sure this stuff will work for my project. Thanks!

-Clinton

Hi @Clinton,

Can you please advise what version of Codesys you are using to design your project?
For example: I am currently using version 3.5.17.3

Sure, I was having trouble importing the I/O device data with the newest version, so I saw to try 3.5.10.30 and that helped that issue, but now stuck on this one. Do you think the newer version is still causing issues while trying to use 3.5.10.30?

I am happy to hear that switching to the recommended version of CoDeSys helped! Can you clarify your statement above? The CoDeSys version that you initially used to design your application should not cause any issues with your device now that you have switched to the recommended version. Does the IDE display any new error codes when you attempt to download the application?

No. I’m sorry but I’m having the issue ON the recommended version. 3.5.10.30.

All I meant is that perhaps there are packages that 3.5.10.30 are referencing from a newer version and it’s why I’m getting all of those errors above?

Why does generating code give me errors about all of the devices not being defined?

Have you installed Weintek’s Codesys package? Also, can you please check that you are using the correct device drivers within your application? To confirm that you are using the correct drivers within your project, please see page 7-11 within this document.

Okay thanks. I installed the package and will try again. Unfortunately, that second link isn’t working because I don’t have access to the sharepoint you guys use.

My apologies, please try this link and advise if you can access our technical note.

Okay Brendon, we are getting somewhere.

I believe all the drivers are present, I was just using the different versions of ethernet/modbus… etc…
Now I only have an issue where just the Ethernet is getting an error.

[WARNING] Test: Library Manager [Device: PLC Logic: Application]: C0100: Library IoDrvModbusTCP, 3.5.10.0 (3S - Smart Software Solutions GmbH) has not been added to the Library Manager, or no valid license could be found
[ERROR] Test: Application [Device: PLC Logic]: C0077: Unknown type: ‘IoDrvEthernet.IoDrvEthernet’

I went to the library manager to try and download missing libraries and it said the download failed.
It’s the only error I’m getting now.

Okay… got it. Do you happen to know what this symbol means next to the iR_ETN? Apparently something isn’t working there because I’m testing an output stuck on and it doesn’t appear to be on on the actual device when running the program.

image

I did notice through the tutorials that on the ethernet screen on the Weintek HMI settings screen, that the “enable CODESYS login” option isn’t even there. I assume that’s okay though because it still allowed me to download to it…

:frowning:

Maybe it’s just a bad card.

Oh my goodness. I don’t know why, but I guess when I checked “auto-reconnect” on the modbus_TCP_Master the error went away and it started working.

Thanks for all your help! Have a good one.

Hi @Clinton,

I am happy to hear that you were able to identify the issue! The “Auto-reconnect” setting is required when establishing a connection to the iR-ETN. This is mentioned within the iR-ETN user manual. If someone reading this post is experiencing a similar issue, please perform the following:

  1. Double click on the “Modbus_TCP_Master” within the device list:
    image

  2. Ensure that “Auto-reconnect” is enabled: