求助:串口通讯中的数据发送问题
<P>我做了一个串口通讯的程序在一个程序写串口缓存同时把发送的数据读出来用字符串显示
可是有一个问题</P>
<P>发送字符串时只能发一行,即中间出现回车时,就不能接收到。为什么呀?
</P> 可以接收到呀,我经常做一些带有回车符的信息发送回来! <P>有人说是下面的原因:</P><P>因为串口初始化时,其Termination Char 默认设置为0X0A,即\n.
如下是从LabVIEW帮助里摘录的描述:
termination char calls for termination of the read operation. The read operation
terminates when the termination char is read from the serial device. 0xA is the hex
equivalent of a linefeed character (\n). Change the termination char to 0xD for
message strings that terminate with a carriage return (\r).
我也不太清楚,可以给我发一个你做的例子吗?
我用书上的例子也不是上面的这个问题。
谢谢了</P> <P>我的邮箱:</P><P>colldge@126.com</P> <P>我按提示做了下,现在好了</P><P>谢谢了</P> <P>能不能给我说一下!我不作串口就是想了解一下!</P><P>随便说说就是一个提示就好!呵呵!!</P><P>还有一个同志问我串口是不是要报头怎么去报头的我想知道.</P><P>要是想在硬件上处理这个是不是在硬件上处理这个数据!</P><P>还是串口协议写好了!只要是符合规定的就是一定可以在硬件上接受到需要的格式!</P><P>可以全用硬件实现吗?</P> <P>真不好意思,你问的我也不太懂。只是把上边一个解决了</P><P>上面一个问题的解决:</P><P>因为串口初始化时,其Termination Char 默认设置为0X0A,即\n. 可以把它成0x0D,即 \r,就可以了
如下是从LabVIEW帮助里摘录的描述:
termination char calls for termination of the read operation. The read operation
terminates when the termination char is read from the serial device. 0xA is the hex
equivalent of a linefeed character (\n). Change the termination char to 0xD for
message strings that terminate with a carriage return (\r).
</P><P>其他几个问题我也不太懂,</P> <P>哪为高手能给我提供,一个串口通讯的程序
在一个程序写串口缓存同时把发送的数据读出来用字符串显示的完整的程序图么? 谢了!!</P><P>邮箱 mini_zdm@126.com</P> <P>程序已发,注意查收</P> 我虽不是高手,但帮助人也是快乐的
因为我也是初学,有很多大哥帮助我 <P>可以给我发一个吗?谢谢</P><P>seagull2000306@126.com</P> <P>可以给我也发一份么?谢谢了</P><P>mayierly@163.com</P> <P>谢谢!!</P> 谢谢 <P>可以给我法一个</P><P>crownqiqi@tom.com</P>
页:
[1]