本文介绍了串口(com,boudrate,stopbit等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我有C#编程希望连接到基于RTU Modbus的控制器,我希望使用Visual Studio C#我的项目实时记录我的PC温度。任何机构都可以通过收到您的序列号样本来帮助我解决我的问题。我希望用PC连接实时控制器。
我尝试过:
Hi guys, I have C# programming wish to connected to my controller based on RTU Modbus, I wish record temperature in my PC real time using Visual Studio C# my project. Any body help me to solve my problem by received Serial Code Samples of yours. i wishing connected Real Time Controller with PC.
What I have tried:
"Connect!" Then
scm485.PortName = cbComm0.Text
scm485.BaudRate = "9600"
scm485.DataBits = "8"
scm485.Parity = Parity.None
scm485.StopBits = StopBits.Two
scm485.RtsEnable = False
scm485.DtrEnable = False
scm485.WriteTimeout = 10000
scm485.ReadTimeout = 10000
scm485.Handshake = Handshake.XOnXOff
scm485.Open()
if scm485.IsOpen = True Then
cmdEx.Text = "Disconnect!"
推荐答案
这篇关于串口(com,boudrate,stopbit等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!