从串口读取响应 [英] read the response from the serial port

查看:61
本文介绍了从串口读取响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.当我在串行端口中写入"AT"时,它会给出响应确定".我正在使用Serialpor.ReadLine()方法读取响应"OK".但是当我在消息框中打印响应时,它仅显示为"AT".我怎样才能只从串口读取响应"OK".请帮助我......... 紧急 .........

解决方案

响应可能包含多行文本.您是否尝试过多次呼叫ReadLine?


hi to all. when i write "AT" in serial port.it gives response "OK". I am using Serialpor.ReadLine() method to read the response "OK".But when i print the response in a messagebox , it shows as "AT" only. how can i read only the response "OK" from the serial port. please help me.................. urgent............

解决方案

It''s possible that a response can have multiple lines of text. Have you tried calling ReadLine more than once?


这篇关于从串口读取响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆