I-7188XA Series User’s Manual ( Ver1.2, Feb/2014, 7MH-019-10 ) ---
58
Use the “port” variable to switch from COM4 to COM2, simply change
port=4
to
port=2
.
If the program is set to use COM4, the code can be altered as follows:
4.6.1 To print from the COM port
The I-7188XA(D) library also supports functions such as
printf()
from
the standard C library to produce a formatted output.
The
printCom()
function can be used for all COM Ports, and
printCom1/2/3/4 can be sued for individual ports. Before using the
printCom()
function, the
InstallCom()
function must first be called. The
code is shown below:
if(data==’q’) quit=1; /*if ‘q’ is received, exit the program*/
}
}
RestoreCom(port); /*uninstall the COM driver*/
int quit=0, data;
InitLib(); /* Initiate the 7188xa library */
InstallCom4(115200L, 8, 0, 1); /*install the COM4 driver*/
while(!quit){
if(IsCom4()){ /*check if any data is in the COM4 input buffer*/
data=ReadCom4(); /*read data from COM4*/
ToCom4(data); /*send data via COM4*/
if(data==’q’) quit=1; /*if ‘q’ is received, exit the program*/
}
}
RestoreCom1(); /*uninstall the COM driver*/
Содержание I-7188XA
Страница 62: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 62 5 6 COM1 RS 232 1 2 232...
Страница 90: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 90 1 2...
Страница 140: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 140...
Страница 146: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 146 Step 8 Make the project...
Страница 153: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 153 Step 8 Rebuild the project...
Страница 158: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 158...
Страница 161: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 161 Below snap shots are steps for install TC 3 0...
Страница 162: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 162...
Страница 164: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 164...