Power factor new calculation; new bytesToInt function with uint and bigendian

This commit is contained in:
rasta5man 2025-08-06 12:00:17 +02:00
parent 5540cee8ec
commit 1012544193
2 changed files with 114 additions and 127 deletions

View file

@ -2616,7 +2616,7 @@ exports.install = function(instance) {
//účinník
else if (register == 77) {
let power_factor = Math.cos(bytesToInt(bytes) * 0.1).toFixed(2);
let power_factor = Math.cos(bytesToInt(bytes) * 0.1 * (Math.PI / 180)).toFixed(2);
values["power_factor"] = Number(power_factor);
}
@ -2629,8 +2629,7 @@ exports.install = function(instance) {
//energia
else if (register == 79) {
let energy = bytesToInt(bytes);
//Energiu treba reportovať v kWh -> delit 1000
values["energy"] = energy / 1000;
values["energy"] = energy / 1000; //energia v kWh -> delit 1000
}
//doba života