BOOL SetupConnection(int m_sPort,long m_nBaud, int m_nDataBits, int m_nParity, int m_nStopBits)。
该函数用来设置串口通讯参数。
BOOL OpenConnection(int m_sPort,int m_sProtocolNo)。该函数用来打开串口。
BOOL WriteCommBlock(int m_sPort,LPSTR block,long num)。该函数用来操作串口发送数据。
VARIANT ReadCommBlock(int m_sPort,int nMaxLength,int timeout)。该函数用来操作串口接收数据。
void CloseConnection(int m_sPort)。该函数用来关闭串口。
unsigned short Crc16(unsigned char* buf, unsigned short len)。该函数用来返回Crc16校验。
unsigned short ChkSum(unsigned char* buf, unsigned short len)。该函数用来返回累加和校验。
[3913]
[5200]
[2535]
[2319]
[2381]
[3122]
[4316]
[2979]
[22492]
[3220]

客服
小程序
公众号