using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HslCommunication.ModBus
{
///
/// Modbus协议相关的一些信息
///
public class ModbusInfo
{
/*****************************************************************************************
*
* 本服务器和客户端支持的常用功能码
*
*******************************************************************************************/
///
/// 读取线圈
///
public const byte ReadCoil = 0x01;
///
/// 读取离散量
///
public const byte ReadDiscrete = 0x02;
///
/// 读取寄存器
///
public const byte ReadRegister = 0x03;
///
/// 写单个线圈
///
public const byte WriteOneCoil = 0x05;
///
/// 写单个寄存器
///
public const byte WriteOneRegister = 0x06;
///
/// 写多个线圈
///
public const byte WriteCoil = 0x0F;
///
/// 写多个寄存器
///
public const byte WriteRegister = 0x10;
/*****************************************************************************************
*
* 本服务器和客户端支持的异常返回
*
*******************************************************************************************/
///
/// 不支持该功能码
///
public const byte FunctionCodeNotSupport = 0x01;
///
/// 该地址越界
///
public const byte FunctionCodeOverBound = 0x02;
///
/// 读取长度超过最大值
///
public const byte FunctionCodeQuantityOver = 0x03;
///
/// 读写异常
///
public const byte FunctionCodeReadWriteException = 0x04;
}
}