Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Membaca 32 bit Float Dari MODBUS Menggunakan NodeRed
msg.payload = [0, 16833]; // hapus ini untuk melihat menkorvensi dari modbus
let pay = msg.payload; // mengambil data dari modbus
const buf = Buffer.allocUnsafe(4);
buf.writeInt16BE(pay[0],2);
buf.writeInt16BE(pay[1],0);
msg.payload = buf.readFloatBE(0);
return msg;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment