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

Function modbusWriteRegister

app/rcc/api/SerialStudio.js:185–188  ·  view source on GitHub ↗
(address, value)

Source from the content-addressed store, hash-verified

183
184// Protocol encoders (pure helpers, always available).
185function modbusWriteRegister(address, value) {
186 var a = address & 0xFFFF, v = Math.round(value) & 0xFFFF;
187 return String.fromCharCode((a >> 8) & 0xFF, a & 0xFF, (v >> 8) & 0xFF, v & 0xFF);
188}
189function modbusWriteCoil(address, on) {
190 return modbusWriteRegister(address, on ? 0xFF00 : 0x0000);
191}

Callers 1

modbusWriteCoilFunction · 0.70

Calls 1

roundMethod · 0.80

Tested by

no test coverage detected