Appendix A
57
KEEX-8100 Series Use r’s Manual
//DO_2 is bit 5
//DO_3 is bit 6
outp(0x539,RetVal);
RetVal=inp(0x53B);//IO Port: 0x53B
RetVal=(RetVal|0x01);//DO_4 is bit 0
outp(0x53B,RetVal);
system("pause");
//Reading
DI_1~4
RetVal=inp(0x50C);//IO Port: 0x50C
RetVal=(RetVal&0x3C);//DI_1 is bit 2
//DI_2 is bit 3
//DI_3 is bit 4
//DI_4 is bit 5
printf("DI_=
%d\n",RetVal);
system("pause");
return
0;
}