Mit den gleichen Problem habe ich mich vor 4 Wochen auch beschäftigt.
Mit Hilfe eines PHP Forums habe ich das so gelöst.
Ich musste den Wärmezähler von RTS-Automation auslesen.
Ich löse das mit eibd und PHP.
Code:
# EIS9 / DPT 14 4Byte IEEE-Gleitkomma (floating point)
case "9":
$binary = str_pad(decbin(hexdec($eib_data[24].$eib_data[25].
$eib_data[26].$eib_data[27])),32,"0",STR_PAD_LEFT);
#echo "bin= $binary \n";
# Sign Bit
$fb = $binary[0];
# Exponent
$exp = bindec(substr($binary, 1, 8));
#echo "expo= $exp \n";
# Mantisse
$m = bindec(substr($binary, 9, 23));
#echo "mant= $m \n";
#aus Sign Bit , Exponent u. Mantisse die Flieskommazahl zusammenstellen
$out = pow(-1,$fb) * (1+$m/(pow(2,23))) * pow(2,$exp-127);
# echo "out= $out \n";
$value = round($out,3);
# echo "<= $value \n";
break;



Einen Kommentar schreiben: