
iVIEW-100 Series user’s Manual, 2006, v2.0 ----- 33
When user writes program for DI/DO, please use the following statements to get
or set DI/DO value.
For MSVC compiler:
int DI=_inp(0x104);
int DI=_inp(0x104) &0x0f; //to get Bit 1 to Bit 4 only
_outp(0x105, DOvalue); //DOvalue:0x1f, 0x2f, 0x3f… for 2 relay output
//DOvalue:0x01, 0x02, 0x04, 0x08… for 4 DO
For Turbo C or Turbo C++ compilers:
int DI=inportb(0x104);
int DI=inportb(0x104) &0x0f; /*to get Bit 1 to Bit 4 only*/
outportb(0x105, DOvalue);
/*DOvalue:0x1f, 0x2f, 0x3f… for 2 relay output*/
/*DOvalue:0x01, 0x02, 0x04, 0x08… for 4 DO*/
For more demo programs, please refer to demo files in the “COM” folder of CD :
dim.c, dom.c, do4o.c, dido.c …….