added equals methods to base thermo object

This commit is contained in:
Samuele Locatelli
2020-05-30 11:42:27 +02:00
parent d6b5260db6
commit aed350dbe9
5 changed files with 321 additions and 349 deletions
-1
View File
@@ -151,7 +151,6 @@
<Compile Include="Fanuc\Nc_Fanuc.cs" />
<Compile Include="Models\NcToolModel.cs" />
<Compile Include="Models\PreAndPostPowerOnModels.cs" />
<Compile Include="Models\ThermoModels.cs" />
<Compile Include="Models\SiemensToolModels.cs" />
<Compile Include="NcThermo.cs" />
<Compile Include="Nc.cs" />
+195 -4
View File
@@ -535,7 +535,46 @@ namespace CMS_CORE_Library.Models
#region Thermo models
/// <summary>
/// Represents thermo gauge data
/// </summary>
public class GaugeModel
{
public uint TimeAdv { get; set; } = 0;
public int Power { get; set; } = 0;
public int Vacuum { get; set; } = 0;
public int Air { get; set; } = 0;
public override bool Equals(object obj)
{
// Object is not a GaugeModel instance
if (!(obj is GaugeModel item))
return false;
if (TimeAdv != item.TimeAdv)
return false;
if (Power != item.Power)
return false;
if (Vacuum != item.Vacuum)
return false;
if (Air != item.Air)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
/// <summary>
/// Recipe Parameters
/// </summary>
public class RecipeParam
{
public short Id { get; set; } = 0;
@@ -548,20 +587,86 @@ namespace CMS_CORE_Library.Models
public bool Enabled { get; set; } = false;
public bool HasError { get; set; } = false;
public double ValueAct { get; set; } = 0;
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;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
public class ModuleBlock
{
public ushort Id { get; set; } = 0;
public uint EstimatedDuration { get; set; } = 0;
public uint EstimatedDelay { get; set; } = 0;
public List<ushort> PrecedingId { get; set; } = new List<ushort>();
public uint ActualDuration { get; set; } = 0;
public uint ActualDelay { get; set; } = 0;
public uint ActualDuration { get; set; } = 0;
public uint EstimatedDelay { get; set; } = 0;
public uint EstimatedDuration { get; set; } = 0;
public List<ushort> PrecedingId { get; set; } = new List<ushort>();
public bool Visible { get; set; } = false;
public bool Running { get; set; } = false;
public bool HasError { get; set; } = false;
public override bool Equals(object obj)
{
// Object is not a GaugeModel instance
if (!(obj is ModuleBlock item))
return false;
if (Id != item.Id)
return false;
if (ActualDelay != item.ActualDelay)
return false;
if (ActualDuration != item.ActualDuration)
return false;
if (EstimatedDelay != item.EstimatedDelay)
return false;
if (EstimatedDuration != item.EstimatedDuration)
return false;
if (PrecedingId != item.PrecedingId)
return false;
if (Visible != item.Visible)
return false;
if (Running != item.Running)
return false;
if (HasError != item.HasError)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
public class WarmerChannel
@@ -571,6 +676,30 @@ namespace CMS_CORE_Library.Models
public byte SetpointPLC { get; set; } = 0;
public byte ChStatus { get; set; } = 0;
public byte PercAct { get; set; } = 0;
public override bool Equals(object obj)
{
// Object is not a GaugeModel instance
if (!(obj is WarmerChannel item))
return false;
if (IdChannel != item.IdChannel)
return false;
if (SetpointThermoCam != item.SetpointThermoCam)
return false;
if (SetpointPLC != item.SetpointPLC)
return false;
if (ChStatus != item.ChStatus)
return false;
if (PercAct != item.PercAct)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
@@ -589,6 +718,46 @@ namespace CMS_CORE_Library.Models
public double VacuumReadVal { get; set; } = 0;
public double MouldEnergyOUT { get; set; } = 0;
public double MouldEnergyIN { get; set; } = 0;
public override bool Equals(object obj)
{
// Object is not a GaugeModel instance
if (!(obj is ProdInfo item))
return false;
if (NumTarget != item.NumTarget)
return false;
if (NumDone != item.NumDone)
return false;
if (TimeWarm != item.TimeWarm)
return false;
if (TimeVent != item.TimeVent)
return false;
if (TimeVacuum != item.TimeVacuum)
return false;
if (TimeCycleGross != item.TimeCycleGross)
return false;
if (TimeCycleNet != item.TimeCycleNet)
return false;
if (MaterialTempEndWarm != item.MaterialTempEndWarm)
return false;
if (MaterialTempEndVent != item.MaterialTempEndVent)
return false;
if (MoldTemp != item.MoldTemp)
return false;
if (VacuumReadVal != item.VacuumReadVal)
return false;
if (MouldEnergyOUT != item.MouldEnergyOUT)
return false;
if (MouldEnergyIN != item.MouldEnergyIN)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
public class ProdCycle
@@ -597,6 +766,28 @@ namespace CMS_CORE_Library.Models
public ushort MessageId { get; set; } = 0;
public ushort Mode { get; set; } = 0;
public uint TimeAdv { get; set; } = 0;
public override bool Equals(object obj)
{
// Object is not a GaugeModel instance
if (!(obj is ProdCycle item))
return false;
if (Status != item.Status)
return false;
if (MessageId != item.MessageId)
return false;
if (Mode != item.Mode)
return false;
if (TimeAdv != item.TimeAdv)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
#endregion
-44
View File
@@ -1,44 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CMS_CORE_Library.Models
{
public class ThermoModels
{
/// <summary>
/// Represents thermo gauge data
/// </summary>
public class GaugeModel
{
public uint TimeAdv { get; set; } = 0;
public int Power { get; set; } = 0;
public int Vacuum { get; set; } = 0;
public int Air { get; set; } = 0;
public override bool Equals(object obj)
{
// Object is not a DTOProcessDataModel instance
if (!(obj is GaugeModel item))
return false;
if (TimeAdv != item.TimeAdv)
return false;
if (Power != item.Power)
return false;
if (Vacuum != item.Vacuum)
return false;
if (Air != item.Air)
return false;
return true;
}
}
}
}
+18 -3
View File
@@ -6,7 +6,6 @@ using System.Globalization;
using System.IO;
using System.Reflection;
using static CMS_CORE_Library.Models.DataStructures;
using static CMS_CORE_Library.Models.ThermoModels;
using static CMS_CORE_Library.Nc;
using static CMS_CORE_Library.Nc.MEMORY_TYPE;
@@ -631,11 +630,27 @@ namespace CMS_CORE_Library
#region THERMO high level data
/// <summary>
/// Get current recipe parameter list
/// </summary>
/// <param name="onlyRT">updates only RT parameters (false = update all)</param>
/// <param name="currParamList"></param>
/// <returns></returns>
public abstract CmsError PLC_RRecipeParamList(bool onlyRT, ref Dictionary<int, RecipeParam> currParamList);
public abstract CmsError PLC_RRecipeLastParamList(ref Dictionary<int, RecipeParam> currParamList);
/// <summary>
/// Write recipe updated parameter
/// </summary>
/// <param name="updtParam"></param>
/// <returns></returns>
public abstract CmsError PLC_WRecipeParam(RecipeParam updtParam);
/// <summary>
/// Get current Modules Block list
/// </summary>
/// <param name="onlyRT">updates only RT parameters (false = update all)</param>
/// <param name="currParamList"></param>
/// <returns></returns>
public abstract CmsError PLC_RModBlocList(bool onlyRT, ref Dictionary<int, RecipeParam> currParamList);
#endregion THERMO high level data
+108 -297
View File
@@ -14,7 +14,6 @@ using System.Threading;
using System.Xml.Linq;
using static CMS_CORE_Library.Models.DataStructures;
using static CMS_CORE_Library.NcThermo;
using static CMS_CORE_Library.Models.ThermoModels;
using static CMS_CORE_Library.Nc.MEMORY_TYPE;
using static CMS_CORE_Library.S7Net.MEMORY_ADDRESS;
using static CMS_CORE_Library.Utils.Nc_Utils;
@@ -24,6 +23,8 @@ namespace CMS_CORE_Library.S7Net
{
public class Nc_S7Net : NcThermo
{
#region costanti ed oggetti
// Global Constants
private const string NcNotFound = "Missing response";
@@ -73,6 +74,8 @@ namespace CMS_CORE_Library.S7Net
/// </summary>
protected Plc currPLC;
#endregion
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region Constructor & global methods
@@ -87,7 +90,6 @@ namespace CMS_CORE_Library.S7Net
{
initObjects(IpAddress, RemotePort, false, true, true, true, true, true);
}
/// <summary>
/// Instantiate The NC-Siemens Class
/// </summary>
@@ -137,7 +139,10 @@ namespace CMS_CORE_Library.S7Net
ThermoProdCycle = new ProdCycle();
ThermoProdInfo = new ProdInfo();
}
/// <summary>
/// Connessione al PLC
/// </summary>
/// <returns></returns>
public override CmsError NC_Connect()
{
// Try to get information
@@ -176,9 +181,10 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
// Disconnect Method
/// <summary>
/// Disconnect Method
/// </summary>
/// <returns></returns>
public override CmsError NC_Disconnect()
{
// Set Connected to FALSE and close the sessions
@@ -194,106 +200,15 @@ namespace CMS_CORE_Library.S7Net
}
return NO_ERROR;
}
#if false
private void SetupToolTableData()
{
DataSvc dataSvc = new DataSvc();
// Read max tool number
Item itemToRead = new Item("/NC/_N_NC_TEA_ACX/$MN_MM_NUM_TOOL");
dataSvc.Read(itemToRead);
MAX_TOOL_NUMER = (int)itemToRead.Value;
// Read max edge per tool number
itemToRead = new Item("/NC/_N_NC_TEA_ACX/$MN_MM_MAX_CUTTING_EDGE_PERTOOL");
dataSvc.Read(itemToRead);
MAX_EDGES_PER_TOOL = (int)itemToRead.Value;
// Read max tools per family
itemToRead = new Item("/NC/_N_NC_TEA_ACX/$MN_MAXNUM_REPLACEMENT_TOOLS");
dataSvc.Read(itemToRead);
MAX_TOOLS_PER_FAMILY = (int)itemToRead.Value;
// Read max multitools number
itemToRead = new Item("/NC/_N_NC_TEA_ACX/$MN_MM_NUM_MULTITOOL");
dataSvc.Read(itemToRead);
MAX_MULTITOOLS_NUMBER = (int)itemToRead.Value;
// Read max tools per multitools
itemToRead = new Item("/NC/_N_NC_TEA_ACX/$MN_MAX_TOOLS_PER_MULTITOOL");
dataSvc.Read(itemToRead);
MAX_TOOLS_PER_MULTITOOL = (int)itemToRead.Value;
// Read file
string[] toolsStrings = ReadToolTableFile();
// Read max multitools locations
itemToRead = new Item("/NC/_N_NC_TEA_ACX/$MN_MM_NUM_MULTITOOL_LOCATIONS");
dataSvc.Read(itemToRead);
MAX_MULTITOOLS_LOCATIONS = (int)itemToRead.Value;
// Read Life option
//itemToRead = new Item("/NC/_N_NC_TEA_ACX/$MN_MM_TOOL_MANAGEMENT_MASK");
//LIFE_OPTION_ACTIVE = GetBitValue(Convert.ToInt32(itemToRead.Value), 6);
// MULTITOOL_OPTION_ACTIVE = GetBitValue(Convert.ToInt32(itemToRead.Value), 10);
MULTITOOL_OPTION_ACTIVE = false;
// Read Life option
itemToRead = new Item("/NC/_N_NC_TEA_ACX/$MNS_ACCESS_WRITE_TM_SUPVIS");
dataSvc.Read(itemToRead);
LIFE_OPTION_ACTIVE = Convert.ToInt32(itemToRead.Value) == 7;
// If not active remove fields from config
if (!LIFE_OPTION_ACTIVE)
RemoveLifeParamsFromConfig();
// Read file
PopulateToolsTableFromFileStrings(toolsStrings);
Array.Clear(toolsStrings, 0, toolsStrings.Count());
//// Subscribe to multitools number
//DataSvc d = new DataSvc();
//Item i = new Item() { Path = "/Tool/MTCatalogue/numMultiTools[u1]" };
//d.Subscribe(MultitoolsNumber_OnChange, i);
}
private void SetupMagazinePositionListener()
{
// Setup magazine positions listener
List<Item> magPosItems = new List<Item>();
foreach (var position in MagazinePositionsData)
{
int paramId = ((position.PositionId - 1) * 11) + 5;
magPosItems.Add(new Item()
{
Path = string.Format("/Tool/Magazine/placeData[c{0} , {1}]", position.MagazineId, paramId),
SymbolicName = position.MagazineId + "_" + position.PositionId
});
}
if (magPosItems.Count > 0)
// Subscribe
MagazinePositionSvc.Subscribe(MagazinePositionEnabled_OnChange, magPosItems.ToArray());
}
private void SetupMagazineActionListener()
{
Item magActionsItem = new Item() { Path = MAGAZINE_ACTION_PATH };
// Setup magazine actions listener
MagazineActionsSvc.Subscribe(MagazineAction_OnChange, magActionsItem);
}
#endif
private void RemoveLifeParamsFromConfig()
{
#if false
SiemensToolFieldsConfig.RemoveAll(x => x.Category == "life");
SiemensEdgesFieldsConfiguration.EdgeConfiguration.RemoveAll(x => x.Category == "life");
#endif
}
/// <summary>
/// Compilazione dizionario allarmi x lingua
/// </summary>
/// <param name="language"></param>
/// <param name="messages"></param>
/// <returns></returns>
public override CmsError NC_GetTranslatedPlcMessages(string language, ref Dictionary<int, string> messages)
{
// FIXME TODO
#if false
string filePath;
try
@@ -324,9 +239,14 @@ namespace CMS_CORE_Library.S7Net
#endif
return FUNCTION_NOT_ALLOWED_ERROR;
}
/// <summary>
/// Elenco lingue disponibili
/// </summary>
/// <param name="languages"></param>
/// <returns></returns>
public override CmsError NC_GetAvailableLanguages(ref ICollection<CultureInfo> languages)
{
// FIXME TODO
#if false
try
{
@@ -373,7 +293,11 @@ namespace CMS_CORE_Library.S7Net
#region High level methods
// Get the processes-count configurated
/// <summary>
/// Get the processes-count configurated
/// </summary>
/// <param name="ProcNumber"></param>
/// <returns></returns>
public override CmsError NC_RProcessesNum(ref ushort ProcNumber)
{
CmsError cmsError = ReadStaticNCData();
@@ -385,7 +309,11 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
// Get the NC model Name
/// <summary>
/// Get the NC model Name
/// </summary>
/// <param name="ModelName"></param>
/// <returns></returns>
public override CmsError NC_RModelName(ref string ModelName)
{
CmsError cmsError = ReadStaticNCData();
@@ -397,7 +325,11 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
// Get the NC Software Version
/// <summary>
/// Get the NC Software Version
/// </summary>
/// <param name="SWV"></param>
/// <returns></returns>
public override CmsError NC_RSoftwareVersion(ref string SWV)
{
CmsError cmsError = ReadStaticNCData();
@@ -409,7 +341,11 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
// Get the NC Language
/// <summary>
/// Get the NC Language
/// </summary>
/// <param name="Language"></param>
/// <returns></returns>
public override CmsError NC_RLanguage(ref CultureInfo Language)
{
// Read static data
@@ -422,13 +358,21 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
// Set the NC Language
/// <summary>
/// Set the NC Language
/// </summary>
/// <param name="Language"></param>
/// <returns></returns>
public override CmsError NC_WLanguage(CultureInfo Language)
{
return FUNCTION_NOT_ALLOWED_ERROR;
}
// Get the NC Serial number
/// <summary>
/// Get the NC Serial number
/// </summary>
/// <param name="serialNumber"></param>
/// <returns></returns>
public override CmsError NC_RSerialNumber(ref string serialNumber)
{
CmsError cmsError = ReadStaticNCData();
@@ -440,7 +384,12 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
// Get CMS Machine number
/// <summary>
/// Get CMS Machine number
/// </summary>
/// <param name="hasLetters"></param>
/// <param name="MachNumber"></param>
/// <returns></returns>
public override CmsError NC_RMachineNumber(bool hasLetters, ref string MachNumber)
{
if (!hasLetters)
@@ -467,14 +416,22 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
// Get the Date-Time of the NC
/// <summary>
/// Get the Date-Time of the NC
/// </summary>
/// <param name="ActualTime"></param>
/// <returns></returns>
public override CmsError NC_RDateTime(ref DateTime ActualTime)
{
ActualTime = DateTime.Now;
return NO_ERROR;
}
// Check if the NC is in running state
/// <summary>
/// Check if the NC is in running state
/// </summary>
/// <param name="running"></param>
/// <returns></returns>
public override CmsError NC_RIsRunning(ref bool running)
{
ushort nProcess = 0;
@@ -502,7 +459,11 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
// Get NC unit of measure
/// <summary>
/// Get NC unit of measure
/// </summary>
/// <param name="unitOfMeasure"></param>
/// <returns></returns>
public override CmsError NC_RUnitOfMeasure(ref string unitOfMeasure)
{
CmsError cmsError = ReadStaticNCData();
@@ -514,13 +475,21 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
// Get the Nc Active Alarms
/// <summary>
/// Get the Nc Active Alarms
/// </summary>
/// <param name="alarms"></param>
/// <returns></returns>
public override CmsError NC_RActiveAlarms(ref List<AlarmModel> alarms)
{
return FUNCTION_NOT_ALLOWED_ERROR;
}
// Set the Nc Active Page of the NC
/// <summary>
/// Set the Nc Active Page of the NC
/// </summary>
/// <param name="screen"></param>
/// <returns></returns>
public override CmsError NC_SetScreenVisible(SCREEN_PAGE screen)
{
return FUNCTION_NOT_ALLOWED_ERROR;
@@ -550,9 +519,14 @@ namespace CMS_CORE_Library.S7Net
plcWatchdog = true;
return MEM_RWBoolean(W, 0, NC_WATCHDOG.MemType, NC_WATCHDOG.Address, NC_WATCHDOG.SubAddress, 0, ref plcWatchdog);
}
/// <summary>
/// Active message list
/// </summary>
/// <param name="alarms"></param>
/// <returns></returns>
public override CmsError PLC_RActiveMessages(ref List<PlcAlarmModel> alarms)
{
// FIXME TODO controllare
bool[] statusBits;
int i = 0;
List<int> readValues = new List<int>();
@@ -561,12 +535,12 @@ namespace CMS_CORE_Library.S7Net
{
alarms.Clear();
// Read on data from memory
// Read on data from memory
cmsError = MEM_RWIntegerList(R, 0,
ALARMS_STATUS.MemType,
ALARMS_STATUS.Address,
ALARMS_STATUS.SubAddress,
(ALARMS_STATUS.Size / 4) + (ALARMS_DATA.Size / 2), // statys_bytes / 4 + data_word / 2
(ALARMS_STATUS.Size / 4) + (ALARMS_DATA.Size / 2), // status_bytes / 4 + data_word / 2
ref readValues);
if (cmsError.IsError())
@@ -574,19 +548,6 @@ namespace CMS_CORE_Library.S7Net
alarms.Clear();
//List<int> readValues = new List<int>();
//// Read on data from memory
//CmsError cmsError = MEM_RWIntegerList(R, 0,
// ALARMS_STATUS.MemType,
// ALARMS_STATUS.Address,
// ALARMS_STATUS.SubAddress,
// (ALARMS_STATUS.Size + ALARMS_DATA.Size) / 4, // byte / 4
// ref readValues);
//if (cmsError.IsError())
// return cmsError;
// Convert integer array into bit array
statusBits = IntToBits(readValues.ToArray());
@@ -1153,156 +1114,6 @@ namespace CMS_CORE_Library.S7Net
public override CmsError PLC_RScadaSiemens(ref List<ScadaObjectModel> objects)
{
return FUNCTION_NOT_ALLOWED_ERROR;
#if false
try
{
List<Item> items = new List<Item>();
string bit,
address;
char charType = 'B';
// Cycle through object
for (int i = 0; i < objects.Count(); i++)
{
// Split memory string -> X.Y.Z
string[] splittedMem = objects[i].Address.Split('.');
bit = "0";
address = "0";
bool read = true;
switch (objects[i].MemType)
{
case SCADA_MEM_TYPE.BOOL:
{
// Check if memory contains default value
if (splittedMem[0].ToUpper() == "FALSE")
{
objects[i].Value = false;
read = false;
break;
}
else if (splittedMem[0].ToUpper() == "TRUE")
{
objects[i].Value = true;
read = false;
break;
}
bit = splittedMem[2];
address = splittedMem[1];
charType = 'X'; // Siemens memory type character
}
break;
case SCADA_MEM_TYPE.BYTE:
{
address = splittedMem[1];
charType = 'B';
}
break;
case SCADA_MEM_TYPE.INT:
{
address = splittedMem[1];
charType = 'D';
}
break;
case SCADA_MEM_TYPE.WORD:
{
address = splittedMem[1];
charType = 'W';
}
break;
case SCADA_MEM_TYPE.REAL:
{
address = splittedMem[1];
charType = 'D';
}
break;
}
// If needs to read
if (read)
{
// Convert splitted address into Siemens address
ConvertMemToPath(MEMORY_TYPE.Siemens_DB,
Convert.ToInt32(splittedMem[0]),
Convert.ToInt32(address),
Convert.ToInt32(bit),
1,
charType,
out string item);
// Add to the list of items to be readed
items.Add(new Item()
{
Path = item
});
}
}
if (items.Count() > 0)
{
// Read data
DataSvc dataSvc = new DataSvc();
dataSvc.Read(items.ToArray());
int alreadyReaded = 0;
for (int i = 0; i < objects.Count(); i++)
{
// Skip the objects already valorised
if (objects[i].Value == null)
{
switch (objects[i].MemType)
{
case SCADA_MEM_TYPE.BOOL:
{
// Valorize data
objects[i].Value = Convert.ToBoolean(items[i - alreadyReaded].Value);
}
break;
case SCADA_MEM_TYPE.BYTE:
{
objects[i].Value = Convert.ToByte(items[i - alreadyReaded].Value);
}
break;
case SCADA_MEM_TYPE.INT:
{
objects[i].Value = Convert.ToInt32(items[i - alreadyReaded].Value);
}
break;
case SCADA_MEM_TYPE.WORD:
{
objects[i].Value = Convert.ToInt16(items[i - alreadyReaded].Value);
}
break;
case SCADA_MEM_TYPE.REAL:
{
// Convert value to double
var byteVal = BitConverter.GetBytes((uint)items[i - alreadyReaded].Value);
var value = unchecked(Convert.ToDouble(BitConverter.ToSingle(byteVal, 0)));
objects[i].Value = Math.Round(value, objects[i].Round);
}
break;
}
}
else
{
// Count items already readed
alreadyReaded++;
}
}
}
}
catch (Exception ex)
{
return ManageException(ex);
}
return NO_ERROR;
#endif
}
public override CmsError PLC_WScadaValue(string memIndex, SCADA_MEM_TYPE memType, object value)
@@ -2018,31 +1829,31 @@ namespace CMS_CORE_Library.S7Net
return NO_ERROR;
}
/// <summary>
/// read current recipe parameter list
/// </summary>
/// <param name="onlyRT">updates only RT parameters (false = update all)</param>
/// <param name="currParamList"></param>
/// <returns></returns>
public override CmsError PLC_RRecipeParamList(bool onlyRT, ref Dictionary<int, RecipeParam> currParamList)
{
// refresh dati veloci / RT
refreshMemRecipeParameterRT();
// se richiesto NON SOLO RT faccio refresh anche dati "lenti"
if (!onlyRT)
{
refreshMemRecipeParameter();
}
// copio lista act in output...
currParamList = ThermoParamList;
return NO_ERROR;
}
public override CmsError PLC_RRecipeLastParamList(ref Dictionary<int, RecipeParam> currParamList)
{
// copio lista act in output...
refreshMemRecipeParameter();
// refresh dati veloci / RT
refreshMemRecipeParameterRT();
// copio lista act in output...
currParamList = ThermoParamList;
return NO_ERROR;
}
/// <summary>
/// Write recipe updated parameter
/// </summary>
/// <param name="updtParam"></param>
/// <returns></returns>
public override CmsError PLC_WRecipeParam(RecipeParam updtParam)
{
// init variabili accessorie