The number, that the input ports and the output ports of a digital I/O device are counted from 0 respectively, is called the logical port.
The number, that the input bits and the output bits of a digital I/O device are counted from 0 respectively, is called the logical bit.
Even if more than one digital I/O device are used at same time, the logical port and the logical bit are counted from 0 in respective device.