We have introduced some command calculations for the adapter HART protocol. It also contains the related content of the returned data computation. Here we will focus on this part of knowledge.
Return data computing
After repeated experiments and reasoning, the formula based on HART protocol data is derived.
The following describes the current and liquid level.
Calculation of current value:
- dlH=((parseddataHart[13] + parseddataHart[12] * 256.0 +(parseddataHart[11] & 127) * 65536.0))/8388608.0 +1;
-
- dlD=(((parseddataHart[10]*1) & 127) * 256 + ((parseddataHart[11]*1) & 128)) / 128 - 127;
Calculation of liquid level value:
- ywH=((parseddataHart[18] + parseddataHart[17] * 256.0 +(parseddataHart[16] & 127) * 65536.0))/8388608.0 +1;
-
- ywD=(((parseddataHart[15]*1) & 127) * 256 + ((parseddataHart[16]*1) & 128)) / 128 - 127;
Start the serial port debugging program or send related commands by the upper computer to convert the data. The client can analyze the collected data and obtain useful values.
Send the calculated data to the corresponding storage area. You can process the data as needed. You can also extract useful data volumes based on your needs. For specific reading commands, see related technical books or obtain the instrument-specific protocol from the HART instrument manufacturer and dealer.
As long as the RS-232 is supported, the operating system and the upper computer configuration software can easily communicate with the HART instrument.
The conversion of this HART protocol adapter is completely transparent. It only processes the problem of mutual conversion between the HART signal and the serial port signal. It works at the application layer and is only applicable to products that comply with the HART protocol, it has nothing to do with specific suppliers. Reading commands and data does not have any relationship or impact.