
SDK Programming Guide Version 1.511
ABLELink
R
Ethernet-Serial Server MAXI Series
Example:
Initialize the first port with mode 9600,n,8,1
Line_Status:InitSerialMode( 0, 0xE3 )
SendSerialData()
Description:
Send data to the serial port.
Include:
DAPAPI.H
Usage:
ushort SendSerialData (ushort
port
, uchar
Send_data
)
Input Parameters:
port:
Serial port number, 0: 1st port
Send_data:
data to be sent out
Return Value:
The status of the specified serial line.
High byte contain: LSR(Line Status Register)
Bit 7 = Time out. 0: No time out; 1: Send data Time out
Bit 6 = Transmission shift register empty
Bit 5 = Transmission holding register empty
Bit 4 = Break detect
Bit 3 = Framing error
Bit 2 = Parity error
Bit 1 = Overrun error
Bit 0 = Data ready
Low byte contain: Send_data
Example:
Send data '0' (0x30) to 1st port.
Line status = SendSerialData( 0, '0' )
Remarks:
This function sends one character data out to the specific serial port.
GetSerialData()
Description:
Receive data from the serial port.
Include:
DAPAPI.H
Usage:
ushort GetSerialData (ushort
port
)
Input Parameters:
port:
serial port number of Serial Server, 0: 1st port
Copyright © 2004 Atop Technologies, Inc.
All rights reserved. Designed in Taiwan.