You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.3 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace Mesnac.Basic
{
public class ModbusRTUInfo
{
private string _rtuaddr = "1";
private string _rtucom= "COM1";
private UInt32 _Baud = 9600;
private uint _databit = 8;
private uint _stopbit = 1;
private uint _checkbit=0;
private int _timeout = 300;
[Description("RTU设备的地址1-255"), Category("设备地址")]
public string RtuAddr
{
get
{
return _rtuaddr;
}
set
{
_rtuaddr = value;
}
}
[Description("串口号如COM1"), Category("串口设置")]
public string ComPort
{
get
{
return _rtucom;
}
set
{
_rtucom = value;
}
}
[Description("串口波特率如9600"), Category("串口设置")]
public UInt32 BaudRate
{
get
{
return _Baud;
}
set
{
_Baud = value;
}
}
[Description("数据位如8"), Category("串口设置")]
public uint Databits
{
get
{
return _databit;
}
set
{
_databit = value;
}
}
[Description("停止位如1"), Category("串口设置")]
public uint Stopbit
{
get
{
return _stopbit;
}
set
{
_stopbit = value;
}
}
[Description("奇偶校验位0None1Odd2Even"), Category("串口设置")]
public uint Parity
{
get
{
return _checkbit;
}
set
{
_checkbit = value;
}
}
[Description("通信超时时间大于零ms"), Category("串口设置")]
public int TimeOut
{
get
{
return _timeout;
}
set
{
_timeout = value;
}
}
}
}