Last active
November 14, 2020 01:48
-
-
Save hasanbasri1993/1982f8f6aab64159e98fc342b4fa0792 to your computer and use it in GitHub Desktop.
Membaca 32 bit Float Dari MODBUS Menggunakan NodeRed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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