Skip to main content
Version: 2.9.17 - 2.9.15

RS485, Modbus & NVT

api.rs485Send(msg)

Sends msg to RS485 bus.

Turn on RS485 using rs485State first.

api.rs485Setup(baudrate, parity, stopBits, dataBits)

Change the configuration of RS485 interface.

api.rs485State(state)

Turns on the RS485 circuitry.

Must be used before rs485Send or rs485Receive.

api.rs485Receive(timeout)

Waits timeout milliseconds for data reception from RS485 bus.

Turn on RS485 using rs485State() function first.

After the first character is received the inter-character delay is 10ms. If the inter-character delay needs to be longer the function should be called again.

api.modbusCrc(msg)

Calculates Modbus request checksum.

api.nvtProcess(buf)

Processes NVT message and either sets baudrate, datasize, parity or stop size for MBUS or MODBUS.

api.nvtEncode(msg)

Encodes message to NVT format