串口发送问题,怎么通过通过串口发送大约10M的数据?
时间:2011-12-22
来源:互联网
如题,串口发送程序该怎么来写呢?
自己写的好像只能发送4096字节的数据就终止。这是什么原因?
这是我的程序
void CCommDlg::OnButtonSendm()
{
// TODO: Add your control notification handler code here
CString strSend;
if(m_nInputMode > 1) //16进制发送
{
CByteArray hexdata;
int len=String2Hex(m_strSendString ,hexdata);
myComm.SetOutput(COleVariant(hexdata));
TX_count+=(long)((m_strSendString.GetLength()+1)/3);
}
else
myComm.SetOutput(COleVariant(m_strSendString));//发送数据
CString strTemp;
strTemp.Format("TX:%d",TX_count);
m_ctrlTXCount.SetWindowText(strTemp);
}
自己写的好像只能发送4096字节的数据就终止。这是什么原因?
这是我的程序
void CCommDlg::OnButtonSendm()
{
// TODO: Add your control notification handler code here
CString strSend;
if(m_nInputMode > 1) //16进制发送
{
CByteArray hexdata;
int len=String2Hex(m_strSendString ,hexdata);
myComm.SetOutput(COleVariant(hexdata));
TX_count+=(long)((m_strSendString.GetLength()+1)/3);
}
else
myComm.SetOutput(COleVariant(m_strSendString));//发送数据
CString strTemp;
strTemp.Format("TX:%d",TX_count);
m_ctrlTXCount.SetWindowText(strTemp);
}
作者: forever1820 发布时间: 2011-12-22
最好用串口通信的饿API来做。
最好把10M数据拆分,放到线程中分多次发送。
最好把10M数据拆分,放到线程中分多次发送。
作者: Vector_fz 发布时间: 2011-12-22
看看你的串口的写缓冲区设置的多大,在设备管理器中可以查看。
串口写数据一般是按字节发送或分包发送。
串口写数据一般是按字节发送或分包发送。
作者: chayedanwc 发布时间: 2011-12-22
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28