嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 3 元微信扫码支付:3 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
Modbus Poll C# 源代码,支持虚拟通信,与Modbus Slave通讯。-Modbus Poll C# source code, support for virtual communication, and Modbus Slave communications.
private void StartPoll()
{
pollCount = 0;
//Open COM port using provided settings:
if (mb.Open(lstPorts.SelectedItem.ToString(), Convert.ToInt32(lstBaudrate.SelectedItem.ToString()),
8, Parity.None, StopBits.One))
{
//Disable double starts:
btnStart.Enabled = false;
dataType = lstDataType.SelectedItem.ToString();
//Set polling flag:
isPolling = true;
//Start timer using provided values:
timer.AutoReset = true;
if (txtSampleRate.Text != "")
timer.Interval = Convert.ToDouble(txtSampleRate.Text);
else
timer.Interval = 1000;
timer.Start();
}
lblStatus.Text = mb.modbusStatus;
}