8/17/2011 5:46 AM | |
Joined: 11/21/2007 Last visit: 3/31/2025 Posts: 2326 Rating:
|
Hello I am reading Energy Values from PAC3200 over Modbus RTU. These are in 64bit "Double-Floar" format. I feel I may be able to display these values in WinCC using the "DOUBLE" format of Wincc. ( Have not tried yet ) However I also want to calculate net energy consumed in a given period by subtracting two energy values. How can I convert 64bit float to 32 bit float or subtract two 64 bit float nos. ? Thanks Navnag |
Last edited by: Navnag at: 8/17/2011 5:46 AMThere is no such thing as the last bug in a program |
|
8/17/2011 9:33 AM | |
Joined: 9/6/2008 Last visit: 5/7/2022 Posts: 1121 Rating:
|
Hi Well you could look into this FAQ https://support.automation.siemens.com/WW/llisapi.dll/25629271?func=ll&objId=25629271&objAction=csView&nodeid4=34677186&cspltfrm=0&cssw=0&csbinh=2&lang=en&siteid=cseus&aktprim=4&extranet=standard&viewreg=WW&load=content&start=31&csSort=-DOCDATUMBEITRAG&subtype=136000 But you will need AV card for this, as it is charged, In that you have a block to convert 64 to 32 &vice versa. Have fun... |
Jazz |
|
This contribution was helpful to
1 thankful Users |
8/17/2011 10:23 AM | |
Joined: 3/21/2006 Last visit: 3/30/2025 Posts: 10239 Rating:
|
|
8/17/2011 2:07 PM | |
Joined: 11/21/2007 Last visit: 3/31/2025 Posts: 2326 Rating:
|
Hello Tagolover Thanks for the info. I had once purchased this library for S5 to S7 Floating point nos. conversion. I had almost forgotten that this library also contains this function. This should be useful especially as the PAC manual mentions that Max Energy value ( Even in 64 bit is 10E12 , Values upto 10E12 should be convertible to 32 bit Float without significant loss of accuracy ) Dear Umencho, Thanks to you too. I had already seen this post. However this does not seem to be relevent to my requirement. I think I will go ahead with the 64bit to 32bit conversion blocks suggested by him. Cheers Navnag |
There is no such thing as the last bug in a program |
|
This contribution was helpful to
1 thankful Users |
8/17/2011 4:00 PM | |
Joined: 9/27/2006 Last visit: 4/3/2025 Posts: 12345 Rating:
|
Hello Navnag; OSCAT.de proposes a solution also for handling double-precision REALs in S7 CPUs: 8. Arithmetics with Double Precision 8.1. Introduction Floating point numbers are stored in the format REAL. A common data format according to IEC754 used a 24 bit wide mantissa and an 8-bit exponent. This results in an accuracy of 7-8 digits. Usually this is for applications in control technology more than sufcient, but in certain cases can lead to a problem. A typical case can which be solved with single-precision only inadequate is a consumption meter. If you want to several Mwh (megawatt hours) of total consumption adding up, taking a smallest power of 1 mW (milliwatt) at a distance of 10ms fairs and so you need a resolution of 3.6 * 10^7 (equivalent 10MWs) and it would be a do add up 1* 10^-5 W's. To do this it requires a resolution of 12 digits. The solution implemented by OSCAT is REAL Double precision and has a resolution of about 15 digits. The implemented data type REAL2 consists of R1 and RX, RX is here the value saved the first 7-8 points as Real and the rest in one real R1. This data type has the advantage that no conversion of REAL2 to REAL is needed, rather, the RX is rather part of single REAL value. Attachmentoscat_basic_doc_332_DouleReal.pdf (2011 Downloads) |
This contribution was helpful to
4 thankful Users |
8/17/2011 7:30 PM | |
Joined: 11/21/2007 Last visit: 3/31/2025 Posts: 2326 Rating:
|
Dear dchartier This can be very useful for my application. Thanks Navnag |
There is no such thing as the last bug in a program |
|
8/22/2011 8:59 AM | |
Posts: 2348 Rating:
|
Interesting implementation, although they broke IEEE rules, because 64bit float according to IEEE has additional bits for mantissa (10 instead of 8). But on implementing IEEE standard they won't achieve conversion-free handling between REAL and REAL2. So i really doubt if double-float from PAC3200 would be "understood" correctly by OSCAT functions. On other other hand on using Siemens block you can work only with single-real. I've implemented 64bit math myself to solve such problem (+,-,*,/,shift and conversion of 64bit variables), but i'm unsure if i can place it here. |
Last edited by: Aret at: 8/22/2011 9:05 AM |
|
8/26/2011 9:29 AM | |
Posts: 15 Rating:
|
I have faced the same problem for a long time, and not only Siemens. I have asked many vendors why there is not a DINT counter available throug the profibus and modbus. I have the same problem on MP377 panel connected by ethernet and Profibus S7-300 plc's. The counter float is not suitable to count for a long time without reset. I have one PAC on a transformer 2500KVA the counting is done in Watts a is counting fast. I have found a "dirty" solution Wire the contact output to the contact input and you can use the universal counter as kWh counter The output can be scaled to puls per kWh and for high load count in mWh The Universal count is send as DINT max counting signed is 2.147.483.647 or unsigned 4.294.967.295 so this take a while before i need to reset the universal counter. |
11/28/2011 4:19 PM | |
Joined: 3/21/2006 Last visit: 3/30/2025 Posts: 10239 Rating:
|
How can you process 64-bit floating-point numbers in STEP 7 V5.5 with a SIMATIC S7-300/400 CPU? |
This contribution was helpful to
6 thankful Users |
5/18/2015 2:20 PM | |
Joined: 9/3/2014 Last visit: 3/13/2019 Posts: 4766 Rating:
|
|
This contribution was helpful to
1 thankful Users |
We are working on a new user interface with better overview and more relevance.
To explore the new Forum, you can follow the textbox in the right column, which will lead you to the corresponding page in the new Forum. Alternatively, you can start from the main page by following this link:
https://sieportal.siemens.com/en-ww/support/forum
In the coming days, we will update the configuration step by step, so that you are directed to the new Forum by default. The “classic Forum” will remain available for all known functionalities alongside the new one.
We are thrilled to finally share the future of our Forum with you. Thank you for your commitment!
Kind regards,
the Forum Support Team
Follow us on