Industry Online Support
Technical Forum
4/12/2019 12:40 PM  
Joined: 3/28/2010 Last visit: 7/23/2019 Posts: 476 Rating: (111) 
Mag6000 Modbus manual: search Siemens site for document A5E00753974 You can read the Absolute Volume flow in m3/s units in register (4)03003 as a floating point value using Modscan, but you need to get away from displaying single register values in decimal, because single register decimal values are meaningless when the value is a floating point. Modscan will convert the value into binary, decimal (integer), hexadecimal or 32/64 bit floating point decimal values, by using the buttons. In fact, it allows you to see the value in either one of two floating point formats; one will be correct, the other will be an incredibly outofrange value (doesn't make sense)  it's same bits, but interpreted differently. To read the flow value in floating point, you need to read 2 Modbus registers to get the full 32 bits. The graphic below highlights (circled in red) the two buttons used for displaying either of the two formats for floating point alues. Use the button that gives you the correct (makessense readable) value in floating point for register 3023, a holding register. Use your correct device ID and read two registers. [snip] 32 bit Floating point has a known problem dealing with when (relatively) small incremental values being added to a large number, which what happens with totalizers. I haven't worked with fractional numbers like the totalizer value in m3/s 0.000xxxx, so I don't know where the issue arises with fractional values. When working with whole numbers, values over 16,000,000 are recognized as error prone in 32 bit floating point. Up to 16,000,000 is OK, but above that is problematic. A 64 bit (8 byte, 4 Modbus register) long integer totalizer value does not have the issues that 32 bit floating point has, dealing with adding incrementally small numbers to a large value. So the totalizer value is also available in register (4)03023 as a 64 bit long integer. But you'll need to keep track of the decimal point, which is in register (4)02914 to know how to interpret the long integer. And to interpret a long integer, you need to know its format. Is it big endian or little endian? I don't know and Modscan does not offer a 64 bit long integer display mode to find out. Siemens did not include the 64 bit long integer in its list of data formats in Table B7 on page 73 (pdf). Maybe someone here on the forum knows from experience. 
Last edited by: Jen_Moderator at: 4/12/2019 12:51:07 PMRemoved link and added file as an attachment. 

6/1/2019 5:59 PM  
Joined: 3/28/2010 Last visit: 7/23/2019 Posts: 476 Rating: (111) 
The totalizer value in the Mag6000 register (4)3015 is a 64 bit IEEE754 floating point value, also known as LREAL (Long Real) value. The original screen shot from Modscan32 in post #4 shows the value as four registers (8 bytes in decimal format) (link to graphic reposted below) https://i.postimg.cc/V6HYG25z/Totalin3015is8byte4register64bitFPnotinteger.jpg I used the online converter at http://www.freetestonline.com/binary/signed_converter.html using the 'signed' button and the "Dec2Hex" function to convert the decimal values to hex: 16289 decimal = 3FA1 hex 21880 decimal = FFFF AA88 = AA88 hex 3882 decimal = 0F21 hex 4249 decimal = FFFF F677  F677 hex http://www.freetestonline.com/binary/signed_converter.html Dec2Hex The leading FFFF bytes are abandoned, leaving only the low order bytes for convertions from negative decimal values Stringing all four hex values together results in a 64 bit value = 3FA1 AA88 0F21 F677 (spaces only for clarity) The online converter floating point converter at https://www.binaryconvert.com/result_double.html?hexadecimal=3FA1AA880F21F677 shows 64 bit Modbus value converted to the decimal floating point value of 3.45042^2 or 0.0345042 as shown in the display https://i.postimg.cc/KjLdPWMq/3FA1AA880F21F677equals003452in64bitIEEEFP.jpg This does not answer the original question about how to deal with 64 bit floating point Modbus values, but it shows that  the value in the multiple 64 bit registers does correspond exactly to the displayed value in the Mag6000 display  using decimal values is useless; conversions of any value need to be done in binary or hex 
This contribution was helpful to2 thankful Users 
Follow us on