I-7188XA Series User’s Manual ( Ver1.2, Feb/2014, 7MH-019-10 ) ---
57
4.6 Using the COM Ports
The 7188XA(D) has four communication ports.
COM1 can act as either an RS-232 (Default) or RS-485 port
RS-232: TXD, RXD, RTS, CTS, DTR, DSR, DCD. RI GND
RS-485: D1+, D1- (Self-tuner ASIC inside)
COM2 is an RS-485 port (D1+, D1-, Self-tuner ASIC inside)
COM3 is an RS-232 port (TXD3, RXD3, GND)
COM4 is an RS-232 port (TXD4, RXD4, GND)
Before using the COM Port, the
InstallCom()
(or
InstallCom1/2/3/4
)
function must be called to install the driver for the COM Port.
Before exiting the program, the
RestoreCom()
(or
RestoreCom1/2/3/4
)
function must be called to uninstall the driver.
After calling the
InstallCom()
function, data can be read from the COM
Port, sent to the COM Port, printed from the COM Port and so on.
Before reading data from the COM port, the
IsCom()
function should be
used to check if any data has already been sent to the COM Port. If yes,
then the
ReadCom()
function should be used to read the data from
input buffer of the COM Port.
Before sending data to the COM Port, the
ClearCom()
function could be
used to make sure the output buffer of the COM Port is clear, then use
the
ToCom()
function to send data to the COM Port.
For example, the code to echo the data back to COM4 (RS-232) is
shown below.
int port=4; /*to use COM4*/
int quit=0, data;
InitLib();
/* Initiate the 7188xa library */
InstallCom(port, 115200L, 8, 0, 1); /*install the COM driver*/
while(!quit){
if(IsCom(port)){ /*check if any data is in the COM Port input buffer*/
data=ReadCom(port); /*read data from the COM Port*/
ToCom(port, data); /*send data via the COM Port*/
Содержание 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...