Hi all,
I am new to Ethernet I/P communication protocol. I have found the address of the sensor that I want to read inside the datasheet. The problem is, where do I put these address that I have found inside the Codesys in order to read the value of the sensor? I want to read value Out3 and Out6.
the sensor is a thickness measurement sensor. The data should be analog input. But after i uploaded the EDS file, the datatype is automatically is in BOOLEAN. This is the EDS file provided by the supplier. Is there any step i can do to read the thickness?
Umairyamin,
Often times EDS files provide multiple connections. According to your screenshot of the output values bytes are paired r at o your sensor value will be read as an integer. The screenshot of the variable napping you shared only consist of one byte.
Can you confirm that your EDS connection is correct for your device so you can monitor the needed values?
The user made data type “Union” is excellent for this just as Michael had explained. You’ll right click on Application, add object, and select DUT.
Then you can create a variable for an array of four bytes and a variable for real within the DUT.
In your plc code you will then create a variable of the user made data type.
In your ethernetIP mapping, map this variable in its byte format sequentially:
Byte[0], byte[1], byte[2], and byte[3].
In your plc code, you can use the “real” portion of the union data type.
I followed exactly as he showed to me, and this is the result that I received. The value of the sensor should be at myValue.rOutputData right? I dont think I am getting the value that it supposed to be.