![ICP DAS USA P8R8-DIO User Manual Download Page 29](http://html1.mh-extra.com/html/icp-das-usa/p8r8-dio/p8r8-dio_user-manual_3546466029.webp)
6.2 Relay
Output
You write data to relays 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.
6.2.1 Output Register
Relay Output register bits are assigned as shown in Table 3-2.
P16R16DIO 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
Base+1
D7
D6
D5
D4
D3
D2
D1
D0
Output Channel 15
14
13
12
11
10
9
8
Table 3-2 P16R16DIO Relay Addresses in the Relay Output Register.
Base+0
D7
D6
D5
D4
D3
D2
D1
D0
Read back channel 7
6
5
4
3
2
1
0
Base+1
D7
D6
D5
D4
D3
D2
D1
D0
Read back channel 15
14
13
12
11
10
9
8
Table 3-3. Relay output read back 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
Out Base +1, &hFF
‘ Set Relay Output (Ch 8 ~ Ch 15) On
RBL= Inp(Base)
‘ Read Back Relay Output Ch 0 ~ Ch 7
RBH= Inp(Base+1)
‘ Read Back Relay Output Ch 8 ~ Ch 15
REM : Set relay output CH 3 is ON ,Output data 8h (00001000 BIN)
Out Base,&h8
‘ Set relay output CN2 D3 ON
P8R8-DIO/P16R16-DIO User Manual (Ver.1.7, Oct. 2011, IMH-009-17)
29