Hopefully can get some reply from expert member. Got urgent case.
It seems like you are asking about IEEE 754 double-precision binary floating-point format.
The IEEE 754 standard specifies a binary64 as having:
Sign bit: 1 bit
Exponent: 11 bits
Significand precision: 53 bits (52 explicitly stored)
The bits are laid out as follows:
I don't completely get your question. Are you planning on doing the conversion or are you asking for the functionality in PI OPC UA client?
Yes, you are correct. I asking for the functionality in PI OPC UA client to do the conversion. Example do the arithmethic operation.
I short, the first 3 bytes of the first number give the exponent, except the first bit for sign. So it should be arithmetic to derive the floating point.
The fraction is easy:
- fourth number
- + third number multiplied by 10^4
- + second number multiplied by 10^8
- + last four bits of the first number
It's a bit early to do the math for the first number, and likewise for stripping the sign. I'll need a coffee first. Shifting or subtracting powers of two, but my binary math is a bit rusty...
Thanks for your feedback. I already know how to do the calculation for this conversion. But i want to know if the PI POC UA Client have function/features to do this conversion directly. For example. the PI OPC UA Client get the data in 4 integer. How can i do the conversion?
2 of 2 people found this helpful
Assuming you use the PI Connector for OPC UA:
The connector does not have provisions to change the data received. Thus if your source system presents 4 integers, then 4 integers is what you get. The integrator cannot change this, so you must transform the data afterwards.
Best case you can detect these situations in your asset data, and extend the asset model by the integrator to add this automatically (watch limitations: https://livelibrary.osisoft.com/LiveLibrary/content/en/con-opcua-v4/GUID-15663C0E-146B-43A4-9A25-E17514B97296)