commentato parte modbus (uso std paramPLC

This commit is contained in:
Samuele Locatelli
2021-09-25 10:22:25 +02:00
parent 761c753ea8
commit af0dcd1ce8
+34 -36
View File
@@ -188,25 +188,18 @@ namespace IOB_UT_NEXT
#endregion Public Methods
}
#if false
/// <summary>
/// Struttura della conf memoria ModBus
/// </summary>
public class BaseModbusConf
{
#region Public Enums
public enum DataType
{
ND = 0,
Bit,
Int,
Real
}
public enum MemDirection
{
R,
W
BIT,
INT,
REAL
}
public enum MemType
@@ -218,53 +211,58 @@ namespace IOB_UT_NEXT
HoldingRegister = 4
}
#endregion Public Enums
#region Public Properties
/// <summary>
/// Elenco aree memoria ModBus in lettura
/// </summary>
public List<ModbusMemArea> mMapRead { get; set; } = new List<ModbusMemArea>();
/// <summary>
/// Elenco aree memoria mobdus
/// Elenco aree memoria ModBus in scrittura
/// </summary>
public List<ModbusMemArea> MemoryList { get; set; } = new List<ModbusMemArea>();
#endregion Public Properties
#region Public Classes
public List<ModbusMemArea> mMapWrite { get; set; } = new List<ModbusMemArea>();
/// <summary>
/// struttura di base memoria ModBus
/// </summary>
public class ModbusMemArea
{
#region Public Properties
public ushort BaseAddr { get; set; } = 0;
public string RawAddr { get; set; } = "";
public ushort Size { get; set; } = 2;
public ushort Size { get; set; } = 0;
[JsonConverter(typeof(StringEnumConverter))]
public MemType Type { get; set; } = MemType.ND;
public List<VarConf> VarList { get; set; } = new List<VarConf>();
#endregion Public Properties
}
public class VarConf
{
#region Public Properties
public string description { get; set; } = "";
public int factor { get; set; } = 1;
public MemDirection Direction { get; set; } = MemDirection.R;
public ushort MemAddr { get; set; } = 0;
public string Name { get; set; } = "ND";
public int RangeMax { get; set; } = 0;
public int RangeMin { get; set; } = 0;
public ushort Size { get; set; } = 2;
public DataType Type { get; set; } = DataType.ND;
public bool hasRange
{
get
{
return !this.minVal.Equals(this.maxVal);
}
}
#endregion Public Properties
public ushort index { get; set; } = 0;
public int maxVal { get; set; } = 0;
public string memAddr { get; set; } = "";
public int minVal { get; set; } = 0;
public string name { get; set; } = "none";
public ushort size { get; set; } = 0;
[JsonConverter(typeof(StringEnumConverter))]
public DataType tipoMem { get; set; } = DataType.ND;
public string value { get; set; } = "";
}
#endregion Public Classes
}
#endif
/// <summary>
/// Classe gestione configurazione parametri di base x configuraizone estesa (es MTConnect, OPC-UA, ...)