Modbus Discrete Input


Thread Starter



i am confused about Modbus discrete input.

i found an example online. HMI is Client, PLC is server. To read the "motor servo-on status" by HMI.

it use function code 02 which refer to:
"The client reads the status of the discrete inputs of the server."

isn't it "servo-on status" an "OUTPUT" of the PLC?

Please help
A PLC Discrete Output is called a "Coil" and a coil is set with Function Code 5. The current status of the COIL is read with a Function Code 1.

Function Code 2 reads the Status of a Discrete Input as you mention.
Just to follow up a bit, a discrete Input is normally a physical ON/OFF input to the PLC via an input card. Function Code 2 will read a single bit (ON/OFF) signal to the PLC, e.g. "servo-on status."

William (Bill) L. Mostia, Jr. PE
ISA Fellow, SIS-TECH Fellow,
SIS-TECH Solutions, LP

"No trees were killed to send this message, but a large number of electrons were terribly inconvenienced." Neil deGrasse Tyson

Any information is provided on a Caveat Emptor basis.


Don't get confused with words Discrete "Inputs". DI is used to read only servo-on/off status, whereas it can't modify the servo-on/off status.

In MODBUS client is Master and server is Slave. where Master is requesting DI status which is tied to servo motor from slave.