Couldnt Read Data Ethernet I/P, Datatype DINT

Hi all,

currently I am trying to read the data from a sensor using Ethernet I/P protocol. Uploaded the EDS file. I am suppose to read the address %ID2 to get the value of the sensor.

This is how I wrote the code inside codesys to call the address

Unfortunately, the results doesnt show anything. Can somebody suggest me what can I do in order to get the value reading?

Best regards,
Umair

I think that you need to assign variables and not access registers.

Hi Umair,

In CODESYS 3.5, addressing is handled symbolically, where variables are linked by names rather than fixed memory addresses, unlike the more manual address-based approach in CODESYS 2.3. This symbolic method offers greater flexibility, making your code more modular and easier to adapt across different applications.

  1. Create/map a variable name to the channel to reference the channel in your program. You can also expand the channel tree and map individual bits to a variable:


  2. The “Always update variables” option in CODESYS ensures that all variables, even those that are not actively being used in your logic, are updated and displayed in real-time during runtime. By default, CODESYS optimizes the update process by only refreshing variables that are actively needed by the program. Enabling this option forces all variables to be updated continuously, which is useful for monitoring or debugging purposes when you need to see the latest values of all variables, regardless of whether they are currently in use.

Best Regards,

1 Like

Hi Tomas,

Thank you for the info. Will try.

Thanks a lot for the info Jacob! Will try it.

Best regards,
Umair