<legend id='HUWzG'><style id='HUWzG'><dir id='HUWzG'><q id='HUWzG'></q></dir></style></legend>
    <bdo id='HUWzG'></bdo><ul id='HUWzG'></ul>
<i id='HUWzG'><tr id='HUWzG'><dt id='HUWzG'><q id='HUWzG'><span id='HUWzG'><b id='HUWzG'><form id='HUWzG'><ins id='HUWzG'></ins><ul id='HUWzG'></ul><sub id='HUWzG'></sub></form><legend id='HUWzG'></legend><bdo id='HUWzG'><pre id='HUWzG'><center id='HUWzG'></center></pre></bdo></b><th id='HUWzG'></th></span></q></dt></tr></i><div id='HUWzG'><tfoot id='HUWzG'></tfoot><dl id='HUWzG'><fieldset id='HUWzG'></fieldset></dl></div>
<tfoot id='HUWzG'></tfoot>
  • <small id='HUWzG'></small><noframes id='HUWzG'>

      1. 连接打开时更改 SerialPort 的 BaudRate

        时间:2023-11-10

            1. <i id='zUIkZ'><tr id='zUIkZ'><dt id='zUIkZ'><q id='zUIkZ'><span id='zUIkZ'><b id='zUIkZ'><form id='zUIkZ'><ins id='zUIkZ'></ins><ul id='zUIkZ'></ul><sub id='zUIkZ'></sub></form><legend id='zUIkZ'></legend><bdo id='zUIkZ'><pre id='zUIkZ'><center id='zUIkZ'></center></pre></bdo></b><th id='zUIkZ'></th></span></q></dt></tr></i><div id='zUIkZ'><tfoot id='zUIkZ'></tfoot><dl id='zUIkZ'><fieldset id='zUIkZ'></fieldset></dl></div>
            2. <legend id='zUIkZ'><style id='zUIkZ'><dir id='zUIkZ'><q id='zUIkZ'></q></dir></style></legend>
                <tbody id='zUIkZ'></tbody>
            3. <tfoot id='zUIkZ'></tfoot>

              <small id='zUIkZ'></small><noframes id='zUIkZ'>

                <bdo id='zUIkZ'></bdo><ul id='zUIkZ'></ul>
                  本文介绍了连接打开时更改 SerialPort 的 BaudRate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 SerialPort 类与外部设备进行通信.我以每秒 300 波特的速度开始通信,但是在初始握手"之后,我必须切换到设备指定的波特率(通常为 9600 Bps).

                  I am using SerialPort class to communicate with an external device. I start the communication at 300 Baud per second however after the initial "handshake" I have to switch to a Baud rate specified by the device (usually 9600 Bps).

                  我在提高波特率后尝试继续通信没有成功,但我不知道为什么.这引出了我的问题:改变波特率的正确方法是什么?可以在连接打开时完成,还是我应该先关闭连接?

                  I have been unsuccessful in my attempts to continue communicating after I increase Baud rate however I am not sure why. That leads me to my question: What is the proper way of changing the Baud rate? Can it be done while the connection is open, or should I close the connection first?

                  我无法在文档中找到有关此的任何信息...

                  I have been unable to find any information about this in the documentation...

                  我都尝试过,但都没有成功,这让我觉得我一定错过了一些明显的东西.

                  I have tried both and have been unsuccessful in both ways, which made me think that I must be missing something obvious.

                  推荐答案

                  原来你可以在 SerialPort.BaudRate 打开的时候改变它.但是@Groo 在回答中提到的 SerialPort.DiscardInBuffer 是一个很好的提示!

                  It turns out you can change SerialPort.BaudRate while it is open. But the SerialPort.DiscardInBuffer that is mentioned in answer by @Groo is a good tip!

                  这篇关于连接打开时更改 SerialPort 的 BaudRate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 COM 端口 - 每次使用后关闭,还是始终打开? 下一篇:将正确的 Gcode 字符串发送到串行端口?

                  相关文章

                  <small id='IkedX'></small><noframes id='IkedX'>

                  1. <legend id='IkedX'><style id='IkedX'><dir id='IkedX'><q id='IkedX'></q></dir></style></legend>

                    • <bdo id='IkedX'></bdo><ul id='IkedX'></ul>
                    <tfoot id='IkedX'></tfoot>

                      <i id='IkedX'><tr id='IkedX'><dt id='IkedX'><q id='IkedX'><span id='IkedX'><b id='IkedX'><form id='IkedX'><ins id='IkedX'></ins><ul id='IkedX'></ul><sub id='IkedX'></sub></form><legend id='IkedX'></legend><bdo id='IkedX'><pre id='IkedX'><center id='IkedX'></center></pre></bdo></b><th id='IkedX'></th></span></q></dt></tr></i><div id='IkedX'><tfoot id='IkedX'></tfoot><dl id='IkedX'><fieldset id='IkedX'></fieldset></dl></div>