• 大小:
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-02-11
  • 语言: C#
  • 标签: C#  

资源简介

C# 写的串口通信程序源码,MODBUS RTU

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.IO.Ports;
using System.Threading;
using System.Timers;


namespace CareComModbus
{
    //简单的MODBUS类库 可读写保持寄存器及输出线圈  设计 李广  日期2013. 4  最大支持16个MB设备
    public class ComModbus
    {
        private SerialPort MyCom;//定义串口类对象
        private int  CurrentAddr;//定义当前通讯设备的地址
        private byte[] bData = new byte[1024];//最大接受的1024个字节
        public string strErrMsg;//错误信息
        public string strUpData strDownData;//定义上行及下行数据字符串
        private string mTempStr;
        public bool mRtuFlag = true;
        private byte mReceiveByte;
        private int mReceiveByteCount;
        public long iMWordStartAddriMBitStartAddr;//保持寄存器及输出线圈的起始地址
        public in

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-11-19 09:49  CareComModbus\
     目录           0  2013-04-16 11:17  CareComModbus\CareComModbus\
     文件         881  2013-04-15 16:25  CareComModbus\CareComModbus.sln
     文件       21504  2013-06-20 09:24  CareComModbus\CareComModbus.suo
     文件       42496  2015-11-19 09:57  CareComModbus\CareComModbus.v12.suo
     目录           0  2013-04-15 16:27  CareComModbus\CareComModbus\bin\
     目录           0  2013-04-18 08:58  CareComModbus\CareComModbus\bin\Debug\
     文件       31232  2015-11-19 09:49  CareComModbus\CareComModbus\bin\Debug\CareComModbus.exe
     文件       58880  2015-11-19 09:49  CareComModbus\CareComModbus\bin\Debug\CareComModbus.pdb
     文件       24224  2015-11-19 09:57  CareComModbus\CareComModbus\bin\Debug\CareComModbus.vshost.exe
     文件         490  2015-07-10 19:01  CareComModbus\CareComModbus\bin\Debug\CareComModbus.vshost.exe.manifest
     目录           0  2013-06-20 09:24  CareComModbus\CareComModbus\bin\Release\
     文件        3781  2013-04-16 11:17  CareComModbus\CareComModbus\CareComModbus.csproj
     文件       50418  2013-06-20 09:24  CareComModbus\CareComModbus\CareModbus.cs
     文件        7029  2013-04-19 14:35  CareComModbus\CareComModbus\frmCareComModbus.cs
     文件       27363  2013-04-19 11:28  CareComModbus\CareComModbus\frmCareComModbus.Designer.cs
     文件        6012  2013-04-19 11:28  CareComModbus\CareComModbus\frmCareComModbus.resx
     目录           0  2013-04-15 16:25  CareComModbus\CareComModbus\obj\
     目录           0  2013-04-15 16:25  CareComModbus\CareComModbus\obj\x86\
     目录           0  2015-11-19 09:49  CareComModbus\CareComModbus\obj\x86\Debug\
     文件        1745  2015-11-19 09:57  CareComModbus\CareComModbus\obj\x86\Debug\CareComModbus.csproj.FileListAbsolute.txt
     文件         915  2015-11-19 09:49  CareComModbus\CareComModbus\obj\x86\Debug\CareComModbus.csproj.GenerateResource.Cache
     文件        9180  2015-11-19 09:49  CareComModbus\CareComModbus\obj\x86\Debug\CareComModbus.csprojResolveAssemblyReference.cache
     文件       31232  2015-11-19 09:49  CareComModbus\CareComModbus\obj\x86\Debug\CareComModbus.exe
     文件         180  2015-11-19 09:49  CareComModbus\CareComModbus\obj\x86\Debug\CareComModbus.frmCareComModbus.resources
     文件       58880  2015-11-19 09:49  CareComModbus\CareComModbus\obj\x86\Debug\CareComModbus.pdb
     文件         180  2015-11-19 09:49  CareComModbus\CareComModbus\obj\x86\Debug\CareComModbus.Properties.Resources.resources
     文件        2873  2015-11-19 09:49  CareComModbus\CareComModbus\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7159  2015-11-19 09:49  CareComModbus\CareComModbus\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         254  2013-04-19 11:28  CareComModbus\CareComModbus\obj\x86\Debug\GenerateResource.read.1.tlog
     文件         630  2013-04-19 11:28  CareComModbus\CareComModbus\obj\x86\Debug\GenerateResource.write.1.tlog
............此处省略9个文件信息

评论

共有 条评论