MXSIO_OpenCommport
This function opens the local COM port of the host computer with communication parameters.
C/C++
int MXSIO_OpenCommport(char * szCommport,
DWORD dwBaudrate,
BYTE bytDataFormat,
DWORD dwTimeout,
Int * hCommport);
Visual Basic
Declare Function MXSIO_OpenCommport Lib "MXIO.dll" (ByVal sCommport As String, ByVal nBaudrate As Long, ByVal bytDataFormat As Byte, ByVal nTimeout As Long, hCommport As Long) As Long
Arguments:
|
szCommport |
Name of the common port. I.E., COM3. |
|
dwBaudrate |
Baud rate value. E.g. 1200, 9600, 19200. |
|
bytDataFormat |
Transmission data format. |
|
dwTimeout |
Time out value for serial adapter communication. The unit is in milliseconds. |
|
hCommport |
Handle of the opened COM port. |
bytDataFormat:
|
bit_cnt (bit 0, 1) |
0x00 = bit_5 |
|
stop_bit (bit 2) |
0x00 = stop_1 |
|
parity (bit 3,4 5) |
0x00 = none |
Return Value:
|
Succeed |
MXIO_OK |
|
Fail |
Refer to Return Codes. |