A SERVICE OF

logo

iVIEW-100 Series user’s Manual, 2006, v2.0 ----- 102
Use the variable port to change from using COM1 to using COM2, just
change port=1; to port=2.(see Note below)
If the program is fixed to use COM1, the code can be altered as
follows.
int quit=0,data;
InstallCom1(115200L,8,0);
/* install COM1 driver */
while(!quit){
if(IsCom1()) {
/* check if is data in */
data=ReadCom1();
/* read data from COM1 input buffer*/
ToCom1(data);
/* send data out */
If(data==’q’) quit=1;
/* if data=‘q’, then quit */
}
}
…………
/* here is for user’s program code*/
RestoreCom1();
/* un-install COM1 driver */
Note
:
this “echo back” sample is for COM1:RS-232 and
COM2:RS-232 only, because they are full duplex transmission
network. This sample cannot be used for half-duplex
transmission. COM2:RS-485 is a half-duplex transmission
network. Please refer to demo program “ts7065d3.exe” for detail
method.