Each point of digital input is called an input bit.
If a device with 4 input points, the bits are defined as bit 0 to bit 3.
Specify an input bit and perform input, you can get whether the bit is 1 (ON) or 0 (OFF).
Use function AioInputDiBit to digital input in bit unit.
Ret = AioInputDiBit ( Id , DiBit , DiData )
In DiBit, specify the bit number for digital input. If a device with 4 input points, the bit number that can be specified is 0, 1, 2, 3.
In DiData, specify the address of variable that stores the digital input data.
If the specified bit is ON, 1 is stored. If the specified bit is OFF, 0 is stored.
Each input bit can be collectively input in byte unit.
If a device with 4 input points, each input bit is arranged as follows, and the input byte data is the value acquired from 0 to 15 depending on the state of bits.
Example) If input in this state Bit0 : OFF, Bit1 : ON, Bit2 : OFF, Bit 3 : ON
Byte data = 10 (AH)
Use function AioInputDiByte to digital input in byte unit.
Ret = AioInputDiByte ( Id , DiPort , DiData )
In DiPort, specify the port number for digital input. If a device with 4 input points, the port number that can be specified is 0 only.
In DiData, specify the address of variable that stores the digital input data.