Added HistorySheets values
This commit is contained in:
@@ -817,6 +817,24 @@ namespace CMS_CORE_Library.Models
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
/// <summary>
|
||||
/// Recipe Parameters
|
||||
/// </summary>
|
||||
public class HistorySheet
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public bool newData { get; set; } = false;
|
||||
public double Value1 { get; set; } = 0;
|
||||
public double Value2 { get; set; } = 0;
|
||||
public double Value3 { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
|
||||
#endregion Public Classes
|
||||
}
|
||||
|
||||
@@ -823,6 +823,17 @@ namespace CMS_CORE_Library
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_RProdCycle(ref ThermoModels.ProdCycleModel currProdCycle);
|
||||
/// <summary>
|
||||
/// Get current HistorySheets
|
||||
/// </summary>
|
||||
/// <param name="historySheet"></param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_RHistorySheets(ref ThermoModels.HistorySheet historySheet);
|
||||
/// <summary>
|
||||
/// Write ack
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_WAckHistorySheets();
|
||||
/// <summary>
|
||||
/// Request for mode selection via strobe
|
||||
/// </summary>
|
||||
/// <param name="mode">1: MAN, 2: AUTO, 3: SETUP</param>
|
||||
|
||||
@@ -183,6 +183,9 @@ namespace CMS_CORE_Library.S7Net
|
||||
|
||||
internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 605, 0, 2);
|
||||
|
||||
internal static MEMORY_CELL HISTORY_SHEETS = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 143, 2, 14);
|
||||
internal static MEMORY_CELL HISTORY_ACK_SHEETS = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 143, 0, 2);
|
||||
|
||||
// Prod strobe/ack
|
||||
internal static MEMORY_CELL PROD_ACK = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 0, 2);
|
||||
|
||||
@@ -3743,6 +3746,51 @@ namespace CMS_CORE_Library.S7Net
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get current HistorySheets
|
||||
/// </summary>
|
||||
/// <param name="historySheet"></param>
|
||||
/// <returns></returns>
|
||||
///
|
||||
public override CmsError PLC_RHistorySheets(ref ThermoModels.HistorySheet historySheet)
|
||||
{
|
||||
List<byte> currMem = new List<byte>();
|
||||
CmsError libraryError = MEM_RWByteList(R, 0, HISTORY_SHEETS.MemType, HISTORY_SHEETS.Address, HISTORY_SHEETS.SubAddress, 0, HISTORY_SHEETS.Size, ref currMem);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
// converto!
|
||||
historySheet = new ThermoModels.HistorySheet()
|
||||
{
|
||||
newData = (S7.Net.Types.Int.FromByteArray(currMem.Skip(0).Take(2).ToArray()) & 1) == 1,
|
||||
Value1 = S7.Net.Types.Real.FromByteArray(currMem.Skip(2).Take(4).ToArray()),
|
||||
Value2 = S7.Net.Types.Real.FromByteArray(currMem.Skip(6).Take(4).ToArray()),
|
||||
Value3 = S7.Net.Types.Real.FromByteArray(currMem.Skip(10).Take(4).ToArray()),
|
||||
};
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WriteAck HistorySheets
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
///
|
||||
|
||||
public override CmsError PLC_WAckHistorySheets()
|
||||
{
|
||||
|
||||
CmsError libraryError = NO_ERROR;
|
||||
|
||||
// Call ack for config request RISK
|
||||
libraryError = PLC_WAck(true,HISTORY_ACK_SHEETS, HISTORY_SHEETS, 1);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
return libraryError;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// read current recipe parameter list
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user