Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

How can I convert a 2 word modbus address to real?

2014-10-31
2014-11-22
  • byrgiel1977 - 2014-10-31

    Hi.
    Im new to this CodeSys thing. (SoMachine)
    Right now i'm trying to read out values from a energy meter, but cannot get the conversion to work..

    Im trying to read out the Frequency (50 Hz). Value is located in modbus address 4113-4114. I have mapped these addresses as %IW0 and %IW1.

    IW0=01000010 01001000 = 16968
    IW1=00000000 00000000 = 0

    Now I need to get these words converted to a REAL value. Anybody that can help?
    Real should be: 01000010 01001000 00000000 00000000

    Morten

     
  • shooter - 2014-11-22

    make it a double word and convert it to real is one answer, however what type is your real?
    look at oscat.de for a big library with all types of conversions.
    you can also use scale with lowest value and highest.

     

Log in to post a comment.