MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / modbusWriteRegister

Function modbusWriteRegister

app/rcc/api/prelude.js:126–129  ·  view source on GitHub ↗
(address, value)

Source from the content-addressed store, hash-verified

124
125// Protocol encoders (pure helpers, always available).
126function modbusWriteRegister(address, value) {
127 var a = address & 0xFFFF, v = Math.round(value) & 0xFFFF;
128 return String.fromCharCode((a >> 8) & 0xFF, a & 0xFF, (v >> 8) & 0xFF, v & 0xFF);
129}
130function modbusWriteCoil(address, on) {
131 return modbusWriteRegister(address, on ? 0xFF00 : 0x0000);
132}

Callers 2

modbusWriteCoilFunction · 0.70
transmitFunction · 0.50

Calls 1

roundMethod · 0.80

Tested by

no test coverage detected