Open_Com - ICP DAS USA MP-8 43 Series Function Reference

Hide thumbs Also See for MP-8 43 Series:
Table of Contents

Advertisement

4.1.2 Open_Com

Description:
This function is used to configure and open the COM port. It must be called
once before sending/receiving command through COM port.
Syntax:
long Open_Com(unsigned char
Parameter:
cPort:
dwBaudRate:
cData:
cParity:
cStop:
NOTE cData=8, cParity=0, cStop=0 is the default for DCON series modules.
Return Value:
NoError :
Others :
Example:
unsigned char
m_ComPort=3;
DWORD m_baudrate=9600;
char
m_databit=8;
char
m_parity =0;
char
m_stopbit =0;
long
RET=Open_Com(m_ComPort, m_baudrate, m_databit, m_parity, m_stopbit);
Remark:
http://www.icpdas.com
[C
cPort, DWORD
char
cParity,
char
[Input] 1=COM1, 2=COM2 .... , MAXPORT
[Input] 1200/1800/2400/4800/7200/9600/
19200/38400/57600/115200
[Input] 5/6/7/8 data bit
[Input] 0= NonParity, 1= Odd Parity, 2= Even Parity
3= Mark Parity, 4= Space Parity
[Input] 0= 1 Stop Bit, 1= 1.5 Stop Bit, 2= 2 Stop Bit
OK
Error code, please refer to "Appendix A Error Code".
//Com_port of PAC
MP-8x43 Function Reference V 1.0
++
]
dwBaudrate,char
cStop)
cData,
84 

Advertisement

Table of Contents
loading

Table of Contents