Merge branch 'release/OpcUaEmco_09'

This commit is contained in:
Samuele Locatelli
2025-04-08 10:21:12 +02:00
14 changed files with 375 additions and 404 deletions
+10
View File
@@ -21,6 +21,11 @@ namespace IOB_UT_NEXT.Config.Base
/// </summary>
public bool EnableSetPzReq { get; set; } = false;
/// <summary>
/// Valore massimo incremento contapezzi (in %)
/// </summary>
public int MaxIncrPzCountPerc { get; set; } = 200;
/// <summary>
/// Abilita reset contapezzi a INIZIO setup
/// </summary>
@@ -51,5 +56,10 @@ namespace IOB_UT_NEXT.Config.Base
/// </summary>
public int SendPzcBlockMax { get; set; } = 100;
/// <summary>
/// Modalità set PzCount (contapezzi parziale) tra DIRECT / TASK
/// </summary>
public string SendPzCountMode { get; set; } = "";
}
}
+5
View File
@@ -93,6 +93,11 @@ namespace IOB_UT_NEXT.Config.Base
/// </summary>
public string NumOdlMode { get; set; } = "";
/// <summary>
/// Timeout in sec x dichiarare Poweroff (tipicamente IOB PING)
/// </summary>
public int PoweroffTimeOutSec { get; set; } = 100;
/// <summary>
/// Modalità gestione lettura cadenza
/// </summary>
+44 -4
View File
@@ -123,7 +123,7 @@ namespace IOB_UT_NEXT.Config
MaxErroriCheck = fIni.ReadInteger("OPTPAR", "MAX_ERR_CHECK", maxErrCheck),
MaxPingRetry = fIni.ReadInteger("OPTPAR", "MAX_PING_RETRY", 5),
MinDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 6),
MultiIobList= fIni.ReadString("OPTPAR", "IOB_MULTI_CNAME", ""),
MultiIobList = fIni.ReadString("OPTPAR", "IOB_MULTI_CNAME", ""),
RelVers = $"{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}",
ResetAlarmOnStart = bool.Parse(fIni.ReadString("OPTPAR", "SEND_ALARM_RESET", "false")),
SenMachineConf = bool.Parse(fIni.ReadString("OPTPAR", "SEND_MACHINE_CONF", "true")),
@@ -258,6 +258,7 @@ namespace IOB_UT_NEXT.Config
MinRespTimeMs = fIni.ReadInteger("OPTPAR", "MIN_RESP_TIME_MS", 5),
NumArtMode = fIni.ReadString("OPTPAR", "SET_NUM_ART", ""),
NumOdlMode = fIni.ReadString("OPTPAR", "SET_NUM_COM", ""),
PoweroffTimeOutSec= fIni.ReadInteger("OPTPAR", "POWEROFF_TIMEOUT_SEC", 120),
PzCadMode = fIni.ReadString("OPTPAR", "PZCAD_MODE", ""),
PzCountDelay = utils.CRI("pzCountDelay"),
PzCountMode = fIni.ReadString("OPTPAR", "PZCOUNT_MODE", ""),
@@ -283,6 +284,7 @@ namespace IOB_UT_NEXT.Config
exclOptPar.Add("MAX_TRY_PING");
exclOptPar.Add("MIN_RESP_TIME_MS");
exclOptPar.Add("NO_PING");
exclOptPar.Add("POWEROFF_TIMEOUT_SEC");
exclOptPar.Add("PZCAD_MODE");
exclOptPar.Add("PZCOUNT_MODE");
exclOptPar.Add("PZREQ_MODE");
@@ -341,11 +343,13 @@ namespace IOB_UT_NEXT.Config
newConfObj.Counters.EnabSendPzcBlock = bool.Parse(fIni.ReadString("OPTPAR", "ENABLE_SEND_PZC_BLOCK", "false"));
newConfObj.Counters.EnableSetPzCount = bool.Parse(fIni.ReadString("OPTPAR", "ENABLE_PZ_CNT", "false"));
newConfObj.Counters.EnableSetPzReq = bool.Parse(fIni.ReadString("OPTPAR", "ENABLE_PZ_REQ", "false"));
newConfObj.Counters.MaxIncrPzCountPerc = fIni.ReadInteger("OPTPAR", "MAX_PZ_INCR_PERC", 300);
newConfObj.Counters.ResetOnProdEnd = bool.Parse(fIni.ReadString("OPTPAR", "ENABLE_PZ_RESET_ENDPROD", "false"));
newConfObj.Counters.ResetOnSetupStart = bool.Parse(fIni.ReadString("OPTPAR", "ENABLE_PZ_RESET", "false"));
newConfObj.Counters.ResetOnSetupStop = bool.Parse(fIni.ReadString("OPTPAR", "ENABLE_PZ_RESET_stopSetup", "false"));
newConfObj.Counters.SendPzcBlockMin = int.Parse(fIni.ReadString("OPTPAR", "MIN_SEND_PZC_BLOCK", "0"));
newConfObj.Counters.SendPzcBlockMax = int.Parse(fIni.ReadString("OPTPAR", "MAX_SEND_PZC_BLOCK", "100"));
newConfObj.Counters.SendPzcBlockMin = fIni.ReadInteger("OPTPAR", "MIN_SEND_PZC_BLOCK", 0);
newConfObj.Counters.SendPzcBlockMax = fIni.ReadInteger("OPTPAR", "MAX_SEND_PZC_BLOCK", 100);
newConfObj.Counters.SendPzCountMode = fIni.ReadString("OPTPAR", "SEND_PZCNT_MODE", "DIRECT");
exclOptPar.Add("ENABLE_SEND_PZC_BLOCK");
exclOptPar.Add("ENABLE_PZ_CNT");
@@ -353,8 +357,40 @@ namespace IOB_UT_NEXT.Config
exclOptPar.Add("ENABLE_PZ_RESET_ENDPROD");
exclOptPar.Add("ENABLE_PZ_RESET");
exclOptPar.Add("ENABLE_PZ_RESET_stopSetup");
exclOptPar.Add("MIN_SEND_PZC_BLOCK");
exclOptPar.Add("MAX_PZ_INCR_PERC");
exclOptPar.Add("MAX_SEND_PZC_BLOCK");
exclOptPar.Add("MIN_SEND_PZC_BLOCK");
exclOptPar.Add("SEND_PZCNT_MODE");
// FTP
string ftpServer = fIni.ReadString("OPTPAR", "FTP_SERVER", "");
if (!string.IsNullOrEmpty(ftpServer))
{
if(newConfObj.Special.FtpConf==null)
{
newConfObj.Special.FtpConf = new FtpDto()
{
Server=ftpServer,
User = fIni.ReadString("OPTPAR", "FTP_USER", ""),
Passwd = fIni.ReadString("OPTPAR", "FTP_PWD", ""),
CertValue = fIni.ReadString("OPTPAR", "FTP_CERT", ""),
CsvAddHeader = bool.Parse(fIni.ReadString("OPTPAR", "CSV_ADD_HEADER", "false")),
SkipCert = bool.Parse(fIni.ReadString("OPTPAR", "FTP_SKIP", "true")),
DirLocal = fIni.ReadString("OPTPAR", "FTP_LOC_DIR", ""),
DirRemote = fIni.ReadString("OPTPAR", "FTP_REM_DIR", ""),
};
// continuo col resto
}
}
exclOptPar.Add("FTP_SERVER");
exclOptPar.Add("FTP_USER");
exclOptPar.Add("FTP_PWD");
exclOptPar.Add("FTP_CERT");
exclOptPar.Add("CSV_ADD_HEADER");
exclOptPar.Add("FTP_SKIP");
exclOptPar.Add("FTP_LOC_DIR");
exclOptPar.Add("FTP_REM_DIR");
// allarmi...
string jsonAlarms = fIni.ReadString("OPTPAR", "ALARM_CONF", "");
@@ -912,7 +948,11 @@ namespace IOB_UT_NEXT.Config
}
else
{
#if DEBUG
lgError($"OptParGet | key not found: {key}");
#else
lgDebug($"OptParGet | key not found: {key}");
#endif
}
return answ;
}
+54
View File
@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT.Config.Special
{
public class FtpDto
{
#region Public Properties
/// <summary>
/// indirizzo server FTP (IP/URI)
/// </summary>
public string Server { get; set; } = "";
/// <summary>
/// Utente x connessione FTP
/// </summary>
public string User { get; set; } = "";
/// <summary>
/// Password x connessione FTP
/// </summary>
public string Passwd { get; set; } = "";
/// <summary>
/// Indica se aggiungere header ai CSV trasmessi via FTP
/// </summary>
public bool CsvAddHeader { get; set; } = true;
/// <summary>
/// Certificato (firma) per connessione FTP
/// </summary>
public string CertValue { get; set; } = "";
/// <summary>
/// Indica se saltare la validazione del certificato FTP
/// </summary>
public bool SkipCert { get; set; } = true;
/// <summary>
/// Directory di lavoro Remota
/// </summary>
public string DirRemote { get; set; } = "";
/// <summary>
/// Directory di lavoro Locale
/// </summary>
public string DirLocal { get; set; } = "";
#endregion Public Properties
}
}
+9 -4
View File
@@ -14,9 +14,9 @@ namespace IOB_UT_NEXT.Config.Special
{
/// <summary>
/// Configurazione specifica per gestione file esterni (es Saim x Giacovelli)
/// Configurazione specifica FANUC/Mitsubishi (ove applicabile)
/// </summary>
public FileDto FileConf { get; set; }
public MemBankDto BankConf { get; set; }
#if false
/// <summary>
@@ -26,9 +26,14 @@ namespace IOB_UT_NEXT.Config.Special
#endif
/// <summary>
/// Configurazione specifica FANUC/Mitsubishi (ove applicabile)
/// Configurazione specifica per gestione file esterni (es Saim x Giacovelli)
/// </summary>
public MemBankDto BankConf { get; set; }
public FileDto FileConf { get; set; }
/// <summary>
/// Configurazione specifica FTP
/// </summary>
public FtpDto FtpConf { get; set; }
/// <summary>
/// Parametri speciali per Modbus
+1
View File
@@ -173,6 +173,7 @@
<Compile Include="Config\IobConfTree.cs" />
<Compile Include="Config\Mem\MemAreaDto.cs" />
<Compile Include="Config\Special\ActionDto.cs" />
<Compile Include="Config\Special\FtpDto.cs" />
<Compile Include="Config\Special\MemBankDto.cs" />
<Compile Include="Config\Special\SpecializedDto.cs" />
<Compile Include="Config\Special\SiemensDto.cs" />
+17 -172
View File
@@ -309,13 +309,6 @@ namespace IOB_WIN_FORM.Iob
/// </summary>
protected DateTime prgStarted = DateTime.Now;
#if false
/// <summary>
/// Modalità cambio ODL
/// </summary>
protected string CHANGE_ODL_MODE = "";
#endif
/// <summary>
/// Ritardo minimo x invio contapezzi
/// </summary>
@@ -1749,56 +1742,48 @@ namespace IOB_WIN_FORM.Iob
protected virtual bool iobSendFTP(string folderDir)
{
bool answ = false;
//leggo CONF
string ftpServ = getOptPar("FTP_SERVER");
string ftpUser = getOptPar("FTP_USER");
string ftpPass = getOptPar("FTP_PWD");
string ftpCert = getOptPar("FTP_CERT");
string doSkip = getOptPar("FTP_SKIP");
string remDir = getOptPar("FTP_REM_DIR");
string locDir = getOptPar("FTP_LOC_DIR");
// recupero CONF
var ftpConf = IOBConfFull.Special.FtpConf;
// procedo SE TROVO conf...
if (string.IsNullOrEmpty($"{ftpServ}{ftpUser}{ftpPass}"))
if (string.IsNullOrEmpty($"{ftpConf.Server}{ftpConf.User}{ftpConf.Passwd}"))
{
lgError($"Impossibile eseguire iobSendFTP x mancanza parametri | ftpServ: {ftpServ} | ftpUser: {ftpUser} | ftpPass: {ftpPass}");
lgError($"Impossibile eseguire iobSendFTP x mancanza parametri | ftpServ: {ftpConf.Server} | ftpUser: {ftpConf.User} | ftpPass: {ftpConf.Passwd}");
}
else
{
bool ftpSkip = false;
bool.TryParse(doSkip, out ftpSkip);
var ftpClient = new Manager(ftpServ, ftpUser, ftpPass, ftpCert, ftpSkip);
var ftpClient = new Manager(ftpConf.Server, ftpConf.User, ftpConf.Passwd, ftpConf.CertValue, ftpConf.SkipCert);
var testServer = ftpClient.ServerOk();
if (testServer)
{
lgInfo($"FTP: server found at {ftpServ}");
lgInfo($"FTP: server found at {ftpConf.Server}");
var srvType = ftpClient.ServerType();
lgInfo($"FTP Server type: {srvType}");
var preTest = ftpClient.DirExists(remDir);
var preTest = ftpClient.DirExists(ftpConf.DirRemote);
if (!preTest)
{
var dirCreate = ftpClient.CreateDir(remDir);
lgInfo($"FTP: created remote dir {remDir}");
var dirCreate = ftpClient.CreateDir(ftpConf.DirRemote);
lgInfo($"FTP: created remote dir {ftpConf.DirRemote}");
}
// test directory...
string basePath = Application.StartupPath;
string localPath = Path.Combine(basePath, locDir);
string localPath = Path.Combine(basePath, ftpConf.DirLocal);
lgInfo($"basePath: {basePath} | localPath: {localPath}");
var fileList = Directory.GetFiles(localPath, "*.csv");
int numfile = 0;
foreach (var file in fileList)
{
string fName = file.Split('\\').Last();
string remName = $"{remDir}\\{fName}";
string remName = $"{ftpConf.DirRemote}\\{fName}";
ftpClient.SendFile(file, remName);
numfile++;
}
var dirUploaded = (numfile == fileList.Count());
if (dirUploaded)
{
lgInfo($"FTP: uploaded dir content {locDir} --> {remDir}");
lgInfo($"FTP: uploaded dir content {ftpConf.DirLocal} --> {ftpConf.DirRemote}");
}
// se ok --> sposto invio
DateTime adesso = DateTime.Now;
@@ -1826,17 +1811,14 @@ namespace IOB_WIN_FORM.Iob
protected virtual bool iobWriteLocalCSV()
{
bool answ = false;
// conf ftp
var ftpConf = IOBConfFull.Special.FtpConf;
// salvo articoli
string locDir = getOptPar("FTP_LOC_DIR");
string sAddHeader = getOptPar("CSV_ADD_HEADER");
bool addHeader = false;
if (!string.IsNullOrEmpty(sAddHeader))
{
bool.TryParse(sAddHeader, out addHeader);
}
string locDir = ftpConf.DirLocal;
bool addHeader = ftpConf.CsvAddHeader;
string basePath = Application.StartupPath;
string tempDir = Path.Combine(basePath, locDir);
lgInfo($"iobWriteLocalCSV | locDir: {locDir} | sAddHeader: {sAddHeader} | tempDir: {tempDir}");
lgInfo($"iobWriteLocalCSV | locDir: {locDir} | addHeader: {addHeader} | tempDir: {tempDir}");
baseUtils.checkDir(tempDir);
string filePath = Path.Combine(tempDir, "articoli.csv");
answ = DataExport.SaveToCsv(ListaArticoli, filePath, addHeader);
@@ -2005,44 +1987,16 @@ namespace IOB_WIN_FORM.Iob
maxSendPzCountBlock = IOBConfFull.Counters.SendPzcBlockMax;
lgInfo("loadMemConf.02");
minRespTimeMs = IOBConfFull.Device.MinRespTimeMs;
#if false
currPar = getOptPar("MIN_RESP_TIME_MS");
if (!string.IsNullOrEmpty(currPar))
{
int.TryParse(currPar, out minRespTimeMs);
}
#endif
// gruppo macchina
CodGruppoIob = IOBConfFull.General.CodGruppoIob;
#if false
CodGruppoIob = getOptPar("CodGruppoIob");
CodGruppoIob = string.IsNullOrEmpty(CodGruppoIob) ? "ND-00" : CodGruppoIob;
#endif
// gestione completa PODL
EnabelPodlManFull = IOBConfFull.General.EnabelPodlManFull;
#if false
string sEnabelPodlManFull = getOptPar("EnabelPodlManFull");
if (!string.IsNullOrEmpty(sEnabelPodlManFull))
{
bool.TryParse(sEnabelPodlManFull, out EnabelPodlManFull);
}
#endif
// abilitazione invio WDST disabilitazione controllo range valori DynData
disableWdst = IOBConfFull.General.DisabWDST;
// disabilitazione controllo range valori DynData
disDynDataRangeCheck = IOBConfFull.FluxLog.DisDynDataRangeCheck;
#if false
if (!string.IsNullOrEmpty(getOptPar("disDynDataRangeCheck")))
{
bool checkDis = false;
bool.TryParse(getOptPar("disDynDataRangeCheck"), out checkDis);
disDynDataRangeCheck = checkDis;
}
#endif
lgInfo("loadMemConf.03");
// se ho info in IOBConfFull uso quello...
@@ -2069,13 +2023,6 @@ namespace IOB_WIN_FORM.Iob
try
{
memMap = JsonConvert.DeserializeObject<plcMemMapExt>(jsonData);
#if false
setupMemMap();
setupOptMemPar();
setupFileDecod();
setupSpecialParams();
lgInfo("loadMemConf.05");
#endif
}
catch (Exception exc)
{
@@ -2119,53 +2066,6 @@ namespace IOB_WIN_FORM.Iob
}
lgInfo("loadMemConf | Fine setup allarmi");
}
#if false
string jsonAlarms = getOptPar("ALARM_CONF");
if (!string.IsNullOrEmpty(jsonAlarms))
{
string jsonFileName = $"{Application.StartupPath}\\DATA\\CONF\\{jsonAlarms}";
lgInfoStartup($"Apertura file {jsonFileName}");
StreamReader reader = new StreamReader(jsonFileName);
string jsonData = reader.ReadToEnd();
reader.Dispose();
if (!string.IsNullOrEmpty(jsonData))
{
lgInfoStartup($"File json ALLARMI composto da {jsonData.Length} caratteri");
try
{
lgInfo("loadMemConf | Inizio setup allarmi");
alarmMaps = JsonConvert.DeserializeObject<List<BaseAlarmConf>>(jsonData);
setupAlarmMap();
// leggo il tipo gestione allarmi..
string sAlarmType = getOptJsonKVP("alarmType");
if (!string.IsNullOrEmpty(sAlarmType))
{
alarmType = (AlarmBlockType)Enum.Parse(typeof(AlarmBlockType), sAlarmType);
}
string sAlarmLMin = getOptJsonKVP("alarmLevelMin");
if (!string.IsNullOrEmpty(sAlarmLMin))
{
alarmLevelMin = (AlarmLevel)Enum.Parse(typeof(AlarmLevel), sAlarmLMin);
}
lgInfo("loadMemConf | Fine setup allarmi");
}
catch (Exception exc)
{
lgError($"Eccezione in decodifica conf json degli ALLARMI{Environment.NewLine}{exc}");
}
}
else
{
lgError("Errore in loadMemConf: file ALLARMI json vuoto!");
}
}
else
{
lgInfoStartup("loadMemConf: non trovata opzione ALARM_CONF in file INI");
}
#endif
vetoReloadConf = DateTime.Now.AddMinutes(15);
// loggo
lgInfo($"loadMemConf.07, veto reload until {vetoReloadConf}");
@@ -4386,17 +4286,6 @@ namespace IOB_WIN_FORM.Iob
private void fixDemFactDynData()
{
demFactDynData = IOBConfFull.FluxLog.DemFactDynData;
#if false
var rawDemFact = getOptPar("DEM_FACT_DYN_DATA");
if (string.IsNullOrEmpty(rawDemFact))
{
demFactDynData = 1;
}
else
{
int.TryParse(rawDemFact, out demFactDynData);
}
#endif
}
/// <summary>
@@ -4854,56 +4743,12 @@ namespace IOB_WIN_FORM.Iob
vetoQueueIn = IOBConfFull.Device.StartupVetoQueueIN;
// fix slow data
enableSlowData = IOBConfFull.FluxLog.EnableSlowData;
#if false
string VETO_QUEUE_IN = getOptPar("VETO_QUEUE_IN");
if (!string.IsNullOrEmpty(VETO_QUEUE_IN))
{
int.TryParse(VETO_QUEUE_IN, out vetoQueueIn);
}
string ENABLE_SLOW_DATA = getOptPar("ENABLE_SLOW_DATA");
if (!string.IsNullOrEmpty(ENABLE_SLOW_DATA))
{
bool.TryParse(getOptPar("ENABLE_SLOW_DATA"), out enableSlowData);
}
#endif
#if false
// modalità change ODL
CHANGE_ODL_MODE = "TIME";
if (!string.IsNullOrEmpty(getOptPar("CHANGE_ODL_MODE")))
{
CHANGE_ODL_MODE = getOptPar("CHANGE_ODL_MODE");
}
#endif
ENABLE_MEM_REWRITE = IOBConfFull.Device.EnabMemRewrite;
GLOBAL_DBAND = IOBConfFull.FluxLog.GlobalDeadBand;
enabSendMachineConf = IOBConfFull.General.SenMachineConf;
resetAlarmOnStart = IOBConfFull.General.ResetAlarmOnStart;
disableOdl = IOBConfFull.Odl.DisableOdl;
#if false
if (!string.IsNullOrEmpty(getOptPar("ENABLE_MEM_REWRITE")))
{
bool.TryParse(getOptPar("ENABLE_MEM_REWRITE"), out ENABLE_MEM_REWRITE);
}
if (!string.IsNullOrEmpty(getOptPar("GLOBAL_DBAND")))
{
float.TryParse(getOptPar("GLOBAL_DBAND"), out GLOBAL_DBAND);
}
if (!string.IsNullOrEmpty(getOptPar("SEND_MACHINE_CONF")))
{
bool.TryParse(getOptPar("SEND_MACHINE_CONF"), out enabSendMachineConf);
}
if (!string.IsNullOrEmpty(getOptPar("SEND_ALARM_RESET")))
{
bool.TryParse(getOptPar("SEND_ALARM_RESET"), out resetAlarmOnStart);
}
if (!string.IsNullOrEmpty(getOptPar("DISABLE_ODL")))
{
bool.TryParse(getOptPar("DISABLE_ODL"), out disableOdl);
}
#endif
}
private void svuotaCodaContapezzi()
+4 -179
View File
@@ -385,20 +385,7 @@ namespace IOB_WIN_FORM.Iob
/// </summary>
public int maxPzDeltaPerc
{
get
{
int answ = 250;
// vera verifica su chiave...
string MAX_PZ_INCR_PERC = getOptPar("MAX_PZ_INCR_PERC");
if (!string.IsNullOrEmpty(MAX_PZ_INCR_PERC))
{
if (!int.TryParse(MAX_PZ_INCR_PERC, out answ))
{
answ = 300;
}
}
return answ;
}
get => IOBConfFull.Counters.MaxIncrPzCountPerc;
}
/// <summary>
@@ -419,21 +406,6 @@ namespace IOB_WIN_FORM.Iob
}
}
#if false
/// <summary>
/// Indica se ping disabilitato da optPar
/// </summary>
public bool pingDisabled
{
get
{
bool answ = false;
bool.TryParse(getOptPar("NO_PING"), out answ);
return answ;
}
}
#endif
/// <summary>
/// Valore medio del TC rilevato x verifica derive sul delta variazione contapezzi
/// </summary>
@@ -655,11 +627,7 @@ namespace IOB_WIN_FORM.Iob
// mostro dati variati letti...
displayInData(ref currDispData);
// verifico veto a invio status macchina
#if false
string keyName = "VETO_SIG_IN";
if (getOptPar(keyName).ToUpper() == "TRUE")
#endif
if(IOBConfFull.Device.DisabSigIn)
if (IOBConfFull.Device.DisabSigIn)
{
lgTrace($"Filtrato accodamento valore da conf IOB | DisabSigIn | [QUEUE-IN] {qEncodeIN}");
}
@@ -1054,7 +1022,6 @@ namespace IOB_WIN_FORM.Iob
{
string fullUrl = "";
string rawSplit = "";
string IOB_MULTI_CNAME = "";
string[] elencoMulti = null;
try
@@ -1085,8 +1052,7 @@ namespace IOB_WIN_FORM.Iob
if (isMulti)
{
// devo chiamare cambio ODL x OGNI tavola: mi servono i parametri opzionali...
IOB_MULTI_CNAME = getOptPar("IOB_MULTI_CNAME");
elencoMulti = IOB_MULTI_CNAME.Split(',');
elencoMulti = IOBConfFull.General.MultiIobList.Split(',');
}
// se normale splitto!
if (!isMulti)
@@ -1903,11 +1869,6 @@ namespace IOB_WIN_FORM.Iob
if (isMulti)
{
// devo chiamare cambio ODL x OGNI tavola: mi servono i parametri opzionali...
#if false
string IOB_MULTI_CNAME = "";
IOB_MULTI_CNAME = getOptPar("IOB_MULTI_CNAME");
elencoMulti = IOB_MULTI_CNAME.Split(',');
#endif
elencoMulti = IOBConfFull.General.MultiIobList.Split(',');
}
@@ -1935,20 +1896,17 @@ namespace IOB_WIN_FORM.Iob
public void processAutoOdl()
{
bool fatto = false;
//if (!string.IsNullOrEmpty(getOptPar("AUTO_CHANGE_ODL")))
if (IOBConfFull.Odl.AutoChangeOdl)
{
lgTrace("processAutoOdl | AutoChangeOdl abilitato");
// imposto il veto lettura contapezzi a 1 minuto x iniziare...
dtVetoReadPzCount = DateTime.Now.AddMinutes(delayMinReadPzCount);
string IOB_MULTI_CNAME = "";
string[] elencoMulti = null;
string fullUrl = "";
if (isMulti)
{
// devo chiamare cambio ODL x OGNI tavola: mi servono i parametri opzionali...
IOB_MULTI_CNAME = getOptPar("IOB_MULTI_CNAME");
elencoMulti = IOB_MULTI_CNAME.Split(',');
elencoMulti = IOBConfFull.General.MultiIobList.Split(',');
}
DateTime adesso = DateTime.Now;
DateTime inizioOdl = adesso;
@@ -2090,129 +2048,6 @@ namespace IOB_WIN_FORM.Iob
break;
}
#if false
if (IOBConfFull.Odl.ChangeOdlMode == "PZCOUNT_RESET")
{
/* verifico se sia "armato" il reset cambio ODL, DEVO essere :
* - NON in produzione
* - contapezzi ACT < contapezzi LAST
* */
lgTrace("processAutoOdl: caso PZCOUNT_RESET");
if ((!isRunning || forceResetInRun) && pzCountResetted)
{
callChangeODL = true;
lgInfo("Attivato cambio ODL da PZCOUNT_RESET");
}
else
{
lgInfo($"isRunning: {isRunning} | pzCountResetted: {pzCountResetted} | forceResetInRun: {forceResetInRun} | contapezziIOB: {contapezziIOB} | contapezziPLC: {contapezziPLC}");
}
}
else if (IOBConfFull.Odl.ChangeOdlMode == "DAILY")
{
// verifico inizio ODL, se è data di oggi NON eseguo...
if (currOdlStart().Date < adesso.Date)
{
// imposto x prox controllo veto a 10 min
VetoProcessAutoOdl = adesso.AddMinutes(10);
// chiamo stored x creare ODL giornalieri alla data...
string autoOdlRes = utils.callUrl(urlFixDailyOdl);
fatto = autoOdlRes == "OK";
}
}
else if (IOBConfFull.Odl.ChangeOdlMode == "DAILY_CONF_PZ")
{
// verifico inizio ODL, se è data di oggi NON eseguo...
if (currOdlStart().Date < adesso.Date)
{
// imposto x prox controllo veto a 10 min
VetoProcessAutoOdl = adesso.AddMinutes(10);
// chiamo stored x creare ODL giornalieri alla data + conferma pezzi...
string autoOdlRes = utils.callUrl(urlFixDailyOdlConfPzCount);
fatto = autoOdlRes == "OK";
}
}
else if (IOBConfFull.Odl.ChangeOdlMode == "TIME" || IOBConfFull.Odl.ChangeOdlMode == "SIMUL")
{
// imposto x prox controllo veto a 1 min
VetoProcessAutoOdl = adesso.AddMinutes(1);
// carico i parametri di configurazione x reset ODL...
string CHANGE_ODL_HOURS = getOptPar("CHANGE_ODL_HOURS");
string CHANGE_ODL_IDLE_MIN = getOptPar("CHANGE_ODL_IDLE_MIN");
if (!string.IsNullOrEmpty(CHANGE_ODL_HOURS) && !string.IsNullOrEmpty(CHANGE_ODL_IDLE_MIN))
{
int minOdlDurHours = -1;
int minPlcIdelMin = -1;
int.TryParse(CHANGE_ODL_HOURS, out minOdlDurHours);
int.TryParse(CHANGE_ODL_IDLE_MIN, out minPlcIdelMin);
// controllo parametri validi
if (minOdlDurHours > 0 && minPlcIdelMin >= 0)
{
// leggo da server inizio ODL... se non multi 1 solo...
inizioOdl = DateTime.Now;
rawDataInizio = "";
if (!isMulti)
{
rawDataInizio = callUrl(urlInizioOdlIob, false);
DateTime.TryParse(rawDataInizio, out inizioOdl);
}
else
{
DateTime tmpData = DateTime.Now;
// prendo il + vecchio...
foreach (var item in elencoMulti)
{
fullUrl = $"{urlInizioOdlIob}|{item}";
rawDataInizio = callUrl(fullUrl, false);
DateTime.TryParse(rawDataInizio, out tmpData);
inizioOdl = (tmpData < inizioOdl) ? tmpData : inizioOdl;
}
}
// verifico se sia scaduto...
if (inizioOdl.AddHours(minOdlDurHours) < adesso)
{
string rawIdle = "";
int idlePeriod = 0;
if (!isMulti)
{
// controllo SE sono fermo (spento o in manuale) per il
// periodo minimo richiesto...
rawIdle = callUrl(urlIdleTime, false);
int.TryParse(rawIdle, out idlePeriod);
}
else
{
int tmpIdle = 0;
// prendo il + grande...
foreach (var item in elencoMulti)
{
fullUrl = $"{urlIdleTime}|{item}";
rawIdle = callUrl(fullUrl, false);
int.TryParse(rawIdle, out tmpIdle);
idlePeriod = tmpIdle > idlePeriod ? tmpIdle : idlePeriod;
}
}
if (idlePeriod >= minPlcIdelMin)
{
callChangeODL = true;
}
}
}
// se NON fosse scaduto MA è simulato esegue controllo sul num pezzi da
// fare, se sfora (RANDOM) > +(50...110)% --> cambia!
if (!callChangeODL && IOBConfFull.Odl.ChangeOdlMode == "SIMUL")
{
var rawCount = callUrl(urlGetNumPzCurrODL, false);
if (int.TryParse(rawCount, out var numPzReqOdl))
{
int limitQty = (numPzReqOdl * rndGen.Next(150, 210)) / 100;
callChangeODL = contapezziPLC > limitQty;
}
}
}
}
#endif
// vero processing...
if (callChangeODL)
{
@@ -2341,13 +2176,6 @@ namespace IOB_WIN_FORM.Iob
{
// FixMe Todo: generalizzare parametri nell'obj?
bool enableByApp = utils.CRB("enableDynData");
#if false
bool enableByIob = (getOptPar("ENABLE_DYN_DATA") == "TRUE");
bool sendDynDataRec = (getOptPar("SEND_DYN_DATA_FLOG") == "TRUE");
bool disableDynData = (getOptPar("DISABLE_DYN_DATA") == "TRUE");
bool forceSendByIob = (getOptPar("FORCE_DYN_DATA") == "TRUE");
bool copyDynToProd = (getOptPar("COPY_DYN2PROD_DATA") == "TRUE");
#endif
Dictionary<string, string> currDynData = new Dictionary<string, string>();
if (enableByApp || IOBConfFull.FluxLog.EnableDynData)
@@ -2519,9 +2347,6 @@ namespace IOB_WIN_FORM.Iob
public virtual void processOverride()
{
bool enableByApp = utils.CRB("enableOverrides");
#if false
bool enableByIob = (getOptPar("ENABLE_OVERRIDES") == "TRUE");
#endif
Dictionary<string, string> currOverride = new Dictionary<string, string>();
if (enableByApp || IOBConfFull.FluxLog.EnableOverrides)
{
+1 -5
View File
@@ -30,11 +30,7 @@ namespace IOB_WIN_FORM.Iob
// 2023.09.05 imposto anche primo ping e check disconnected...
lastPING = adesso;
lastDisconnCheck = adesso;
var POWEROFF_TIMEOUT_SEC = getOptPar("POWEROFF_TIMEOUT_SEC");
if (!string.IsNullOrEmpty(POWEROFF_TIMEOUT_SEC))
{
int.TryParse(POWEROFF_TIMEOUT_SEC, out PoweroffTimeoutSec);
}
PoweroffTimeoutSec = IOBConfFull.Device.PoweroffTimeOutSec;
// fix coda ping
PingQueue = new DataQueue("000", "PingQueue", false);
lgDebug($"L'adapter effettuera' PING di controllo all'indirizzo {IOBConfFull.Device.Connect.IpAddr} per forzare stato poweroff dopo {PoweroffTimeoutSec} sec");
+2 -3
View File
@@ -637,9 +637,8 @@ namespace IOB_WIN_FORM.Iob
{
case urlType.ULog:
string[] elencoMulti = null;
// devo chiamare cambio ODL x OGNI tavola: mi servono i parametri opzionali...
string IOB_MULTI_CNAME = getOptPar("IOB_MULTI_CNAME");
elencoMulti = IOB_MULTI_CNAME.Split(',');
// devo chiamare cambio ODL x OGNI tavola: mi servono i parametri opzionali...
elencoMulti = IOBConfFull.General.MultiIobList.Split(',');
// aggiungo tav 1 / 2 a caso secondo secondi attuali, se pari/dispari
int idxTav = DateTime.Now.Second % 2;
answ += $"#{elencoMulti[idxTav]}";
+62 -3
View File
@@ -88,7 +88,6 @@
"filterItemsNodeId": [
"ns=2;s=/Axis",
"ns=2;s=/Bag",
"ns=2;s=/Channel/State/actFeedRateIpo",
"ns=2;s=/Channel/State/actProgNetTime",
"ns=2;s=/Channel/AuxiliaryFunctions",
"ns=2;s=/Channel/GenericCoupling",
@@ -188,7 +187,58 @@
"ns=2;s=/Plc/DB75",
"ns=2;s=/Plc/DB76",
"ns=2;s=/Plc/DB77",
"ns=2;s=/Plc/DB78"
"ns=2;s=/Plc/DB78",
"ns=2;s=/Plc/DB92",
"ns=2;s=/Plc/DB93",
"ns=2;s=/Plc/DB100",
"ns=2;s=/Plc/DB101",
"ns=2;s=/Plc/DB102",
"ns=2;s=/Plc/DB103",
"ns=2;s=/Plc/DB104",
"ns=2;s=/Plc/DB105",
"ns=2;s=/Plc/DB111",
"ns=2;s=/Plc/DB114",
"ns=2;s=/Plc/DB115",
"ns=2;s=/Plc/DB116",
"ns=2;s=/Plc/DB120",
"ns=2;s=/Plc/DB121",
"ns=2;s=/Plc/DB140",
"ns=2;s=/Plc/DB154",
"ns=2;s=/Plc/DB170",
"ns=2;s=/Plc/DB171",
"ns=2;s=/Plc/DB172",
"ns=2;s=/Plc/DB173",
"ns=2;s=/Plc/DB174",
"ns=2;s=/Plc/DB200",
"ns=2;s=/Plc/DB201",
"ns=2;s=/Plc/DB202",
"ns=2;s=/Plc/DB203",
"ns=2;s=/Plc/DB204",
"ns=2;s=/Plc/DB213",
"ns=2;s=/Plc/DB272",
"ns=2;s=/Plc/DB283",
"ns=2;s=/Plc/DB284",
"ns=2;s=/Plc/DB310",
"ns=2;s=/Plc/DB325",
"ns=2;s=/Plc/DB326",
"ns=2;s=/Plc/DB332",
"ns=2;s=/Plc/DB333",
"ns=2;s=/Plc/DB334",
"ns=2;s=/Plc/DB335",
"ns=2;s=/Plc/DB336",
"ns=2;s=/Plc/DB505",
"ns=2;s=/Plc/DB506",
"ns=2;s=/Plc/DB507",
"ns=2;s=/Plc/DB508",
"ns=2;s=/Plc/DB509",
"ns=2;s=/Plc/DB510",
"ns=2;s=/Plc/DB650",
"ns=2;s=/Plc/DB651",
"ns=2;s=/Plc/DB1000",
"ns=2;s=/Plc/DB1001",
"ns=2;s=/Plc/DB1002",
"ns=2;s=/Plc/DB1071",
"ns=2;s=/Plc/DB1072"
],
"subscribedItems": [
"ns=2;s=/Channel/State/actParts",
@@ -199,7 +249,8 @@
"ns=2;s=/Channel/State/actTNumber",
"ns=2;s=/Channel/ProgramInfo/selectedWorkPProg",
"ns=2;s=/Channel/ProgramInfo/progName",
"ns=2;s=/Channel/State/actFeedRateIpoOvr",
"ns=2;s=/Channel/State/actFeedRateIpo",
"ns=2;s=/Channel/State/acTotalOvr",
"ns=2;s=/Channel/State/feedRateIpoOvr",
"ns=2;s=/Nck/State/aStopesi",
"ns=2;s=/NC/_N_CH_GD2_ACX/CODICE_ARTICOLO",
@@ -232,6 +283,14 @@
"index": 0,
"size": 4
},
"forceResetPzCount": {
"name": "forceResetPzCount",
"description": "Set Contapezzi",
"tipoMem": "Int",
"memAddr": "ns=2;s=/NC/_N_CH_GD2_ACX/QUANTITA_PRODOTTA",
"index": 0,
"size": 4
},
"forceSetPzCount": {
"name": "forceSetPzCount",
"description": "Set Contapezzi",
+147 -7
View File
@@ -39,15 +39,11 @@
]
},
"condEStop": {
"checkMode": "OR",
"checkMode": "AND",
"checkList": [
{
"keyName": "aStopesi",
"targetValue": "0"
},
{
"keyName": "aStopesi",
"targetValue": ""
}
]
},
@@ -92,9 +88,40 @@
"filterItemsNodeId": [
"ns=2;s=/Axis",
"ns=2;s=/Bag",
"ns=2;s=/Channel/State/actProgNetTime",
"ns=2;s=/Channel/AuxiliaryFunctions",
"ns=2;s=/Channel/GenericCoupling",
"ns=2;s=/Channel/Diagnose",
"ns=2;s=/Channel/ChannelDiagnose",
"ns=2;s=/Channel/ProtocolEvent",
"ns=2;s=/Channel/ActualFrame",
"ns=2;s=/Channel/BaseFrame",
"ns=2;s=/Channel/ExternFrame",
"ns=2;s=/Channel/GrindingFrame",
"ns=2;s=/Channel/SystemFrame",
"ns=2;s=/Channel/UserFrame",
"ns=2;s=/Channel/Drive",
"ns=2;s=/Channel/Nibbling",
"ns=2;s=/Channel/Parameter",
"ns=2;s=/Channel/ProtectedArea",
"ns=2;s=/Channel/Settings",
"ns=2;s=/Channel/GeometricAxis",
"ns=2;s=/Channel/MachineAxis",
"ns=2;s=/Channel/ProgramModification",
"ns=2;s=/Channel/SelectedFunctions",
"ns=2;s=/Channel/Search",
"ns=2;s=/Channel/InterruptionSearch",
"ns=2;s=/Channel/ProgramPointer",
"ns=2;s=/Channel/LogicalSpindle",
"ns=2;s=/Channel/Compensation",
"ns=2;s=/Channel/SelectedFunctionData",
"ns=2;s=/Channel/CoordSysWorkAreaLimits",
"ns=2;s=/Channel/Configuration",
"ns=2;s=/Channel/Spindle",
"ns=2;s=/DriveVsa",
"ns=2;s=Sinumerik/FileSystem",
"ns=2;s=/Methods",
"ns=2;s=/NC",
"ns=2;s=/NC/_N_NC_GD1_ACX",
"ns=2;s=/NC/_N_NC_GD4_ACX",
"ns=2;s=/NC/_N_CH_GD1_ACX",
@@ -104,10 +131,114 @@
"ns=2;s=/SEA",
"ns=2;s=/TEA",
"ns=2;s=/Tool",
"ns=2;s=/Plc/Clock",
"ns=2;s=/Plc/C",
"ns=2;s=/Plc/T",
"ns=2;s=/Plc/I",
"ns=2;s=/Plc/IB",
"ns=2;s=/Plc/IW",
"ns=2;s=/Plc/ID",
"ns=2;s=/Plc/M",
"ns=2;s=/Plc/MB",
"ns=2;s=/Plc/MW",
"ns=2;s=/Plc/MD",
"ns=2;s=/Plc/Q",
"ns=2;s=/Plc/QB",
"ns=2;s=/Plc/QW",
"ns=2;s=/Plc/QD",
"ns=2;s=/Plc/ID",
"ns=2;s=/Plc/ID",
"ns=2;s=IArea",
"ns=2;s=QArea",
"ns=2;s=MArea",
"ns=2;s=/Plc/"
"ns=2;s=/Plc/DB1",
"ns=2;s=/Plc/DB2",
"ns=2;s=/Plc/DB3",
"ns=2;s=/Plc/DB4",
"ns=2;s=/Plc/DB5",
"ns=2;s=/Plc/DB6",
"ns=2;s=/Plc/DB7",
"ns=2;s=/Plc/DB8",
"ns=2;s=/Plc/DB9",
"ns=2;s=/Plc/DB10",
"ns=2;s=/Plc/DB11",
"ns=2;s=/Plc/DB15",
"ns=2;s=/Plc/DB16",
"ns=2;s=/Plc/DB17",
"ns=2;s=/Plc/DB18",
"ns=2;s=/Plc/DB19",
"ns=2;s=/Plc/DB20",
"ns=2;s=/Plc/DB21",
"ns=2;s=/Plc/DB31",
"ns=2;s=/Plc/DB32",
"ns=2;s=/Plc/DB33",
"ns=2;s=/Plc/DB34",
"ns=2;s=/Plc/DB35",
"ns=2;s=/Plc/DB36",
"ns=2;s=/Plc/DB53",
"ns=2;s=/Plc/DB62",
"ns=2;s=/Plc/DB63",
"ns=2;s=/Plc/DB64",
"ns=2;s=/Plc/DB65",
"ns=2;s=/Plc/DB66",
"ns=2;s=/Plc/DB71",
"ns=2;s=/Plc/DB72",
"ns=2;s=/Plc/DB74",
"ns=2;s=/Plc/DB75",
"ns=2;s=/Plc/DB76",
"ns=2;s=/Plc/DB77",
"ns=2;s=/Plc/DB78",
"ns=2;s=/Plc/DB92",
"ns=2;s=/Plc/DB93",
"ns=2;s=/Plc/DB100",
"ns=2;s=/Plc/DB101",
"ns=2;s=/Plc/DB102",
"ns=2;s=/Plc/DB103",
"ns=2;s=/Plc/DB104",
"ns=2;s=/Plc/DB105",
"ns=2;s=/Plc/DB111",
"ns=2;s=/Plc/DB114",
"ns=2;s=/Plc/DB115",
"ns=2;s=/Plc/DB116",
"ns=2;s=/Plc/DB120",
"ns=2;s=/Plc/DB121",
"ns=2;s=/Plc/DB140",
"ns=2;s=/Plc/DB154",
"ns=2;s=/Plc/DB170",
"ns=2;s=/Plc/DB171",
"ns=2;s=/Plc/DB172",
"ns=2;s=/Plc/DB173",
"ns=2;s=/Plc/DB174",
"ns=2;s=/Plc/DB200",
"ns=2;s=/Plc/DB201",
"ns=2;s=/Plc/DB202",
"ns=2;s=/Plc/DB203",
"ns=2;s=/Plc/DB204",
"ns=2;s=/Plc/DB213",
"ns=2;s=/Plc/DB272",
"ns=2;s=/Plc/DB283",
"ns=2;s=/Plc/DB284",
"ns=2;s=/Plc/DB310",
"ns=2;s=/Plc/DB325",
"ns=2;s=/Plc/DB326",
"ns=2;s=/Plc/DB332",
"ns=2;s=/Plc/DB333",
"ns=2;s=/Plc/DB334",
"ns=2;s=/Plc/DB335",
"ns=2;s=/Plc/DB336",
"ns=2;s=/Plc/DB505",
"ns=2;s=/Plc/DB506",
"ns=2;s=/Plc/DB507",
"ns=2;s=/Plc/DB508",
"ns=2;s=/Plc/DB509",
"ns=2;s=/Plc/DB510",
"ns=2;s=/Plc/DB650",
"ns=2;s=/Plc/DB651",
"ns=2;s=/Plc/DB1000",
"ns=2;s=/Plc/DB1001",
"ns=2;s=/Plc/DB1002",
"ns=2;s=/Plc/DB1071",
"ns=2;s=/Plc/DB1072"
],
"subscribedItems": [
"ns=2;s=/Channel/State/actParts",
@@ -118,7 +249,8 @@
"ns=2;s=/Channel/State/actTNumber",
"ns=2;s=/Channel/ProgramInfo/selectedWorkPProg",
"ns=2;s=/Channel/ProgramInfo/progName",
"ns=2;s=/Channel/State/actFeedRateIpoOvr",
"ns=2;s=/Channel/State/actFeedRateIpo",
"ns=2;s=/Channel/State/acTotalOvr",
"ns=2;s=/Channel/State/feedRateIpoOvr",
"ns=2;s=/Nck/State/aStopesi",
"ns=2;s=/NC/_N_CH_GD2_ACX/CODICE_ARTICOLO",
@@ -151,6 +283,14 @@
"index": 0,
"size": 4
},
"forceResetPzCount": {
"name": "forceResetPzCount",
"description": "Set Contapezzi",
"tipoMem": "Int",
"memAddr": "ns=2;s=/NC/_N_CH_GD2_ACX/QUANTITA_PRODOTTA",
"index": 0,
"size": 4
},
"forceSetPzCount": {
"name": "forceSetPzCount",
"description": "Set Contapezzi",
+4 -17
View File
@@ -49,23 +49,10 @@ namespace IOB_WIN_OPC_UA.IobOpc
lastWarnODL = adesso;
lastCurrent = adesso;
lgTrace($"Aggiornato IobOpcUa.lastCurrent: {lastCurrent}");
if (IOBConfFull.Special.OpcUaConf == null)
{
// ora leggo il file di conf specifico....
string jsonFileName = getOptPar("OPC_PARAM_CONF");
if (!string.IsNullOrEmpty(jsonFileName))
{
// leggo il file...
loadOpcUaConf(jsonFileName);
}
}
else
{
opcUaParams = IOBConfFull.Special.OpcUaConf;
setupMemMap();
setupOptMemPar();
setupFileDecod();
}
opcUaParams = IOBConfFull.Special.OpcUaConf;
setupMemMap();
setupOptMemPar();
setupFileDecod();
}
#endregion Public Constructors
+15 -10
View File
@@ -70,10 +70,18 @@ namespace IOB_WIN_OPC_UA.IobOpc
break;
case taskType.endProd:
forceDbSync = true;
// reset contapezzi inizio setup
if (IOBConfFull.Counters.ResetOnProdEnd)
{
addResetPzCount = true;
}
lgInfo($"Chiamato {tName} | addResetPzCount: {addResetPzCount}");
break;
case taskType.startSetup:
forceDbSync = true;
// se richiesto reset aggiungo!
if (IOBConfFull.OptPar.Count > 0 && getOptPar("ENABLE_PZ_RESET") == "TRUE")
// reset contapezzi inizio setup
if (IOBConfFull.Counters.ResetOnSetupStart)
{
addResetPzCount = true;
}
@@ -112,8 +120,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
lgInfo("OpcUaSiemens.resetContapezziPLC 01");
bool answ = false;
// ...SE abilitato da conf IOB
//if (IOBConfFull.OptPar.Count > 0 && getOptPar("ENABLE_PZ_RESET") == "TRUE")
if(IOBConfFull.Counters.ResetOnSetupStart || IOBConfFull.Counters.ResetOnSetupStop || IOBConfFull.Counters.EnableSetPzCount || IOBConfFull.Counters.ResetOnProdEnd)
if (IOBConfFull.Counters.ResetOnSetupStart || IOBConfFull.Counters.ResetOnSetupStop || IOBConfFull.Counters.EnableSetPzCount || IOBConfFull.Counters.ResetOnProdEnd)
{
lgInfo("OpcUaSiemens.resetContapezziPLC 02");
// imposto un veto in lettura cmq x evitare problemi
@@ -152,7 +159,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
}
else
{
lgError("Impossibile effettuare RESET contapezzi, mancanza parametro OPT:ENABLE_PZ_RESET");
lgError("Impossibile effettuare RESET contapezzi, mancanza parametri IOBConfFull.Counters.*");
}
return answ;
}
@@ -168,17 +175,15 @@ namespace IOB_WIN_OPC_UA.IobOpc
if (memMap != null && memMap.mMapWrite.ContainsKey("forceSetPzCount"))
{
// modalità invio secondo richiesta
string sendMode = getOptPar("SEND_PZCNT_MODE");
if (sendMode == "TASK")
lgDebug($"OpcUaSiemens.setcontapezziPLC | {IOBConfFull.Counters.SendPzCountMode}");
if (IOBConfFull.Counters.SendPzCountMode == "TASK")
{
lgDebug($"Generic.executeTasks | TASK");
Dictionary<string, string> task2add = new Dictionary<string, string>();
task2add.Add("forceSetPzCount", $"{newPzCount}");
executeTasks(task2add);
}
else
{
lgDebug($"Generic.executeTasks | plcWriteParams");
// provare x Donati EMCO e Siemens Rama Tenditalia
var ListTempParams = new List<objItem>();
// aggiungo reset caricamento
@@ -193,7 +198,7 @@ namespace IOB_WIN_OPC_UA.IobOpc
plcWriteParams(ref ListTempParams);
}
answ = true;
lgInfo($"Eseguito scrittura OPC-UA su nodo setcontapezziPLC | sendMode: {sendMode}");
lgInfo($"Eseguito scrittura OPC-UA su nodo setcontapezziPLC | sendMode: {IOBConfFull.Counters.SendPzCountMode}");
}
else
{