资源简介
c# EasyModbus Client
代码片段和文件信息
/*
Copyright (c) 2018-2020 Rossmann-Engineering
Permission is hereby granted free of charge
to any person obtaining a copy of this software
and associated documentation files (the “Software“)
to deal in the Software without restriction
including without limitation the rights to use
copy modify merge publish distribute sublicense
and/or sell copies of the Software and to permit
persons to whom the Software is furnished to do so
subject to the following conditions:
The above copyright notice and this permission
notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND
EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM
DAMAGES OR OTHER LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE
ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
using System;
using System.Net.Sockets;
using System.Net;
using System.IO.Ports;
using System.Reflection;
using System.Text;
using System.Collections.Generic;
using System.Net.NetworkInformation;
namespace EasyModbus
{
///
/// Implements a ModbusClient.
///
public partial class ModbusClient
{
public enum RegisterOrder { LowHigh = 0 HighLow = 1 }
private bool debug = false;
private TcpClient tcpClient;
private string ipAddress = “127.0.0.1“;
private int port = 502;
private uint transactionIdentifierInternal = 0;
private byte[] transactionIdentifier = new byte[2];
private byte[] protocolIdentifier = new byte[2];
private byte[] crc = new byte[2];
private byte[] length = new byte[2];
private byte unitIdentifier = 0x01;
private byte functionCode;
private byte[] startingAddress = new byte[2];
private byte[] quantity = new byte[2];
private bool udpFlag = false;
private int portOut;
private int baudRate = 9600;
private int connectTimeout = 1000;
public byte[] receiveData;
public byte[] sendData;
private SerialPort serialport;
private Parity parity = Parity.Even;
private StopBits stopBits = StopBits.One;
private bool connected = false;
public int NumberOfRetries { get; set; } = 3;
private int countRetries = 0;
public delegate void ReceiveDataChangedHandler(object sender);
public event ReceiveDataChangedHandler ReceiveDataChanged;
public delegate void SendDataChangedHandler(object sender);
public event SendDataChangedHandler SendDataChanged;
public delegate void ConnectedChangedHandler(object sender);
public event ConnectedChangedHandler ConnectedChanged;
NetworkStream stream;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2518 2021-11-16 21:12 EasyModbusTCP.NET-master\.gitattributes
文件 3755 2021-11-16 21:12 EasyModbusTCP.NET-master\.gitignore
文件 73408 2022-03-03 15:54 EasyModbusTCP.NET-master\.vs\EasyModbus.NET\DesignTimeBuild\.dtbcache.v2
文件 624 2022-03-30 16:07 EasyModbusTCP.NET-master\.vs\EasyModbus.NET\project-colors.json
..A..H. 48128 2022-01-27 09:35 EasyModbusTCP.NET-master\.vs\EasyModbus.NET\v16\.suo
文件 529 2022-03-03 15:54 EasyModbusTCP.NET-master\.vs\EasyModbus.NET\v17\.futdcache.v1
..A..H. 88576 2022-04-06 17:20 EasyModbusTCP.NET-master\.vs\EasyModbus.NET\v17\.suo
文件 72704 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net40\EasyModbus.dll
文件 36936 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net40\EasyModbus.pdb
文件 72704 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net45\EasyModbus.dll
文件 37016 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net45\EasyModbus.pdb
文件 72704 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net46\EasyModbus.dll
文件 37072 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net46\EasyModbus.pdb
文件 7634 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net5.0\EasyModbus.deps.json
文件 73216 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net5.0\EasyModbus.dll
文件 45124 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net5.0\EasyModbus.pdb
文件 16384 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\bin\Debug\net5.0\ref\EasyModbus.dll
文件 283 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\EasyModbus.csproj
文件 780 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\Exceptions\ConnectionException.cs
文件 773 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\Exceptions\CRCCheckFailedException.cs
文件 878 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\Exceptions\FunctionCodeNotSupportedException.cs
文件 797 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\Exceptions\ModbusException.cs
文件 822 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\Exceptions\QuantityInvalidException.cs
文件 816 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\Exceptions\SerialPortNotOpenedException.cs
文件 879 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\Exceptions\StartingAddressInvalidException.cs
文件 131483 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\ModbusClient.cs
文件 1200 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\ModbusProtocol.cs
文件 84715 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\ModbusServer.cs
文件 478 2021-11-16 21:12 EasyModbusTCP.NET-master\EasyModbus\NetworkConnectionParameter.cs
文件 208 2022-03-03 15:48 EasyModbusTCP.NET-master\EasyModbus\obj\Debug\net40\.NETfr
............此处省略185个文件信息
- 上一篇:LIS HL7 深圳迈瑞血常规通讯接口
- 下一篇:自己写的C#左侧导航框架
相关资源
- Modbus调试工具源码
- modbus tcp 调试
- C#modbus通信
- 松下PLC 通讯(modbus)
- 基于easy-mvc的后台管理系统源码 v1.1
- Eslaticsearch 操作(EasyElasticSearch)
- modbus通信
- Modbus通讯 串口通讯
- MODBUS通讯(TCP/Rtu)
- ASP.NET MVC5+EasyUI企业开发框架源码
- asp.net MVC5+EasyUI事例
- Modbus通讯协议-C#源码
- NModbus_net-3.5_1.11.0.0-source
- C# 开发modbus合集
- easy browser
- Modbus RTU TCP主站从站类库内有说明文档
- MODUBUS C#代码
- NModbusAPI说明文档中文的
- easyui框架demo
- easyui-完整实列 C# VS2010
- easy ui datagrid 增删改查+分页 asp.net
- NModbusAPI说明文档中文的 实用
- NModbus说明文档API 中文英文+chm
- modbus tcp/rtu 基于C#的源码实现(老外的
- STM32读取SBUS接收机
- nmodbus官方例程 包括dllvb.net与C#
- asp.net_mvc_框架EasyUI快速开发框架通用
- ASP.NET MVC+EF框架+EasyUI实现权限管理系
- C#使用ModbusTcp协议与西门子1200PLC通讯
- ASP.NET MVC权限管理系统源代码
评论
共有 条评论