![ICP DAS USA P8R8-DIO User Manual Download Page 14](http://html1.mh-extra.com/html/icp-das-usa/p8r8-dio/p8r8-dio_user-manual_3546466014.webp)
3.2 Relay
Output
You write data to relays (CH0 - CH 7 ) as a single Byte. Each of the eight bits
within a byte controls a single relay. A high bit (equal to1) energizes (closes the
contacts of) a relay while a low bit (equal to 0) turns the relay off.
3.2.1 Output Register
Relay Output register bits are assigned as shown in Table 3-2
Base Address at 300 Hex
Base+0
D7
D6 D5
D4
D3
D2
D1
D0
Output Channel 7
6
5
4
3
2
1
0
Table 3-2. Relay Addresses in the Relay Output Register.
For Example (Basic Language)
REM : Set all relay output is ON , ( Output data FFh)
Base=&h300
‘ Set Base Address at 300 (Hex)
Out Base , &hFF
‘ Set Relay Output (Ch 0 ~ Ch 7) On
RB= Inp(Base)
‘ Read Back Relay Output Ch 0 ~ Ch 7
REM: Set relay output CH 3 is ON, Output data 8h (00001000 BIN)
Out Base, &h8
‘ Set relay output CH 3 ON
(For C Language)
outportb(0x300,0x0FF);
/* Set all relay output is On*/
outportb(0x300,0x0);
/* Set all relay output is Off*/
P8R8-DIO/P16R16-DIO User Manual (Ver.1.7, Oct. 2011, IMH-009-17)
14