laatzen/Common/modbus_master_csharp/Communication/DeviceExceptionData.cs

68 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace XYLEM.Communication
{
/// <summary>
/// Class to contain data for a exception
/// </summary>
public struct DeviceExceptionData
{
/// <summary>
/// Special function has to be done when this com
/// https://mjksvn.world.fluidtechnology.net:4443/svn/development/- MJK Standards/- Communication protocols/Modbus/Modbus Specifications.doc
/// "2.2.1 MODBUS Exception Responses:"
/// </summary>
public enum SpecialType
{
DriverError = -1,
WaitForReset = 14, // Wait x sec befor next tx
WaitForFinishMax5s = 252, // Wait Exception OK (max 5s)
OnlyAnInforead = 253, // Used internal to only make an info read about data to read / write (Not intentet for normal TX)
WaitForFinishMax60s = 254, // Wait Exception OK (max 60s)
WaitForFinishMax5Min = 255, // Wait Exception OK (max 5min)
}
/// <summary>
/// Exception No.
/// </summary>
private int _ExcNo;
/// <summary>
/// Exception Info
/// </summary>
private string _Info;
/// <summary>
/// Preload All data.. used when init data array
/// </summary>
/// <param name="iExcNo"></param>
/// <param name="info"></param>
public DeviceExceptionData(int excNo, string info)
{
this._ExcNo = excNo;
this._Info = info;
}
/// <summary>
/// Exception code number
/// </summary>
public int ExcNo
{
get { return _ExcNo; }
set { _ExcNo = value; }
}
/// <summary>
/// Info text to exception no.
/// </summary>
public String Info
{
get { return _Info; }
set { _Info = value; }
}
}
}