MCPcopy Create free account
hub / github.com/4-20ma/ModbusMaster / readDiscreteInputs

Method readDiscreteInputs

src/ModbusMaster.cpp:352–358  ·  view source on GitHub ↗

Modbus function 0x02 Read Discrete Inputs. This function code is used to read from 1 to 2000 contiguous status of discrete inputs in a remote device. The request specifies the starting address, i.e. the address of the first input specified, and the number of inputs. Discrete inputs are addressed starting at zero. The discrete inputs in the response buffer are packed as one input per bit of t

Source from the content-addressed store, hash-verified

350@ingroup discrete
351*/
352uint8_t ModbusMaster::readDiscreteInputs(uint16_t u16ReadAddress,
353 uint16_t u16BitQty)
354{
355 _u16ReadAddress = u16ReadAddress;
356 _u16ReadQty = u16BitQty;
357 return ModbusMasterTransaction(ku8MBReadDiscreteInputs);
358}
359
360
361/**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected