公司在做一个智能工厂项目,需要将不同厂家的机器设备通过ModBus协议连接起来,于是在网上找了个支持ModBus协议的DLL库HslCommunication。将DLL引入的C#项目中
废话不多说,上代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using HslCommunication;
using HslCommunication.ModBus;
using MyModbus.Model;
namespace MyModbus
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender

最低0.47元/天 解锁文章
1583





