Why can’t I connect to my Codesys logic?

Why can’t I connect to my Codesys logic? https://forum.weintekusa.com/uploads/db0776/optimized/2X/7/72d9b9bbc5cfb68f0b814d73a044f1a50ee7e202_2_1024x586.jpeg
none 0.0 0

A previous application is installed and running on the factory floor.
HMI screens communicating with ladder logic, starting & stopping pumps and machine functions.
Digital and Analog I/O values coming to the HMI screen OK.
I can make changes to the screens and download to the HMI successfully.
With EasyRemoteI/O I can view the modules, scan them, and see live values on my laptop just as they appear on the HMI.
But when I open Codesys ladder and try to login, I get an error message:
“No connection to the device. Please rescan your network”.

Pretty sure the IP addresses are all OK, laptop communicates with HMI, laptop communicated with IRETN module, and the ladder logic communicates with I/O.

Is this asking for a rescan of the I/O with Easy Remote I/O?
I can do this but not sure it is the problem. If it is needed, how do I give the Codesys a “fresh look” at the **.eriop file from Easy Remote I/O?

Thanks in advance for your help.

Another thought I had is to create a “New Project” file in the laptop and then just upload the Codesys app that is in there running.

If I create a new project, what type should I select. I picked the simplest format (I thought) but it still would not login to the online logic that was running.

I guess my “new” project must have enough structure to make a connection to the logic running in the HMI. What type should I use?

Regards, Mike Clifford

Hi @mike_c_56,

This message indicates that the Codesys gateway cannot connect with the Weintek’s built-in Codesys. In order to connect with Codesys your PC must be connected to LAN 1 on the HMI or LAN 2 while “Codesys login” is enabled. When you have time, please review the instructions below and advise if you are able to connect with Codesys using this method.

  1. Connect your PC to the HMI’s LAN 2 port and follow the instructions to enable “Codesys login” as shown within 6:10 - 8:18 of this tutorial: Link
    Note: The location of the “CODESYS login” function may vary by device type and firmware. The three possible locations of this option are shown below.
  • Note: The “CODESYS login” option may reside within the “Network” settings menu: Tutorial.

  • Note: The “CODESYS login” option may reside within the “CODESYS” settings menu under the “Modify Ethernet(LAN1)” option: Tutorial.

  • Note: The “CODESYS login” option may reside within the “CODESYS” settings menu within the web server. Here is a link to a post in which we demonstrate how to access the HMI’s webserver: Link.

  1. Within the Codesys project tree, double click “Device (Weintek Built-in CODESYS”:
    image

  2. Select the “Gateway” and click “Add Device…”:


    Note: If the “Device” tab appears as depicted below, please enter the HMI’s LAN 2 IP within the entry box on the far right and click the [Enter] key. After which, you may skip steps 4 - 6 as they will not apply.

  3. Within the following menu, enter the IP address of the HMI’s LAN 2 port:
    image

  4. The HMI will append to the Gateway instance:
    image

  5. While the HMI is selected, click on the “Set Active Path…” button:

  6. When finished, it should now be possible to login to Codesys.

Thanks Brendon, I will check the “Enable Codesys Login” setting.
My devices are connected thru a simple ethernet switch.
Below are sample connections and my specific machine wiring diagram.
Do these look OK to you? I will check the Settings when at the plant.

@mike_c_56,

Those settings appear to be fine, please let us know if you are able to connect with this device when at the plant.

Brendon, problem resolved. The “Enable Codesys Login” was off. I dont believe anyone turned it off. Plant personnel had not been into the HMI. However, when we first powered up the unit, we had an I/O alarm because one of the analog modules had no 24vdc connected.
This condition showed an alarm in EasyRemoteI/O.
Is it possible this condition caused the “Enable Codesys Login” to be switched off by the system??
To resolve this we wired 24vdc to analog module and switched the “EnableCodesyLogin” back on and the laptop connected immediately. Thanks for your help.

@mike_c_56,

Sorry for the delay, the “Codesys Login” feature will not be disabled by alarms that originate from connected IO. This feature can only be altered within the HMI’s settings menu or the webserver.

Good afternoon,
I have a very similar situation here: Running CODESYS on a cMT2108X2 with an EBPro application on the HMI side, when suddenly no connection between the two.

  • When I try to log in to CODESYS, I get the same “No connection to the device. Please rescan your network” message as the OP did.
  • When I try to rescan by entering the LAN2 address as in the above illustration, I receive “No device is responding to the scan request”
  • In the cMT2108X2 Setting menu, Enable CODESYS Login is on, however, CODESYS Status, Application Status, and Login Status all show “error”
  • In fact, I can’t even ping LAN1 from a command prompt, although LAN2 responds properly.

I’m just starting out with CODESYS, any suggestions would be appreciated!

–Mike Gibbons

Hi @EngIndSys,

The “error” message can occur if the existing project has a runtime error like an infinite loop or an invalid type conversion. Can you please follow the instructions within this post to “reset” Codesys, after which, you should be able to connect with this device.

Thanks for the quick reply, Brendon. I found that post shortly after posting my question. I ran the reset procedure - three times, actually - preparing to be embarrassed that I hadn’t searched the forum posts more thoroughly, but unfortunately it didn’t seem to solve the problem.

One thought: is a power cycle of the cMT required after resetting? I may not have done that. I’ll be back at the project tomorrow, and I did power everything down when I left today, so that may be a missing piece of the puzzle.

Hi @EngIndSys,

A power cycle should not be required after reset. Can you please verify that the IP address of LAN 2 did not change and that Codesys login is still enabled? Also, if possible please connect your PC to LAN 1 and attempt to login using the IP of LAN 1 within the “Device” tab of Codesys:

Good morning Brendon,

  • I powered up the system this morning and checked cMT settings first thing; all the error messages had cleared.
  • After logging in to CODESYS and downloading, I couldn’t communicate with my iR-ETN or a connected EtherNet/IP device.
  • I discovered that the reset (understandably) had cleared LAN1 address and set it to DHCP. LAN2 address was still intact. After fixing LAN1, everything’s working perfectly.
  • I’m a little stumped as to what caused the original problem, but this system is in the early stages of development, so I suppose anything could have happened.

Thanks again for your help!
–Mike

1 Like

@EngIndSys,

Happy to help, please let us know if you have any other questions during development. Have a great weekend!