Code for reading 4 address to get 1 value of sensor

Hi Umair,

u can use an UNION DUT for this.

  1. You have to add an DUT
    image
  2. Fill it with your data structures, it is important to know tha every Variable in this union shares the same datastorage. for example you can write your REAL value, by accessing the array of bytes.
    image
  3. Instanciate the union in you POU (PLC_PRG, … ) and write your values. Sometimes you have to change the write order of the array, to change Byteorder of the REAL value.
    image
4 Likes