基本信息
源码名称:Modbus Poll C# 源代码
源码大小:0.08M
文件格式:.rar
开发语言:C#
更新时间:2019-11-07
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 3 元 
   源码介绍

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;
        }