Codesys has complete control over LAN-1, please make sure that your PC is connected to LAN-1 or that you have “Codesys Login” enabled on the HMI. While “Codesys Login” is enabled, you can connect to the HMI and Codesys using LAN-2. To enable Codesys Login, please read this post: How to enable Codesys login

Once finished specify the HMI’s LAN-2 IP within the “Device” communication setting in your Codesys project. Note: Codesys has no control over LAN-2.