diff --git a/CMS_CORE_Library/Models/ThermoModels.cs b/CMS_CORE_Library/Models/ThermoModels.cs
index 18e0516..e696472 100644
--- a/CMS_CORE_Library/Models/ThermoModels.cs
+++ b/CMS_CORE_Library/Models/ThermoModels.cs
@@ -6,19 +6,151 @@ namespace CMS_CORE_Library.Models
{
public class ThermoModels
{
- #region Thermo models
+
+ #region Fields
protected const double EPSILON = 0.1;
+ #endregion Fields
+
+ #region Classes
+
+ ///
+ /// Single AXIS Info Data
+ ///
+ public class AxisInfo
+ {
+
+ #region Properties
+
+ public int ControlWord { get; set; } = 0;
+ public int ErrorCode { get; set; } = 0;
+ public int Id { get; set; } = 0;
+ public int MovPhase { get; set; } = 0;
+ public int StatusWord { get; set; } = 0;
+ public double TargetPos { get; set; } = 0;
+
+ #endregion Properties
+
+ #region Methods
+
+ public override bool Equals(object obj)
+ {
+ // Object is not a GaugeModel instance
+ if (!(obj is AxisInfo item))
+ return false;
+
+ if (Id != item.Id)
+ return false;
+ if (ErrorCode != item.ErrorCode)
+ return false;
+ if (MovPhase != item.MovPhase)
+ return false;
+ if (StatusWord != item.StatusWord)
+ return false;
+ if (ControlWord != item.ControlWord)
+ return false;
+ if (TargetPos != item.TargetPos)
+ return false;
+ return true;
+ }
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ #endregion Methods
+
+ }
+
+ ///
+ /// Single AXIS RealTime (positions / movement) Data
+ ///
+ public class AxisRT
+ {
+
+ #region Constructors
+
+ ///
+ /// Deserializzazione da byte ad oggetto AxisRT
+ ///
+ ///
+ public AxisRT(int currId, byte[] rawData)
+ {
+ // converto i dati da byte grezzi ai 3 componenti...
+ Id = currId;
+ Position = S7.Net.Types.Double.FromByteArray(rawData.Skip(0).Take(4).ToArray());
+ Speed = S7.Net.Types.Double.FromByteArray(rawData.Skip(4).Take(4).ToArray());
+ Load = S7.Net.Types.Double.FromByteArray(rawData.Skip(8).Take(4).ToArray());
+ }
+
+ #endregion Constructors
+
+ #region Properties
+
+ public int Id { get; set; } = 0;
+ public double Load { get; set; } = 0;
+ public double Position { get; set; } = 0;
+ public double Speed { get; set; } = 0;
+
+ #endregion Properties
+
+ #region Methods
+
+ ///
+ /// Converte un singolo item in un array di byte per scrittura su PLC S7
+ ///
+ ///
+ public byte[] convertToByte()
+ {
+ byte[] answ = new byte[12];
+ Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Position), 0, answ, 0, 4);
+ Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Speed), 0, answ, 4, 4);
+ Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Load), 0, answ, 8, 4);
+ return answ;
+ }
+
+ public override bool Equals(object obj)
+ {
+ // Object is not a GaugeModel instance
+ if (!(obj is AxisRT item))
+ return false;
+
+ if (Id != item.Id)
+ return false;
+ if (Position != item.Position)
+ return false;
+ if (Speed != item.Speed)
+ return false;
+ if (Load != item.Load)
+ return false;
+ return true;
+ }
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ #endregion Methods
+
+ }
+
///
/// Represents thermo LIVE prod data (gauge, time adv...)
///
public class LiveProdDataModel
{
- public double TimeAdv { get; set; } = 0;
- public double Power { get; set; } = 0;
- public double Vacuum { get; set; } = 0;
+
+ #region Properties
+
public double Air { get; set; } = 0;
+ public double Power { get; set; } = 0;
+ public double TimeAdv { get; set; } = 0;
+ public double Vacuum { get; set; } = 0;
+
+ #endregion Properties
+
+ #region Methods
public override bool Equals(object obj)
{
@@ -45,169 +177,31 @@ namespace CMS_CORE_Library.Models
{
return base.GetHashCode();
}
+
+ #endregion Methods
+
}
- ///
- /// Recipe Parameters
- ///
- public class RecipeParam
- {
- public short Id { get; set; } = 0;
- public double SetpointHMI { get; set; } = 0;
- public double SetpointPLC { get; set; } = 0;
- public double ValMax { get; set; } = 0;
- public double ValMin { get; set; } = 0;
- public ushort UnitMeasure { get; set; } = 0;
- public bool Visible { get; set; } = false;
- public bool Enabled { get; set; } = false;
- public bool HasError { get; set; } = false;
- public double ValueAct { get; set; } = 0;
- public int ScaleFactor { get; set; } = 1;
-
- public override bool Equals(object obj)
- {
- // Object is not a GaugeModel instance
- if (!(obj is RecipeParam item))
- return false;
-
- if (Id != item.Id)
- return false;
- if (SetpointHMI != item.SetpointHMI)
- return false;
- if (SetpointPLC != item.SetpointPLC)
- return false;
- if (ValMax != item.ValMax)
- return false;
- if (ValMin != item.ValMin)
- return false;
- if (UnitMeasure != item.UnitMeasure)
- return false;
- if (Visible != item.Visible)
- return false;
- if (Enabled != item.Enabled)
- return false;
- if (HasError != item.HasError)
- return false;
- if (ValueAct != item.ValueAct)
- return false;
- if (ScaleFactor != item.ScaleFactor)
- return false;
-
- return true;
- }
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
- }
- ///
- /// Single AXIS RealTime (positions / movement) Data
- ///
- public class AxisRT
- {
- public int Id { get; set; } = 0;
- public double Position { get; set; } = 0;
- public double Speed { get; set; } = 0;
- public double Load { get; set; } = 0;
-
-
- public override bool Equals(object obj)
- {
- // Object is not a GaugeModel instance
- if (!(obj is AxisRT item))
- return false;
-
- if (Id != item.Id)
- return false;
- if (Position != item.Position)
- return false;
- if (Speed != item.Speed)
- return false;
- if (Load != item.Load)
- return false;
- return true;
- }
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
-
- ///
- /// Deserializzazione da byte ad oggetto AxisRT
- ///
- ///
- public AxisRT(int currId, byte[] rawData)
- {
- // converto i dati da byte grezzi ai 3 componenti...
- Id = currId;
- Position = S7.Net.Types.Double.FromByteArray(rawData.Skip(0).Take(4).ToArray());
- Speed = S7.Net.Types.Double.FromByteArray(rawData.Skip(4).Take(4).ToArray());
- Load = S7.Net.Types.Double.FromByteArray(rawData.Skip(8).Take(4).ToArray());
- }
- ///
- /// Converte un singolo item in un array di byte per scrittura su PLC S7
- ///
- ///
- public byte[] convertToByte()
- {
- byte[] answ = new byte[12];
- Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Position), 0, answ, 0, 4);
- Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Speed), 0, answ, 4, 4);
- Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(Load), 0, answ, 8, 4);
- return answ;
- }
- }
- ///
- /// Single AXIS Info Data
- ///
- public class AxisInfo
- {
- public int Id { get; set; } = 0;
- public int ErrorCode { get; set; } = 0;
- public int MovPhase { get; set; } = 0;
- public int StatusWord { get; set; } = 0;
- public int ControlWord { get; set; } = 0;
- public double TargetPos { get; set; } = 0;
-
- public override bool Equals(object obj)
- {
- // Object is not a GaugeModel instance
- if (!(obj is AxisInfo item))
- return false;
-
- if (Id != item.Id)
- return false;
- if (ErrorCode != item.ErrorCode)
- return false;
- if (MovPhase != item.MovPhase)
- return false;
- if (StatusWord != item.StatusWord)
- return false;
- if (ControlWord != item.ControlWord)
- return false;
- if (TargetPos != item.TargetPos)
- return false;
- return true;
- }
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
- }
-
public class ModuleBlock
{
- public short Id { get; set; } = 0;
+
+ #region Properties
+
public int ActualDelay { get; set; } = 0;
public int ActualDuration { get; set; } = 0;
public int EstimatedDelay { get; set; } = 0;
public int EstimatedDuration { get; set; } = 0;
- public List PrecedingId { get; set; } = new List();
- public bool Visible { get; set; } = false;
- public bool Running { get; set; } = false;
public bool HasError { get; set; } = false;
+ public short Id { get; set; } = 0;
+ public List PrecedingId { get; set; } = new List();
+ public bool Running { get; set; } = false;
public bool Terminated { get; set; } = false;
+ public bool Visible { get; set; } = false;
+
+ #endregion Properties
+
+ #region Methods
public override bool Equals(object obj)
{
@@ -242,39 +236,41 @@ namespace CMS_CORE_Library.Models
{
return base.GetHashCode();
}
+
+ #endregion Methods
+
}
- public class WarmerChannel
+ public class ProdCycleModel
{
- public int IdChannel { get; set; } = 0;
- public byte IdRefl { get; set; } = 0;
- public byte SetpointHMI { get; set; } = 0;
- public byte SetpointThermoCam { get; set; } = 0;
- public byte SetpointPLC { get; set; } = 0;
- public byte ChStatus { get; set; } = 0;
- public double CurrAct { get; set; } = 0;
- public byte PercAct { get; set; } = 0;
- public int MaxPower { get; set; } = 0;
+
+ #region Properties
+
+ public ushort MessageId { get; set; } = 0;
+ public ushort Mode { get; set; } = 0;
+ public ushort Status { get; set; } = 0;
+ public ushort Submode { get; set; } = 0;
+ public uint TimeAdv { get; set; } = 0;
+
+ #endregion Properties
+
+ #region Methods
public override bool Equals(object obj)
{
// Object is not a GaugeModel instance
- if (!(obj is WarmerChannel item))
+ if (!(obj is ProdCycleModel item))
return false;
- if (IdChannel != item.IdChannel)
+ if (Status != item.Status)
return false;
- if (SetpointHMI != item.SetpointHMI)
+ if (MessageId != item.MessageId)
return false;
- if (SetpointThermoCam != item.SetpointThermoCam)
+ if (Mode != item.Mode)
return false;
- if (SetpointPLC != item.SetpointPLC)
+ if (Submode != item.Submode)
return false;
- if (ChStatus != item.ChStatus)
- return false;
- if (CurrAct != item.CurrAct)
- return false;
- if (PercAct != item.PercAct)
+ if (TimeAdv != item.TimeAdv)
return false;
return true;
@@ -283,28 +279,61 @@ namespace CMS_CORE_Library.Models
{
return base.GetHashCode();
}
- }
+ #endregion Methods
+
+ }
public class ProdInfoModel
{
+
+ #region Properties
+
public DateTime DtEvent { get; set; } = DateTime.Now;
- public short NumTarget { get; set; } = 0;
+ public bool IsScrap { get; set; } = false;
+ public double MaterialTempEndVent { get; set; } = 0;
+ public double MaterialTempEndWarm { get; set; } = 0;
+ public double MoldTemp { get; set; } = 0;
+ public double MouldEnergyIN { get; set; } = 0;
+ public double MouldEnergyOUT { get; set; } = 0;
public short NumDone { get; set; } = 0;
+ public short NumPreHot { get; set; } = 0;
+ public short NumTarget { get; set; } = 0;
public short PreWarmCycle { get; set; } = 0;
- public int TimeWarm { get; set; } = 0;
- public int TimeVent { get; set; } = 0;
- public int TimeVacuum { get; set; } = 0;
public int TimeCycleGross { get; set; } = 0;
public int TimeCycleNet { get; set; } = 0;
- public double MaterialTempEndWarm { get; set; } = 0;
- public double MaterialTempEndVent { get; set; } = 0;
- public double MoldTemp { get; set; } = 0;
+ public int TimeVacuum { get; set; } = 0;
+ public int TimeVent { get; set; } = 0;
+ public int TimeWarm { get; set; } = 0;
public double VacuumReadVal { get; set; } = 0;
- public double MouldEnergyOUT { get; set; } = 0;
- public double MouldEnergyIN { get; set; } = 0;
- public bool IsScrap { get; set; } = false;
- public short NumPreHot { get; set; } = 0;
+
+ #endregion Properties
+
+ #region Methods
+
+ ///
+ /// Converte un singolo item in un array di byte per scrittura su PLC S7
+ ///
+ ///
+ public byte[] convertToByte()
+ {
+ byte[] answ = new byte[50];
+ Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumTarget), 0, answ, 0, 2);
+ Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumDone), 0, answ, 2, 2);
+ Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(PreWarmCycle), 0, answ, 4, 2);
+ Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeWarm), 0, answ, 6, 4);
+ Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVent), 0, answ, 10, 4);
+ Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVacuum), 0, answ, 14, 4);
+ Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleGross), 0, answ, 18, 4);
+ Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleNet), 0, answ, 22, 4);
+ Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndWarm), 0, answ, 26, 4);
+ Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndVent), 0, answ, 30, 4);
+ Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MoldTemp), 0, answ, 34, 4);
+ Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(VacuumReadVal), 0, answ, 38, 4);
+ Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyOUT), 0, answ, 42, 4);
+ Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyIN), 0, answ, 46, 4);
+ return answ;
+ }
public override bool Equals(object obj)
{
@@ -354,54 +383,61 @@ namespace CMS_CORE_Library.Models
return base.GetHashCode();
}
- ///
- /// Converte un singolo item in un array di byte per scrittura su PLC S7
- ///
- ///
- public byte[] convertToByte()
- {
- byte[] answ = new byte[50];
- Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumTarget), 0, answ, 0, 2);
- Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumDone), 0, answ, 2, 2);
- Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(PreWarmCycle), 0, answ, 4, 2);
- Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeWarm), 0, answ, 6, 4);
- Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVent), 0, answ, 10, 4);
- Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVacuum), 0, answ, 14, 4);
- Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleGross), 0, answ, 18, 4);
- Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleNet), 0, answ, 22, 4);
- Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndWarm), 0, answ, 26, 4);
- Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndVent), 0, answ, 30, 4);
- Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MoldTemp), 0, answ, 34, 4);
- Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(VacuumReadVal), 0, answ, 38, 4);
- Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyOUT), 0, answ, 42, 4);
- Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyIN), 0, answ, 46, 4);
- return answ;
- }
+ #endregion Methods
+
}
- public class ProdCycleModel
+ ///
+ /// Recipe Parameters
+ ///
+ public class RecipeParam
{
- public ushort Status { get; set; } = 0;
- public ushort MessageId { get; set; } = 0;
- public ushort Mode { get; set; } = 0;
- public ushort Submode { get; set; } = 0;
- public uint TimeAdv { get; set; } = 0;
+
+ #region Properties
+
+ public bool Enabled { get; set; } = false;
+ public bool HasError { get; set; } = false;
+ public short Id { get; set; } = 0;
+ public int ScaleFactor { get; set; } = 1;
+ public double SetpointHMI { get; set; } = 0;
+ public double SetpointPLC { get; set; } = 0;
+ public ushort UnitMeasure { get; set; } = 0;
+ public double ValMax { get; set; } = 0;
+ public double ValMin { get; set; } = 0;
+ public double ValueAct { get; set; } = 0;
+ public bool Visible { get; set; } = false;
+
+ #endregion Properties
+
+ #region Methods
public override bool Equals(object obj)
{
// Object is not a GaugeModel instance
- if (!(obj is ProdCycleModel item))
+ if (!(obj is RecipeParam item))
return false;
- if (Status != item.Status)
+ if (Id != item.Id)
return false;
- if (MessageId != item.MessageId)
+ if (SetpointHMI != item.SetpointHMI)
return false;
- if (Mode != item.Mode)
+ if (SetpointPLC != item.SetpointPLC)
return false;
- if (Submode != item.Submode)
+ if (ValMax != item.ValMax)
return false;
- if (TimeAdv != item.TimeAdv)
+ if (ValMin != item.ValMin)
+ return false;
+ if (UnitMeasure != item.UnitMeasure)
+ return false;
+ if (Visible != item.Visible)
+ return false;
+ if (Enabled != item.Enabled)
+ return false;
+ if (HasError != item.HasError)
+ return false;
+ if (ValueAct != item.ValueAct)
+ return false;
+ if (ScaleFactor != item.ScaleFactor)
return false;
return true;
@@ -410,8 +446,121 @@ namespace CMS_CORE_Library.Models
{
return base.GetHashCode();
}
+
+ #endregion Methods
+
+ }
+ public class WarmerChannel
+ {
+
+ #region Properties
+
+ ///
+ /// Channel status
+ ///
+ public byte ChStatus { get; set; } = 0;
+
+ ///
+ /// Channel AMPERE actual value
+ ///
+ public double CurrAct { get; set; } = 0;
+
+ ///
+ /// Channel Unique ID (from risk2007)
+ ///
+ public int IdChannel { get; set; } = 0;
+
+ ///
+ /// Reflector ID
+ ///
+ public byte IdRefl { get; set; } = 0;
+
+ ///
+ /// Channel MaxPower
+ ///
+ public int MaxPower { get; set; } = 0;
+
+ ///
+ /// Channel actual value %
+ ///
+ public byte PercAct { get; set; } = 0;
+
+ ///
+ /// Setpoint from HMI (%)
+ ///
+ public byte SetpointHMI { get; set; } = 0;
+
+ ///
+ /// Setpoint from PLC (%)
+ ///
+ public byte SetpointPLC { get; set; } = 0;
+
+ ///
+ /// Define if camera is active for channel
+ ///
+ public bool ThermocamActive { get; set; } = false;
+
+ ///
+ /// Actual value from last ThermoCam image acquisition (° Celsius)
+ ///
+ public double ThermocamActualTemp { get; set; } = 0;
+
+ ///
+ /// Setpoint from HMI (° Celsius)
+ ///
+ public byte ThermocamSetpoint { get; set; } = 0;
+
+ #endregion Properties
+
+ #region Methods
+
+ ///
+ /// Equality test for class object
+ ///
+ ///
+ ///
+ public override bool Equals(object obj)
+ {
+ // Object is not a GaugeModel instance
+ if (!(obj is WarmerChannel item))
+ return false;
+
+ if (ChStatus != item.ChStatus)
+ return false;
+ if (CurrAct != item.CurrAct)
+ return false;
+ if (IdChannel != item.IdChannel)
+ return false;
+ if (PercAct != item.PercAct)
+ return false;
+ if (SetpointHMI != item.SetpointHMI)
+ return false;
+ if (SetpointPLC != item.SetpointPLC)
+ return false;
+ if (ThermocamActive != item.ThermocamActive)
+ return false;
+ if (ThermocamActualTemp != item.ThermocamActualTemp)
+ return false;
+ if (ThermocamSetpoint != item.ThermocamSetpoint)
+ return false;
+
+ return true;
+ }
+
+ ///
+ /// Hash gen
+ ///
+ ///
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ #endregion Methods
+
}
- #endregion
+ #endregion Classes
+
}
}
diff --git a/CMS_CORE_Library/NcThermo.cs b/CMS_CORE_Library/NcThermo.cs
index 9588a6e..2614fd9 100644
--- a/CMS_CORE_Library/NcThermo.cs
+++ b/CMS_CORE_Library/NcThermo.cs
@@ -684,11 +684,17 @@ namespace CMS_CORE_Library
///
public abstract CmsError PLC_WWarmerChSetpHmi(Dictionary newData);
///
- /// Set current Warmers Channels setpoints
+ /// Set current Warmers Channels ThermocamSetpoints (°C)
///
///
///
- public abstract CmsError PLC_WWarmerChSetpTCam(Dictionary newData);
+ public abstract CmsError PLC_WWarmerChTCamSetp(Dictionary newData);
+ ///
+ /// Set current Warmers Channels Thermocam read (actual) value (°C)
+ ///
+ ///
+ ///
+ public abstract CmsError PLC_WWarmerChTCamActual(Dictionary newData);
///
/// Set current Warmers Channels reflector's data
///
diff --git a/CMS_CORE_Library/S7Net/Nc_S7Net.cs b/CMS_CORE_Library/S7Net/Nc_S7Net.cs
index 38dc27d..154c964 100644
--- a/CMS_CORE_Library/S7Net/Nc_S7Net.cs
+++ b/CMS_CORE_Library/S7Net/Nc_S7Net.cs
@@ -2359,8 +2359,12 @@ namespace CMS_CORE_Library.S7Net
refreshRiscSetpointHMI();
// refresh setpoint PLC
refreshRiscSetpointPLC();
- // refresh setpoint termocamera ???
- refreshRiscSetpointTermoCam();
+
+ // refresh dati termocamera
+ refreshRiscTermoCamAbilit();
+ refreshRiscTermoCamCommStatus();
+ refreshRiscTermoCamTempAct();
+ refreshRiscTermoCamTempSet();
// copio lista act in output
currWarmerChannelList = ThermoWarmChannels;
@@ -2945,9 +2949,30 @@ namespace CMS_CORE_Library.S7Net
}
///
- /// Refresh Canali Riscaldi: SetPoint Termocamera
+ /// Refresh dati ThermoCamera dal PLC: temperatura impostata come riferimento
///
- private void refreshRiscSetpointTermoCam()
+ private void refreshRiscTermoCamTempSet()
+ {
+ // FIXME TODO ???? da dove prendere info?
+ }
+ ///
+ /// Refresh dati ThermoCamera dal PLC: ultima temp letta
+ ///
+ private void refreshRiscTermoCamTempAct()
+ {
+ // FIXME TODO ???? da dove prendere info?
+ }
+ ///
+ /// Refresh dati ThermoCamera dal PLC x area command/status
+ ///
+ private void refreshRiscTermoCamCommStatus()
+ {
+ // FIXME TODO ???? da dove prendere info?
+ }
+ ///
+ /// Refresh dati ThermoCamera dal PLC x area command/status
+ ///
+ private void refreshRiscTermoCamAbilit()
{
// FIXME TODO ???? da dove prendere info?
}
@@ -2956,7 +2981,7 @@ namespace CMS_CORE_Library.S7Net
///
private void refreshRiscSetpointHMI()
{
- // leggo DB514 x area Ich
+ // leggo DB614 x area Ich
List currMem = new List();
// leggo da PLC a array di byte di appoggio...
@@ -3171,11 +3196,46 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
///
- /// Write Warmers channels termocam data
+ /// Set current Warmers Channels ThermocamSetpoints (°C)
///
///
///
- public override CmsError PLC_WWarmerChSetpTCam(Dictionary newData)
+ public override CmsError PLC_WWarmerChTCamSetp(Dictionary newData)
+ {
+ // FIXME TODO serve nuova area termocamera
+#if false
+ // memory area
+ byte[] newMem = new byte[newData.Count];
+ List currMem = new List();
+
+ // read actual data on memory...
+ CmsError libraryError = MEM_RWByteList(R, 0, RISC_CHP_DATA.MemType, RISC_CHP_DATA.Address, RISC_CHP_DATA.SubAddress, 0, RISC_CHP_DATA.Size, ref currMem);
+ if (libraryError.IsError())
+ return libraryError;
+
+ newMem = currMem.ToArray();
+
+ // update only given data...
+ foreach (var item in newData)
+ {
+ newMem[item.Key - 1] = (byte)item.Value;
+ }
+ // return as list...
+ currMem = newMem.ToList();
+ // scrivo sul PLC array di byte...
+ libraryError = MEM_RWByteList(W, 0, RISC_CHP_DATA.MemType, RISC_CHP_DATA.Address, RISC_CHP_DATA.SubAddress, 0, RISC_CHP_DATA.Size, ref currMem);
+ if (libraryError.IsError())
+ return libraryError;
+#endif
+
+ return NO_ERROR;
+ }
+ ///
+ /// Set current Warmers Channels Thermocam read (actual) value (°C)
+ ///
+ ///
+ ///
+ public override CmsError PLC_WWarmerChTCamActual(Dictionary newData)
{
// FIXME TODO serve nuova area termocamera
#if false
@@ -4926,6 +4986,15 @@ namespace CMS_CORE_Library.S7Net
internal static MEMORY_CELL RISC_OVP_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 514, 10752, 1024);
internal static MEMORY_CELL RISC_ICH_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 514, 11776, 4096);
+ // ThermoCamera
+ internal static MEMORY_CELL TCAM_STAT_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 626, 0, 2);
+ internal static MEMORY_CELL TCAM_COMM_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 626, 2, 2);
+ internal static MEMORY_CELL TCAM_CH_ENAB_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 626, 4, 128);
+ internal static MEMORY_CELL TCAM_TEMP_REQ_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 624, 0, 2048);
+ internal static MEMORY_CELL TCAM_TEMP_ACT_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 625, 0, 2048);
+ internal static MEMORY_CELL TCAM_CHP_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 627, 0, 1024);
+
+
// produzione
internal static MEMORY_CELL PROCESS_PROD_INFO = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 606, 0, 52);
internal static MEMORY_CELL PROCESS_PROD_CYCLE = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 605, 0, 22);