資源簡介
已經驗證可以和支持ModbusRTU 的PLC通信
代碼片段和文件信息
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?System.Threading;
using?System.Runtime.InteropServices;
namespace?ModbusRtuAndPLC
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?ModbusRtu?busRtuClient?=?null;
????????private?void?btnOpenPort_Click(object?sender?EventArgs?e)
????????{
????????????int?baudRate;
????????????if?(!int.TryParse(txtRtuBaudrate.Text?out?baudRate))
????????????{
????????????????MessageBox.Show(“波特率輸入錯誤!“);
????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????..A..H.?????49152??2019-11-19?09:03??ModbusRtuAndPLC\.vs\ModbusRtuAndPLC\v14\.suo
????..A..H.?????50176??2019-11-21?11:11??ModbusRtuAndPLC\.vs\ModbusRtuAndPLC\v16\.suo
?????文件??????????0??2019-11-13?19:52??ModbusRtuAndPLC\.vs\ModbusRtuAndPLC\v16\Server\sqlite3\db.lock
?????文件?????733184??2019-11-21?11:11??ModbusRtuAndPLC\.vs\ModbusRtuAndPLC\v16\Server\sqlite3\storage.ide
?????文件????????189??2019-11-13?16:56??ModbusRtuAndPLC\ModbusRtuAndPLC\App.config
?????文件?????812032??2019-11-13?17:14??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\HslCommunication.dll
?????文件????1394790??2019-11-13?17:14??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\HslCommunication.xm
?????文件?????417280??2019-11-13?17:14??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\HslControls.dll
?????文件?????257174??2019-05-20?00:19??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\HslControls.xm
?????文件??????40448??2019-11-21?08:46??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\ModbusRtuAndPLC.exe
?????文件????????189??2019-11-13?16:56??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\ModbusRtuAndPLC.exe.config
?????文件??????44544??2019-11-21?08:46??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\ModbusRtuAndPLC.pdb
?????文件??????22696??2019-11-18?22:47??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\ModbusRtuAndPLC.vshost.exe
?????文件????????189??2019-11-13?16:56??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\ModbusRtuAndPLC.vshost.exe.config
?????文件????????490??2018-09-15?15:29??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\ModbusRtuAndPLC.vshost.exe.manifest
?????文件?????488360??2019-11-13?17:14??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\Newtonsoft.Json.dll
?????文件?????543762??2019-04-22?00:57??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\Newtonsoft.Json.xm
?????文件????????650??2019-10-30?15:14??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\灰色.png
?????文件???????1308??2019-10-30?15:17??ModbusRtuAndPLC\ModbusRtuAndPLC\bin\Debug\綠色.png
?????文件??????13823??2019-11-21?08:46??ModbusRtuAndPLC\ModbusRtuAndPLC\Form1.cs
?????文件??????91063??2019-11-20?21:22??ModbusRtuAndPLC\ModbusRtuAndPLC\Form1.Designer.cs
?????文件???????6018??2019-11-20?21:22??ModbusRtuAndPLC\ModbusRtuAndPLC\Form1.resx
?????文件???????4880??2019-11-13?21:24??ModbusRtuAndPLC\ModbusRtuAndPLC\ModbusRtuAndPLC.csproj
?????文件???????8787??2019-11-13?21:03??ModbusRtuAndPLC\ModbusRtuAndPLC\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????7547??2019-11-18?15:44??ModbusRtuAndPLC\ModbusRtuAndPLC\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件??????????0??2019-11-21?08:46??ModbusRtuAndPLC\ModbusRtuAndPLC\obj\Debug\ModbusRtuAndPLC.csproj.CopyComplete
?????文件???????3784??2019-11-20?21:22??ModbusRtuAndPLC\ModbusRtuAndPLC\obj\Debug\ModbusRtuAndPLC.csproj.FileListAbsolute.txt
?????文件???????1072??2019-11-20?21:22??ModbusRtuAndPLC\ModbusRtuAndPLC\obj\Debug\ModbusRtuAndPLC.csproj.GenerateResource.cache
?????文件??????22190??2019-11-21?08:46??ModbusRtuAndPLC\ModbusRtuAndPLC\obj\Debug\ModbusRtuAndPLC.csprojAssemblyReference.cache
?????文件??????40132??2019-11-18?15:45??ModbusRtuAndPLC\ModbusRtuAndPLC\obj\Debug\ModbusRtuAndPLC.csprojResolveAssemblyReference.cache
............此處省略43個文件信息
- 上一篇:C#編程思想
- 下一篇:樹形ComBoBox控件源碼
評論
共有 條評論