Skip to content

Instantly share code, notes, and snippets.

@hasanbasri1993
Last active November 14, 2020 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasanbasri1993/1982f8f6aab64159e98fc342b4fa0792 to your computer and use it in GitHub Desktop.
Save hasanbasri1993/1982f8f6aab64159e98fc342b4fa0792 to your computer and use it in GitHub Desktop.
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