
Re: Convert 4 integers value to double float value
Syahril Aug 15, 2018 7:24 AM (in response to Syahril)Hi all,
Hopefully can get some reply from expert member. Got urgent case.
Thank you. 
Re: Convert 4 integers value to double float value
tramachandran Aug 15, 2018 2:10 PM (in response to Syahril)It seems like you are asking about IEEE 754 doubleprecision binary floatingpoint 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:
Source: Doubleprecision floatingpoint format  Wikipedia
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?

Re: Convert 4 integers value to double float value
Syahril Aug 16, 2018 2:47 AM (in response to tramachandran)Yes, you are correct. I asking for the functionality in PI OPC UA client to do the conversion. Example do the arithmethic operation.


Re: Convert 4 integers value to double float value
Roger Palmen Aug 16, 2018 5:44 AM (in response to Syahril)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...

Re: Convert 4 integers value to double float value
Syahril Aug 16, 2018 6:26 AM (in response to Roger Palmen)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?

Re: Convert 4 integers value to double float value
Roger Palmen Aug 16, 2018 9:18 AM (in response to Syahril)2 of 2 people found this helpfulAssuming 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/conopcuav4/GUID15663C0E146B43A49A25E17514B97296)

Re: Convert 4 integers value to double float value
Syahril Aug 20, 2018 1:45 AM (in response to Roger Palmen)If the PI connector OPC UA cannot do the conversion functionality, do you have any suggestion of OPC UA client can do similar application with the conversion functionality to convert the 4 integers into 1 double float data? The last platform to collect data is OPC UA Client. No other platforms afterward.

Re: Convert 4 integers value to double float value
Roger Palmen Aug 20, 2018 6:15 AM (in response to Syahril)Nothing that i know of, except for building your own wrapper. But that seems a bit too much of an effort compared to the problem.
Is there is a specific reason you need to remediate this before reading in the data using the integrator, instead of after reading in the data? The latter should be not too difficult to build.

Re: Convert 4 integers value to double float value
Syahril Aug 23, 2018 2:06 AM (in response to Roger Palmen)My reason is the application are direct conversion from 1 controller (flow computer) to the server. But the conversion is about the communication. From FC(flow computer) is MODBUS RTU and to the server (using PI OPC UA Client). Between that, we add 1 device to do communication conversion. The device cannot show the double float data (64bit). Thats why we do split from the FC (1 double float data to 4 integers data). And the device can pass through the data to server(PI). But now the server(PI) must do the conversion data (4 integers data to 1 double float data). Hope you can understand my requirement.



