Change baud rate in C# without closing connection

后端 未结 2 905
深忆病人
深忆病人 2021-01-22 01:49

I have a similar problem to the following link. How to change baud rate without closing the connection?. But i use C# in stead of java. I am beginning with baud rate 300. Then a

相关标签:
2条回答
  • 2021-01-22 02:22

    To change baud rate of a device, follow these steps. eg: To Start communication with a baud rate of 1200.

    1. Send data command for changing the baud rate to 1200.
    2. Receive the acknowledgement from the device.
    3. If the ACK is proper, set the Port.BaudRate=1200.

    Next you want to change the baud rate to 4800, then follow these steps

    1. Send data command for changing the baud rate to 4800.
    2. Receive the acknowledgement from the device.
    3. If the ACK is proper, set the Port.BaudRate=4800.

    NOTE: Change the Port.BaudRate after receving the ACK from the controller device. The communciation will be started with the previously set BaudRate.

    0 讨论(0)
  • 2021-01-22 02:28

    In my experience baud rate switches require closing and reopening the serial port hardware: I would suggest trying that. Send the baud rate switch command then close the port, set the baud rate and then re-open the port. Opening/closing the port should be transparent to the device on the other side (unless you are using the CTS/RTS/DTR/DSR lines).

    0 讨论(0)
提交回复
热议问题