Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a6dff6dc0b | |||
| 6d06c601a8 | |||
| 7c84d739fb | |||
| 49312dd181 | |||
| 7e66ebb79a | |||
| 8ee2f3b9c4 | |||
| 9d320ae451 | |||
| d388c420ed | |||
| d2aa632a89 | |||
| 0199669847 | |||
| f85c47fe24 | |||
| 3620822e83 | |||
| 14740640fb | |||
| 3b5e76d72a | |||
| eb8cb3cfb5 | |||
| 821a2c3fcf | |||
| aded6e2020 | |||
| 5029049835 | |||
| 51227605f2 | |||
| 7cfa69e889 | |||
| f40044ff31 | |||
| e2c905d113 | |||
| a399761674 | |||
| c336f7504d | |||
| c3c9addbef | |||
| b7fb86f94f | |||
| b861daaf12 | |||
| 937fffb2c4 | |||
| 503d2ecfa3 | |||
| a200f1455e | |||
| 9822f43894 | |||
| eae1d51337 | |||
| 9f8944876d | |||
| 4941dc3fdc | |||
| 852bbcb29a | |||
| 0f6f32a5a0 | |||
| 06d25078e6 | |||
| ace3ef79c1 | |||
| e162c2a8af | |||
| 9baae29627 | |||
| 845c32d56f | |||
| 04734ddf46 | |||
| 3f995027b5 | |||
| 46b50fac5b | |||
| 657c90061f | |||
| fffb0c712e | |||
| e8f5044972 | |||
| b5d214b437 | |||
| cde83c36b0 | |||
| 7c83c314ea | |||
| 42c50cad0c | |||
| 77de6722f3 | |||
| 6bfb159f19 | |||
| cbc6de2cca | |||
| 335a877d4d | |||
| 766fc5eade | |||
| 1e7b2cd24e | |||
| f009dbef37 | |||
| 81233d0bc4 | |||
| a70d4af729 | |||
| bbae83a669 | |||
| 121eacfb6a | |||
| 0928ebe6ec | |||
| b4a0333085 | |||
| e0098e4194 | |||
| 5a35a2e926 | |||
| 8efa8fc1d1 | |||
| fd45ab8180 | |||
| dbf5a88a4e | |||
| c691a677d2 | |||
| b55cb314f2 | |||
| bbe04ea0cb | |||
| 3a2749d947 | |||
| 8b34765ad5 | |||
| ebc7afc455 | |||
| 3bd9da0949 | |||
| 11fd84276c |
+1
-1
@@ -8,7 +8,7 @@
|
|||||||
<add key="appNameExt" value="IOB-WIN-NEXT" />
|
<add key="appNameExt" value="IOB-WIN-NEXT" />
|
||||||
<add key="uiPeriod" value="100" />
|
<add key="uiPeriod" value="100" />
|
||||||
<add key="checkPeriod" value="3000" />
|
<add key="checkPeriod" value="3000" />
|
||||||
<add key="forceCheckPeriodMult" value="15" />
|
<add key="forceCheckPeriodMult" value="20" />
|
||||||
<add key="autoRestartTimeoutMin" value="15" />
|
<add key="autoRestartTimeoutMin" value="15" />
|
||||||
<add key="autoStartProc" value="true" />
|
<add key="autoStartProc" value="true" />
|
||||||
<add key="closeOnChildUpdate" value="true" />
|
<add key="closeOnChildUpdate" value="true" />
|
||||||
|
|||||||
+237
-238
@@ -1,20 +1,17 @@
|
|||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using RestSharp;
|
using RestSharp;
|
||||||
using RestSharp.Serializers.NewtonsoftJson;
|
using RestSharp.Serializers.NewtonsoftJson;
|
||||||
using SteamWare.Scheduler;
|
|
||||||
using SteamWare.IO;
|
using SteamWare.IO;
|
||||||
using SteamWare.Logger;
|
using SteamWare.Logger;
|
||||||
|
using SteamWare.Scheduler;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -24,28 +21,53 @@ namespace IOB_MAN
|
|||||||
{
|
{
|
||||||
public partial class IOBManPanel : Form
|
public partial class IOBManPanel : Form
|
||||||
{
|
{
|
||||||
#region Private Fields
|
#region Public Fields
|
||||||
|
|
||||||
private const int SW_SHOWMAXIMIZED = 3;
|
|
||||||
private const int SW_SHOWMINIMIZED = 2;
|
|
||||||
private const int SW_SHOWNORMAL = 1;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Context x sync thread
|
/// Elenco ARGS (uno per child da avviare)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly SynchronizationContext synchronizationContext;
|
public List<string> ArgsList = new List<string>();
|
||||||
|
|
||||||
|
#endregion Public Fields
|
||||||
|
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Oggetto semaforico di lock
|
/// Init classe
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private SemaphoreSlim _sync = new SemaphoreSlim(1);
|
public IOBManPanel()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
synchronizationContext = SynchronizationContext.Current;
|
||||||
|
|
||||||
|
preInit();
|
||||||
|
loadConfig();
|
||||||
|
|
||||||
|
// fix log...
|
||||||
|
cbLogLevelMin.SelectedValue = "Info";
|
||||||
|
setLogLevel("Info");
|
||||||
|
|
||||||
|
initTimers();
|
||||||
|
initControls();
|
||||||
|
updateStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Binding source degli elementi gestiti..
|
/// Cerca nell'elenco il processo corrente
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private BindingSource ElencoIOB = new BindingSource();
|
/// <param name="processlist"></param>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Process myGetProcByID(Process[] processlist, int id)
|
||||||
|
{
|
||||||
|
return processlist.FirstOrDefault(pr => pr.Id == id);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Public Methods
|
||||||
|
|
||||||
#region Protected Fields
|
#region Protected Fields
|
||||||
|
|
||||||
@@ -54,6 +76,11 @@ namespace IOB_MAN
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected static List<iobAdapt> item2rem = new List<iobAdapt>();
|
protected static List<iobAdapt> item2rem = new List<iobAdapt>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// URL di base x l'API di gestione licenze/file upload
|
||||||
|
/// </summary>
|
||||||
|
protected string ApiUrl = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ramo applicazione (x update)
|
/// Ramo applicazione (x update)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -114,26 +141,21 @@ namespace IOB_MAN
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected string TargetExe = "";
|
protected string TargetExe = "";
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// File target x conf NLog
|
|
||||||
/// </summary>
|
|
||||||
protected string TargetNLogConf = "";
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Directory log generale x IOB-WIN (dentro ci sono x singoli IOB)
|
/// Directory log generale x IOB-WIN (dentro ci sono x singoli IOB)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected string TargetLogDir = "";
|
protected string TargetLogDir = "";
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// URL di base x l'API di gestione licenze/file upload
|
|
||||||
/// </summary>
|
|
||||||
protected string ApiUrl = "";
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Name dell'exe da chiamare
|
/// Name dell'exe da chiamare
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected string TargetName = "";
|
protected string TargetName = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// File target x conf NLog
|
||||||
|
/// </summary>
|
||||||
|
protected string TargetNLogConf = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dataora prossima scadenza riavvio automatico
|
/// Dataora prossima scadenza riavvio automatico
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -151,39 +173,6 @@ namespace IOB_MAN
|
|||||||
|
|
||||||
#endregion Protected Fields
|
#endregion Protected Fields
|
||||||
|
|
||||||
#region Public Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Elenco ARGS (uno per child da avviare)
|
|
||||||
/// </summary>
|
|
||||||
public List<string> ArgsList = new List<string>();
|
|
||||||
|
|
||||||
#endregion Public Fields
|
|
||||||
|
|
||||||
#region Public Constructors
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Init classe
|
|
||||||
/// </summary>
|
|
||||||
public IOBManPanel()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
synchronizationContext = SynchronizationContext.Current;
|
|
||||||
|
|
||||||
preInit();
|
|
||||||
loadConfig();
|
|
||||||
|
|
||||||
// fix log...
|
|
||||||
cbLogLevelMin.SelectedValue = "Info";
|
|
||||||
setLogLevel("Info");
|
|
||||||
|
|
||||||
initTimers();
|
|
||||||
initControls();
|
|
||||||
updateStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Constructors
|
|
||||||
|
|
||||||
#region Protected Properties
|
#region Protected Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -199,6 +188,29 @@ namespace IOB_MAN
|
|||||||
|
|
||||||
#endregion Protected Properties
|
#endregion Protected Properties
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private const int SW_SHOWMAXIMIZED = 3;
|
||||||
|
private const int SW_SHOWMINIMIZED = 2;
|
||||||
|
private const int SW_SHOWNORMAL = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Context x sync thread
|
||||||
|
/// </summary>
|
||||||
|
private readonly SynchronizationContext synchronizationContext;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto semaforico di lock
|
||||||
|
/// </summary>
|
||||||
|
private SemaphoreSlim _sync = new SemaphoreSlim(1);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Binding source degli elementi gestiti..
|
||||||
|
/// </summary>
|
||||||
|
private BindingSource ElencoIOB = new BindingSource();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
@@ -375,12 +387,155 @@ namespace IOB_MAN
|
|||||||
updateStatus();
|
updateStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void btnSendLog_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// salvo valori button normali
|
||||||
|
var stdColor = btnSendLog.BackColor;
|
||||||
|
var stdText = btnSendLog.Text;
|
||||||
|
// mostro che sto inviando dati...
|
||||||
|
btnSendLog.Enabled = false;
|
||||||
|
btnSendLog.BackColor = Color.OrangeRed;
|
||||||
|
btnSendLog.Text = "fix directory";
|
||||||
|
btnSendLog.Refresh();
|
||||||
|
// svuoto area temp...
|
||||||
|
string fileName = "LogFiles.zip";
|
||||||
|
string tempDir = Path.Combine(Application.StartupPath, "temp", "logs");
|
||||||
|
string zipPath = Path.Combine(Application.StartupPath, "temp", fileName);
|
||||||
|
if (Directory.Exists(tempDir))
|
||||||
|
{
|
||||||
|
Directory.Delete(tempDir, true);
|
||||||
|
}
|
||||||
|
// ricreo directory...
|
||||||
|
Directory.CreateDirectory(tempDir);
|
||||||
|
|
||||||
|
// definisco limite temporale alle 21 di 2 gg prima...
|
||||||
|
DateTime minDate = DateTime.Today.AddHours(-27);
|
||||||
|
|
||||||
|
// SOLO SE selezionato in dgv...
|
||||||
|
string logDir = TargetLogDir;
|
||||||
|
if (dgvManagedItems.SelectedRows.Count > 0)
|
||||||
|
{
|
||||||
|
btnSendLog.Text = "zip start";
|
||||||
|
btnSendLog.Refresh();
|
||||||
|
// ciclo su row selezionate
|
||||||
|
foreach (DataGridViewRow riga in dgvManagedItems.SelectedRows)
|
||||||
|
{
|
||||||
|
// verifico che sia già chiuso...
|
||||||
|
var iobData = (iobAdapt)ElencoIOB[riga.Index];
|
||||||
|
// calcolo folder
|
||||||
|
logDir = Path.Combine(TargetLogDir, iobData.CodIOB);
|
||||||
|
|
||||||
|
// recupero file odierno
|
||||||
|
DirectoryInfo dI = new DirectoryInfo(logDir);
|
||||||
|
var files = dI.GetFiles().Where(i => i.CreationTime >= minDate);
|
||||||
|
|
||||||
|
// copio in area temp...
|
||||||
|
foreach (var file in files)
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(Path.Combine(tempDir, iobData.CodIOB));
|
||||||
|
file.CopyTo(Path.Combine(tempDir, iobData.CodIOB, file.Name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// creo unico ZIP
|
||||||
|
if (File.Exists(zipPath))
|
||||||
|
{
|
||||||
|
File.Delete(zipPath);
|
||||||
|
}
|
||||||
|
ZipFile.CreateFromDirectory(tempDir, zipPath);
|
||||||
|
btnSendLog.Text = "zip end";
|
||||||
|
btnSendLog.Refresh();
|
||||||
|
|
||||||
|
// ciclo di creazione ticket e upload file
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// client chiamate rest
|
||||||
|
var client = new RestClient(ApiUrl);
|
||||||
|
client.UseNewtonsoftJson();
|
||||||
|
|
||||||
|
SupportRequest newSuppReq = new SupportRequest();
|
||||||
|
string licensePath = Path.Combine(Application.StartupPath, "CONF", "license.json");
|
||||||
|
string rawData = "";
|
||||||
|
if (File.Exists(licensePath))
|
||||||
|
{
|
||||||
|
rawData = File.ReadAllText(licensePath);
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(rawData))
|
||||||
|
{
|
||||||
|
// fare: composizione richiesta da parametri chiave
|
||||||
|
newSuppReq = JsonConvert.DeserializeObject<SupportRequest>(rawData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string hostName = utils.machineName;
|
||||||
|
string listIP = string.Join(", ", utils.machineIp);
|
||||||
|
// genero il ticket
|
||||||
|
newSuppReq = new SupportRequest()
|
||||||
|
{
|
||||||
|
CodApp = "MAPO-IOB-WIN-NEXT",
|
||||||
|
CodImp = "",
|
||||||
|
CodInst = "SteamWare",
|
||||||
|
ContactEmail = "info@steamware.net",
|
||||||
|
ContactName = "Default Config",
|
||||||
|
ContactPhone = "035-460560",
|
||||||
|
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
|
||||||
|
ReqBody = $"File Upload - MISSING license file | machine: {utils.machineName} | IP: {listIP}",
|
||||||
|
Tipo = TipologiaTicket.FileUpload,
|
||||||
|
idxSubLic = 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
btnSendLog.Text = "LogSend start";
|
||||||
|
btnSendLog.BackColor = Color.DarkOrange;
|
||||||
|
btnSendLog.Refresh();
|
||||||
|
var ticketReq = new RestRequest("/api/ticket/sendReq", DataFormat.Json).AddJsonBody(newSuppReq);
|
||||||
|
var ticketResp = await client.PostAsync<TicketDTO>(ticketReq);
|
||||||
|
|
||||||
|
// preparo richiesta x upload file
|
||||||
|
var fileUploadReq = new RestRequest("/api/filesave/single");
|
||||||
|
fileUploadReq.AddParameter("ticketId", ticketResp.idxTicket);
|
||||||
|
fileUploadReq.AddFile("file", zipPath);
|
||||||
|
|
||||||
|
// ... infine INVIA file zip che li contiene...
|
||||||
|
//var fileUploadResp = client.Post(fileUploadReq);
|
||||||
|
var fileUploadResp = await client.PostAsync<UploadResult>(fileUploadReq);
|
||||||
|
btnSendLog.Text = "LogSend end";
|
||||||
|
btnSendLog.BackColor = Color.DarkOliveGreen;
|
||||||
|
btnSendLog.Refresh();
|
||||||
|
|
||||||
|
// elimino folder temporanea
|
||||||
|
if (Directory.Exists(tempDir))
|
||||||
|
{
|
||||||
|
Directory.Delete(tempDir, true);
|
||||||
|
}
|
||||||
|
// elimino il file temporaneo...
|
||||||
|
if (File.Exists(zipPath))
|
||||||
|
{
|
||||||
|
File.Delete(zipPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
Logging.LogError($"Eccezione in fase gestione REST services{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
btnSendLog.BackColor = stdColor;
|
||||||
|
btnSendLog.Text = stdText;
|
||||||
|
btnSendLog.Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
private void btnStartSel_Click(object sender, EventArgs e)
|
private void btnStartSel_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// riapro child (SOLO SE non era già aperto...)
|
// riapro child (SOLO SE non era già aperto...)
|
||||||
apriChildSel();
|
apriChildSel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void cbLogLevelMin_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// aggiornato livelo di log --> chiamo procedura x riscrivere il file conf di NLog
|
||||||
|
setLogLevel($"{cbLogLevelMin.SelectedItem}");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// verifica buttons attivi data selezione su gridview...
|
/// verifica buttons attivi data selezione su gridview...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -476,7 +631,8 @@ namespace IOB_MAN
|
|||||||
IList<iobAdapt> allItems = (IList<iobAdapt>)ElencoIOB.List;
|
IList<iobAdapt> allItems = (IList<iobAdapt>)ElencoIOB.List;
|
||||||
bool needRem = false;
|
bool needRem = false;
|
||||||
|
|
||||||
// 2020.02.01 passato chiamata specifica x leggere in 1 sola volta TUTTO elenco processi (x nome)...
|
// 2020.02.01 passato chiamata specifica x leggere in 1 sola volta TUTTO elenco processi
|
||||||
|
// (x nome)...
|
||||||
Process[] processList = Process.GetProcessesByName(TargetName);
|
Process[] processList = Process.GetProcessesByName(TargetName);
|
||||||
|
|
||||||
// ciclo
|
// ciclo
|
||||||
@@ -729,6 +885,12 @@ namespace IOB_MAN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void dgvManagedItems_SelectionChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
checkButtons();
|
||||||
|
}
|
||||||
|
|
||||||
private void ElencoIOB_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
|
private void ElencoIOB_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1093,6 +1255,21 @@ namespace IOB_MAN
|
|||||||
updateStatus();
|
updateStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setLogLevel(string selectedValue)
|
||||||
|
{
|
||||||
|
// leggo il file loglevel in resources
|
||||||
|
string rawData = File.ReadAllText($@"{Application.StartupPath}\Resources\NLog.template.config");
|
||||||
|
|
||||||
|
// sostituzione livello minimo da selezione
|
||||||
|
rawData = rawData.Replace("{{minLevel}}", selectedValue);
|
||||||
|
|
||||||
|
// scrivo conf x programma IOB-MAN
|
||||||
|
File.WriteAllText($@"{Application.StartupPath}\NLog.config", rawData);
|
||||||
|
|
||||||
|
// scrivo conf x IOB-WIN gestiti
|
||||||
|
File.WriteAllText(TargetNLogConf, rawData);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Avvio di un child process da parametro ARG
|
/// Avvio di un child process da parametro ARG
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1239,183 +1416,5 @@ namespace IOB_MAN
|
|||||||
|
|
||||||
#endregion Private Methods
|
#endregion Private Methods
|
||||||
|
|
||||||
#region Public Methods
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Cerca nell'elenco il processo corrente
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="processlist"></param>
|
|
||||||
/// <param name="id"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static Process myGetProcByID(Process[] processlist, int id)
|
|
||||||
{
|
|
||||||
return processlist.FirstOrDefault(pr => pr.Id == id);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Methods
|
|
||||||
|
|
||||||
private void cbLogLevelMin_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// aggiornato livelo di log --> chiamo procedura x riscrivere il file conf di NLog
|
|
||||||
setLogLevel($"{cbLogLevelMin.SelectedItem}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setLogLevel(string selectedValue)
|
|
||||||
{
|
|
||||||
// leggo il file loglevel in resources
|
|
||||||
string rawData = File.ReadAllText($@"{Application.StartupPath}\Resources\NLog.template.config");
|
|
||||||
|
|
||||||
// sostituzione livello minimo da selezione
|
|
||||||
rawData = rawData.Replace("{{minLevel}}", selectedValue);
|
|
||||||
|
|
||||||
// scrivo conf x programma IOB-MAN
|
|
||||||
File.WriteAllText($@"{Application.StartupPath}\NLog.config", rawData);
|
|
||||||
|
|
||||||
// scrivo conf x IOB-WIN gestiti
|
|
||||||
File.WriteAllText(TargetNLogConf, rawData);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dgvManagedItems_SelectionChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
checkButtons();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void btnSendLog_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// salvo valori button normali
|
|
||||||
var stdColor = btnSendLog.BackColor;
|
|
||||||
var stdText = btnSendLog.Text;
|
|
||||||
// mostro che sto inviando dati...
|
|
||||||
btnSendLog.Enabled = false;
|
|
||||||
btnSendLog.BackColor = Color.OrangeRed;
|
|
||||||
btnSendLog.Text = "fix directory";
|
|
||||||
btnSendLog.Refresh();
|
|
||||||
// svuoto area temp...
|
|
||||||
string fileName = "LogFiles.zip";
|
|
||||||
string tempDir = Path.Combine(Application.StartupPath, "temp", "logs");
|
|
||||||
string zipPath = Path.Combine(Application.StartupPath, "temp", fileName);
|
|
||||||
if (Directory.Exists(tempDir))
|
|
||||||
{
|
|
||||||
Directory.Delete(tempDir, true);
|
|
||||||
}
|
|
||||||
// ricreo directory...
|
|
||||||
Directory.CreateDirectory(tempDir);
|
|
||||||
|
|
||||||
// definisco limite temporale alle 21 di 2 gg prima...
|
|
||||||
DateTime minDate = DateTime.Today.AddHours(-27);
|
|
||||||
|
|
||||||
// SOLO SE selezionato in dgv...
|
|
||||||
string logDir = TargetLogDir;
|
|
||||||
if (dgvManagedItems.SelectedRows.Count > 0)
|
|
||||||
{
|
|
||||||
btnSendLog.Text = "zip start";
|
|
||||||
btnSendLog.Refresh();
|
|
||||||
// ciclo su row selezionate
|
|
||||||
foreach (DataGridViewRow riga in dgvManagedItems.SelectedRows)
|
|
||||||
{
|
|
||||||
// verifico che sia già chiuso...
|
|
||||||
var iobData = (iobAdapt)ElencoIOB[riga.Index];
|
|
||||||
// calcolo folder
|
|
||||||
logDir = Path.Combine(TargetLogDir, iobData.CodIOB);
|
|
||||||
|
|
||||||
// recupero file odierno
|
|
||||||
DirectoryInfo dI = new DirectoryInfo(logDir);
|
|
||||||
var files = dI.GetFiles().Where(i => i.CreationTime >= minDate);
|
|
||||||
|
|
||||||
// copio in area temp...
|
|
||||||
foreach (var file in files)
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(Path.Combine(tempDir, iobData.CodIOB));
|
|
||||||
file.CopyTo(Path.Combine(tempDir, iobData.CodIOB, file.Name));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// creo unico ZIP
|
|
||||||
if (File.Exists(zipPath))
|
|
||||||
{
|
|
||||||
File.Delete(zipPath);
|
|
||||||
}
|
|
||||||
ZipFile.CreateFromDirectory(tempDir, zipPath);
|
|
||||||
btnSendLog.Text = "zip end";
|
|
||||||
btnSendLog.Refresh();
|
|
||||||
|
|
||||||
// ciclo di creazione ticket e upload file
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// client chiamate rest
|
|
||||||
var client = new RestClient(ApiUrl);
|
|
||||||
client.UseNewtonsoftJson();
|
|
||||||
|
|
||||||
SupportRequest newSuppReq = new SupportRequest();
|
|
||||||
string licensePath = Path.Combine(Application.StartupPath, "CONF", "license.json");
|
|
||||||
string rawData = "";
|
|
||||||
if (File.Exists(licensePath))
|
|
||||||
{
|
|
||||||
rawData = File.ReadAllText(licensePath);
|
|
||||||
}
|
|
||||||
if (!string.IsNullOrEmpty(rawData))
|
|
||||||
{
|
|
||||||
// fare: composizione richiesta da parametri chiave
|
|
||||||
newSuppReq = JsonConvert.DeserializeObject<SupportRequest>(rawData);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string hostName = utils.machineName;
|
|
||||||
string listIP = string.Join(", ", utils.machineIp);
|
|
||||||
// genero il ticket
|
|
||||||
newSuppReq = new SupportRequest()
|
|
||||||
{
|
|
||||||
CodApp = "MAPO-IOB-WIN-NEXT",
|
|
||||||
CodImp = "",
|
|
||||||
CodInst = "SteamWare",
|
|
||||||
ContactEmail = "info@steamware.net",
|
|
||||||
ContactName = "Default Config",
|
|
||||||
ContactPhone = "035-460560",
|
|
||||||
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
|
|
||||||
ReqBody = $"File Upload - MISSING license file | machine: {utils.machineName} | IP: {listIP}",
|
|
||||||
Tipo = TipologiaTicket.FileUpload,
|
|
||||||
idxSubLic = 0
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
btnSendLog.Text = "LogSend start";
|
|
||||||
btnSendLog.BackColor = Color.DarkOrange;
|
|
||||||
btnSendLog.Refresh();
|
|
||||||
var ticketReq = new RestRequest("/api/ticket/sendReq", DataFormat.Json).AddJsonBody(newSuppReq);
|
|
||||||
var ticketResp = await client.PostAsync<TicketDTO>(ticketReq);
|
|
||||||
|
|
||||||
// preparo richiesta x upload file
|
|
||||||
var fileUploadReq = new RestRequest("/api/filesave/single");
|
|
||||||
fileUploadReq.AddParameter("ticketId", ticketResp.idxTicket);
|
|
||||||
fileUploadReq.AddFile("file", zipPath);
|
|
||||||
|
|
||||||
// ... infine INVIA file zip che li contiene...
|
|
||||||
//var fileUploadResp = client.Post(fileUploadReq);
|
|
||||||
var fileUploadResp = await client.PostAsync<UploadResult>(fileUploadReq);
|
|
||||||
btnSendLog.Text = "LogSend end";
|
|
||||||
btnSendLog.BackColor = Color.DarkOliveGreen;
|
|
||||||
btnSendLog.Refresh();
|
|
||||||
|
|
||||||
// elimino folder temporanea
|
|
||||||
if (Directory.Exists(tempDir))
|
|
||||||
{
|
|
||||||
Directory.Delete(tempDir, true);
|
|
||||||
}
|
|
||||||
// elimino il file temporaneo...
|
|
||||||
if (File.Exists(zipPath))
|
|
||||||
{
|
|
||||||
File.Delete(zipPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
Logging.LogError($"Eccezione in fase gestione REST services{Environment.NewLine}{exc}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
btnSendLog.BackColor = stdColor;
|
|
||||||
btnSendLog.Text = stdText;
|
|
||||||
btnSendLog.Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+19
-7
@@ -174,8 +174,9 @@ namespace IOB_UT_NEXT
|
|||||||
public enum MachineSetupMode
|
public enum MachineSetupMode
|
||||||
{
|
{
|
||||||
ND = 0,
|
ND = 0,
|
||||||
|
/// <summary>
|
||||||
// Modalità Mecolpress (3 parametri IN, se variati --> porto a 1 la variabile di controllo)
|
/// Modalità Mecolpress (3 parametri IN, se variati --> porto a 1 la variabile di controllo)
|
||||||
|
/// </summary>
|
||||||
MECOLPRESS = 1
|
MECOLPRESS = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,11 +343,6 @@ namespace IOB_UT_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
OpcUaCMS,
|
OpcUaCMS,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adapter OPC-UA SCM
|
|
||||||
/// </summary>
|
|
||||||
OpcUaSCM,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adapter OPC-UA per Ewon
|
/// Adapter OPC-UA per Ewon
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -377,6 +373,21 @@ namespace IOB_UT_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
OpcUaOmronIcoel,
|
OpcUaOmronIcoel,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adapter OPC-UA SCM
|
||||||
|
/// </summary>
|
||||||
|
OpcUaSCM,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adapter OPC-UA Siemens generico
|
||||||
|
/// </summary>
|
||||||
|
OpcUaSiemens,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adapter OPC-UA Siemens OMP
|
||||||
|
/// </summary>
|
||||||
|
OpcUaSiemensOMP,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adapter OSAI CNDEX (Cndex)
|
/// Adapter OSAI CNDEX (Cndex)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -503,4 +514,5 @@ namespace IOB_UT_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
ULog
|
ULog
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -55,12 +55,31 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\Remote_DEBUG\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x86\Remote_DEBUG\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.1.9, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.1.9, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\SharpZipLib.1.3.1\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
<HintPath>..\packages\SharpZipLib.1.3.1\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MapoSDK, Version=6.14.2205.2808, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MapoSDK, Version=6.14.2207.2913, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MapoSDK.6.14.2205.2808\lib\MapoSDK.dll</HintPath>
|
<HintPath>..\packages\MapoSDK.6.14.2207.2913\lib\MapoSDK.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
@@ -125,6 +144,7 @@
|
|||||||
<Compile Include="Eurom63.cs" />
|
<Compile Include="Eurom63.cs" />
|
||||||
<Compile Include="IobWinStatus.cs" />
|
<Compile Include="IobWinStatus.cs" />
|
||||||
<Compile Include="TCMan.cs" />
|
<Compile Include="TCMan.cs" />
|
||||||
|
<Compile Include="TimeUtils.cs" />
|
||||||
<Compile Include="ToMapo.cs" />
|
<Compile Include="ToMapo.cs" />
|
||||||
<Compile Include="baseUtils.cs" />
|
<Compile Include="baseUtils.cs" />
|
||||||
<Compile Include="BinaryFormatter.cs" />
|
<Compile Include="BinaryFormatter.cs" />
|
||||||
|
|||||||
@@ -105,6 +105,11 @@ namespace IOB_UT_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, string> setupParams { get; set; } = new Dictionary<string, string>();
|
public Dictionary<string, string> setupParams { get; set; } = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Valore minimo da considerare come delta secondi x indicare variazione sui dati temporali
|
||||||
|
/// </summary>
|
||||||
|
public int minDeltaSec { get; set; } = 5;
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
|
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
@@ -121,16 +126,22 @@ namespace IOB_UT_NEXT
|
|||||||
|
|
||||||
if (online != item.online)
|
if (online != item.online)
|
||||||
return false;
|
return false;
|
||||||
// controllo se sia ALMENO 1 sec...
|
// controllo se sia ALMENO 10 sec...
|
||||||
if (lastDataIn != item.lastDataIn)
|
if (lastUpdate != item.lastUpdate)
|
||||||
{
|
{
|
||||||
if (lastDataIn.Subtract(item.lastDataIn).TotalSeconds > 1)
|
if (lastUpdate.Subtract(item.lastUpdate).TotalSeconds > minDeltaSec)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// controllo se sia ALMENO 1 sec...
|
// controllo se sia ALMENO 3 sec...
|
||||||
|
if (lastDataIn != item.lastDataIn)
|
||||||
|
{
|
||||||
|
if (lastDataIn.Subtract(item.lastDataIn).TotalSeconds > minDeltaSec)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// controllo se sia ALMENO 5 sec...
|
||||||
if (lastDataOut != item.lastDataOut)
|
if (lastDataOut != item.lastDataOut)
|
||||||
{
|
{
|
||||||
if (lastDataOut.Subtract(item.lastDataOut).TotalSeconds > 1)
|
if (lastDataOut.Subtract(item.lastDataOut).TotalSeconds > minDeltaSec)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (semIn != item.semIn)
|
if (semIn != item.semIn)
|
||||||
|
|||||||
+55
-8
@@ -59,6 +59,56 @@ namespace IOB_UT_NEXT
|
|||||||
#endregion Public Methods
|
#endregion Public Methods
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if false
|
||||||
|
/// <summary>
|
||||||
|
/// Classe di base per trasferimento informazioni di tipo RawTransfer
|
||||||
|
/// </summary>
|
||||||
|
public class BaseRawTransf
|
||||||
|
{
|
||||||
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data-Ora riferimento (x ordinamento fifo)
|
||||||
|
/// </summary>
|
||||||
|
public DateTime dataRif { get; set; } = DateTime.Now;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Messaggio in modalità raw/stringa
|
||||||
|
/// </summary>
|
||||||
|
public object mesContent { get; set; } = new object();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tipo di messaggio trasmesso
|
||||||
|
/// </summary>
|
||||||
|
public rawTransfType mesType { get; set; } = rawTransfType.ND;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Costruttore senza parametri
|
||||||
|
/// </summary>
|
||||||
|
public BaseRawTransf()
|
||||||
|
{
|
||||||
|
this.dataRif = DateTime.Now;
|
||||||
|
this.mesContent = new object();
|
||||||
|
this.mesType = rawTransfType.ND;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Costruttore oggetto
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dataRif"></param>
|
||||||
|
/// <param name="mesContent"></param>
|
||||||
|
/// <param name="mesType"></param>
|
||||||
|
public BaseRawTransf(DateTime dataRif, object mesContent, rawTransfType mesType)
|
||||||
|
{
|
||||||
|
this.dataRif = dataRif;
|
||||||
|
this.mesContent = mesContent;
|
||||||
|
this.mesType = mesType;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Properties
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gestione dati di timing
|
/// Gestione dati di timing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -211,8 +261,6 @@ namespace IOB_UT_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class IobWinStatus
|
public class IobWinStatus
|
||||||
{
|
{
|
||||||
#region Public Properties
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ID univoco
|
/// ID univoco
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -278,10 +326,6 @@ namespace IOB_UT_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int queueUlLen { get; set; } = 0;
|
public int queueUlLen { get; set; } = 0;
|
||||||
|
|
||||||
#endregion Public Properties
|
|
||||||
|
|
||||||
#region Public Methods
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Override metodo di equality
|
/// Override metodo di equality
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -320,8 +364,6 @@ namespace IOB_UT_NEXT
|
|||||||
{
|
{
|
||||||
return base.GetHashCode();
|
return base.GetHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Methods
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -770,6 +812,11 @@ namespace IOB_UT_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int Period { get; set; } = 60;
|
public int Period { get; set; } = 60;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// UM parametro, impiegato anche x conversione (es epoch --> datetime)
|
||||||
|
/// </summary>
|
||||||
|
public string UM { get; set; } = "";
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,9 +23,11 @@ namespace IOB_UT_NEXT
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// init classe gestione dati IOB su Redis
|
/// init classe gestione dati IOB su Redis
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="codServer"></param>
|
/// <param name="codServer">IP/nome server</param>
|
||||||
/// <param name="codIob"></param>
|
/// <param name="codIob">Cod IOB</param>
|
||||||
public RedisIobCache(string codServer, string codIob, string tipoIob)
|
/// <param name="tipoIob">Tipo di IOB</param>
|
||||||
|
/// <param name="minDeltaS">Minima differenza in secondi x considerare variazione dati DataOra</param>
|
||||||
|
public RedisIobCache(string codServer, string codIob, string tipoIob, int minDeltaS)
|
||||||
{
|
{
|
||||||
// init dati di base...
|
// init dati di base...
|
||||||
currCodIob = codIob;
|
currCodIob = codIob;
|
||||||
@@ -42,7 +44,8 @@ namespace IOB_UT_NEXT
|
|||||||
{
|
{
|
||||||
CodIob = currCodIob,
|
CodIob = currCodIob,
|
||||||
IobType = currIobType,
|
IobType = currIobType,
|
||||||
online = false
|
online = false,
|
||||||
|
minDeltaSec = minDeltaS
|
||||||
};
|
};
|
||||||
// salvo in area REDIS
|
// salvo in area REDIS
|
||||||
servStatus = newSrvStatus;
|
servStatus = newSrvStatus;
|
||||||
@@ -169,7 +172,6 @@ namespace IOB_UT_NEXT
|
|||||||
{
|
{
|
||||||
string rawData = JsonConvert.SerializeObject(value);
|
string rawData = JsonConvert.SerializeObject(value);
|
||||||
saveAndSendMessage(redIobKey, redIobChannel, rawData);
|
saveAndSendMessage(redIobKey, redIobChannel, rawData);
|
||||||
//setRSV(redIobKey, rawData);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace IOB_UT_NEXT
|
||||||
|
{
|
||||||
|
public class TimeUtils
|
||||||
|
{
|
||||||
|
public static DateTime epochConvert(double epoch)
|
||||||
|
{
|
||||||
|
DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, 0); //from start epoch time
|
||||||
|
date = date.AddSeconds(epoch);
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -424,6 +424,24 @@ namespace IOB_UT_NEXT
|
|||||||
{
|
{
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Variabili (e valori da impostare) x indicare di resettare contatore lotto e
|
||||||
|
/// quindi riavviare produzione (es: impostando valore a 1...)
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, string> actResetCounter { get; set; } = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Variabili (e valori da impostare) x indicare di effettuare impostazione nuovo
|
||||||
|
/// programma/ricetta (es: impostando valore a 1...)
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, string> actSetRecipe { get; set; } = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Elenco Variabili (e valori da impostare) x indicare di fermare la produzione (es:
|
||||||
|
/// impostando valore a 1...)
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, string> actStopProd { get; set; } = new Dictionary<string, string>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Identificativo nodo iniziale
|
/// Identificativo nodo iniziale
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -41,10 +41,12 @@ namespace IOB_UT_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool MPIO_Online = false;
|
public static bool MPIO_Online = false;
|
||||||
|
|
||||||
|
#if false
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Oggetto connessione REDIS
|
/// Oggetto connessione REDIS
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static RedisIobCache redisMan = new RedisIobCache();
|
public static RedisIobCache redisMan = new RedisIobCache();
|
||||||
|
#endif
|
||||||
|
|
||||||
#endregion Public Fields
|
#endregion Public Fields
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="MapoSDK" version="6.14.2205.2808" targetFramework="net462" />
|
<package id="MapoSDK" version="6.14.2207.2913" targetFramework="net462" />
|
||||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net462" />
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net462" />
|
||||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
|
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
|
||||||
<package id="NLog" version="4.7.13" targetFramework="net462" />
|
<package id="NLog" version="4.7.13" targetFramework="net462" />
|
||||||
|
|||||||
+14
-14
@@ -18,10 +18,10 @@ Global
|
|||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Debug|x86 = Debug|x86
|
Debug|x86 = Debug|x86
|
||||||
FANUC|Any CPU = FANUC|Any CPU
|
|
||||||
FANUC|x86 = FANUC|x86
|
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
Release|x86 = Release|x86
|
Release|x86 = Release|x86
|
||||||
|
Remote_DEBUG|Any CPU = Remote_DEBUG|Any CPU
|
||||||
|
Remote_DEBUG|x86 = Remote_DEBUG|x86
|
||||||
SIEMENS|Any CPU = SIEMENS|Any CPU
|
SIEMENS|Any CPU = SIEMENS|Any CPU
|
||||||
SIEMENS|x86 = SIEMENS|x86
|
SIEMENS|x86 = SIEMENS|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
@@ -30,14 +30,14 @@ Global
|
|||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|x86.ActiveCfg = Debug|Any CPU
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|x86.Build.0 = Debug|Any CPU
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|x86.Build.0 = Debug|Any CPU
|
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.Build.0 = Release|Any CPU
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|x86.ActiveCfg = Release|x86
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|x86.ActiveCfg = Release|x86
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|x86.Build.0 = Release|x86
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|x86.Build.0 = Release|x86
|
||||||
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|x86.ActiveCfg = Remote_DEBUG|x86
|
||||||
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|x86.Build.0 = Remote_DEBUG|x86
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
|
||||||
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|x86.ActiveCfg = Debug|Any CPU
|
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|x86.ActiveCfg = Debug|Any CPU
|
||||||
@@ -46,14 +46,14 @@ Global
|
|||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|x86.ActiveCfg = Debug|x86
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|x86.Build.0 = Debug|x86
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|x86.Build.0 = Debug|x86
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|x86.ActiveCfg = Debug|x86
|
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|x86.Build.0 = Debug|x86
|
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.Build.0 = Release|Any CPU
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|x86.ActiveCfg = Release|x86
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|x86.ActiveCfg = Release|x86
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|x86.Build.0 = Release|x86
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|x86.Build.0 = Release|x86
|
||||||
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|x86.ActiveCfg = Remote_DEBUG|x86
|
||||||
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|x86.Build.0 = Remote_DEBUG|x86
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
|
||||||
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|x86.ActiveCfg = Debug|x86
|
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|x86.ActiveCfg = Debug|x86
|
||||||
@@ -62,14 +62,14 @@ Global
|
|||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|x86.ActiveCfg = Debug|x86
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|x86.Build.0 = Debug|x86
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|x86.Build.0 = Debug|x86
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|x86.ActiveCfg = Debug|x86
|
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|x86.Build.0 = Debug|x86
|
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|x86.ActiveCfg = Release|x86
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|x86.ActiveCfg = Release|x86
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|x86.Build.0 = Release|x86
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|x86.Build.0 = Release|x86
|
||||||
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|Any CPU.ActiveCfg = Remote_DEBUG|Any CPU
|
||||||
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|Any CPU.Build.0 = Remote_DEBUG|Any CPU
|
||||||
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|x86.ActiveCfg = Remote_DEBUG|x86
|
||||||
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|x86.Build.0 = Remote_DEBUG|x86
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
|
||||||
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|x86.ActiveCfg = Debug|x86
|
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|x86.ActiveCfg = Debug|x86
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace IOB_WIN_NEXT
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Oggetto ultimo inviato stato IOB x REDIS
|
/// Oggetto ultimo inviato stato IOB x REDIS
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected IobWinStatus lastIobStatus = new IobWinStatus();
|
protected IobWinStatus lastIobStatus = new IobWinStatus() { lastUpdate = DateTime.Now.AddHours(-1), lastDataOut = DateTime.Now.AddHours(-1) };
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Oggetto ultimo inviato stato MP-IO x REDIS
|
/// Oggetto ultimo inviato stato MP-IO x REDIS
|
||||||
@@ -1129,7 +1129,8 @@ namespace IOB_WIN_NEXT
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
lgError($"Eccezione in conversione tipo adapter: richiesto un tipo non codificato...{Environment.NewLine}{exc}");
|
string rawVal = fIni.ReadString("IOB", "CNCTYPE", "DEMO");
|
||||||
|
lgError($"Eccezione in conversione tipo adapter: richiesto {rawVal} | tipo non codificato...{Environment.NewLine}{exc}");
|
||||||
tipoScelto = tipoAdapter.ND;
|
tipoScelto = tipoAdapter.ND;
|
||||||
}
|
}
|
||||||
// carivo vettore parametri opzionai
|
// carivo vettore parametri opzionai
|
||||||
@@ -1162,13 +1163,14 @@ namespace IOB_WIN_NEXT
|
|||||||
optPar = optParRead,
|
optPar = optParRead,
|
||||||
versIOB = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
|
versIOB = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
|
||||||
codIOB = fIni.ReadString("IOB", "IOB_NAME", CurrIOB),
|
codIOB = fIni.ReadString("IOB", "IOB_NAME", CurrIOB),
|
||||||
|
minDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 6),
|
||||||
cncIpAddr = fIni.ReadString("CNC", "IP", "::1"),
|
cncIpAddr = fIni.ReadString("CNC", "IP", "::1"),
|
||||||
cncPort = fIni.ReadString("CNC", "PORT", "0"),
|
cncPort = fIni.ReadString("CNC", "PORT", "0"),
|
||||||
iniFileName = iniConfFile,
|
iniFileName = iniConfFile,
|
||||||
cpuType = fIni.ReadString("CNC", "CPUTYPE", ""),
|
cpuType = fIni.ReadString("CNC", "CPUTYPE", ""),
|
||||||
rack = (short)fIni.ReadInteger("CNC", "RACK", 0),
|
rack = (short)fIni.ReadInteger("CNC", "RACK", 0),
|
||||||
slot = (short)fIni.ReadInteger("CNC", "SLOT", 0),
|
slot = (short)fIni.ReadInteger("CNC", "SLOT", 0),
|
||||||
serverData = new serverMapo(fIni.ReadString("SERVER", "MPIP", "::1"), fIni.ReadString("SERVER", "MPURL", "/MP/IO"), fIni.ReadString("SERVER", "CMDBASE", "/IOB/input/"), fIni.ReadString("SERVER", "CMDFLOG", "/IOB/flog/"), fIni.ReadString("SERVER", "CMDULOG", "/IOB/ulog/"), fIni.ReadString("SERVER", "CMDALIVE", "/"), fIni.ReadString("SERVER", "CMDENABLED", "/"), fIni.ReadString("SERVER", "CMDREBO", "/"), fIni.ReadString("SERVER", "CMD_ODL_STARTED", "/IOB/getCurrOdlStart/"), fIni.ReadString("SERVER", "CLI_INST", "SW_CLI"), fIni.ReadString("SERVER", "CMD_FORCLE_SPLIT_ODL", "/IOB/forceSplitOdlFull/"), fIni.ReadString("SERVER", "CMDRAWTRANSF", "/IOB/rawTransfJson/")),
|
serverData = new serverMapo(fIni.ReadString("SERVER", "MPIP", "::1"), fIni.ReadString("SERVER", "MPURL", "/MP/IO"), fIni.ReadString("SERVER", "CMDBASE", "/IOB/input/"), fIni.ReadString("SERVER", "CMDFLOG", "/IOB/flog/"), fIni.ReadString("SERVER", "CMDULOG", "/IOB/ulog/"), fIni.ReadString("SERVER", "CMDALIVE", "/"), fIni.ReadString("SERVER", "CMDENABLED", "/"), fIni.ReadString("SERVER", "CMDREBO", "/"), fIni.ReadString("SERVER", "CMD_ODL_STARTED", "/IOB/getCurrOdlStart/"), fIni.ReadString("SERVER", "CLI_INST", "SW_CLI"), fIni.ReadString("SERVER", "CMD_FORCLE_SPLIT_ODL", "/IOB/forceSplitOdlFull/"), fIni.ReadString("SERVER", "CMD_IDLE_TIME", "/IOB/getIdlePeriod/"), fIni.ReadString("SERVER", "CMDRAWTRANSF", "/IOB/rawTransfJson/")),
|
||||||
MAX_COUNTER_BLINK = Convert.ToInt32(fIni.ReadString("BLINK", "MAX_COUNTER_BLINK", "1")),
|
MAX_COUNTER_BLINK = Convert.ToInt32(fIni.ReadString("BLINK", "MAX_COUNTER_BLINK", "1")),
|
||||||
BLINK_FILT = Convert.ToInt32(fIni.ReadString("BLINK", "BLINK_FILT", "0")),
|
BLINK_FILT = Convert.ToInt32(fIni.ReadString("BLINK", "BLINK_FILT", "0")),
|
||||||
TCMaxDelayFactor = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_MAX_TC_FACTOR", "1.2").Replace(".", ",")),
|
TCMaxDelayFactor = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_MAX_TC_FACTOR", "1.2").Replace(".", ",")),
|
||||||
@@ -1325,6 +1327,16 @@ namespace IOB_WIN_NEXT
|
|||||||
start.Enabled = true;
|
start.Enabled = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case tipoAdapter.OpcUaSiemens:
|
||||||
|
iobObj = new IobOpcUaSiemens(this, IOBConf);
|
||||||
|
start.Enabled = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case tipoAdapter.OpcUaSiemensOMP:
|
||||||
|
iobObj = new IobOpcUaSiemensOMP(this, IOBConf);
|
||||||
|
start.Enabled = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case tipoAdapter.PingWatchdog:
|
case tipoAdapter.PingWatchdog:
|
||||||
iobObj = new IobPing(this, IOBConf);
|
iobObj = new IobPing(this, IOBConf);
|
||||||
start.Enabled = true;
|
start.Enabled = true;
|
||||||
@@ -1520,7 +1532,7 @@ namespace IOB_WIN_NEXT
|
|||||||
queueUlLen = ulQueueLen,
|
queueUlLen = ulQueueLen,
|
||||||
counterIOB = iobObj.contapezziIOB,
|
counterIOB = iobObj.contapezziIOB,
|
||||||
counterMAC = iobObj.contapezziPLC,
|
counterMAC = iobObj.contapezziPLC,
|
||||||
lastUpdate = lastIobStatus.lastUpdate,
|
lastUpdate = lastIobStatus.lastUpdate > iobObj.lastWatchDog ? lastIobStatus.lastUpdate : iobObj.lastWatchDog,
|
||||||
online = utils.IOB_Online,
|
online = utils.IOB_Online,
|
||||||
lastDataIn = iobObj.lastReadPLC,
|
lastDataIn = iobObj.lastReadPLC,
|
||||||
lastDataOut = iobObj.lastIobOnline,
|
lastDataOut = iobObj.lastIobOnline,
|
||||||
@@ -1528,7 +1540,7 @@ namespace IOB_WIN_NEXT
|
|||||||
freeNotes = note
|
freeNotes = note
|
||||||
};
|
};
|
||||||
// se diverso SALVO!
|
// se diverso SALVO!
|
||||||
if (!lastIobStatus.Equals(currIobStatus))
|
if (!currIobStatus.Equals(lastIobStatus))
|
||||||
{
|
{
|
||||||
// aggiorno data
|
// aggiorno data
|
||||||
currIobStatus.lastUpdate = DateTime.Now;
|
currIobStatus.lastUpdate = DateTime.Now;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ CMDREBO=/sendReboot.aspx?idxMacchina=
|
|||||||
; Red: Y31.4 | Yellow: Y31.5 | Green Y31.6 | riscaldamento Y7.4 ???
|
; Red: Y31.4 | Yellow: Y31.5 | Green Y31.6 | riscaldamento Y7.4 ???
|
||||||
;BIT0=CONN
|
;BIT0=CONN
|
||||||
BIT1=Y31.6
|
BIT1=Y31.6
|
||||||
BIT2=STD.MACRO.10100
|
BIT2=PZCOUNT.MACRO.10100
|
||||||
BIT3=Y31.4
|
BIT3=Y31.4
|
||||||
BIT4=Y31.5
|
BIT4=Y31.5
|
||||||
BIT5=Y7.4
|
BIT5=Y7.4
|
||||||
|
|||||||
@@ -3,33 +3,34 @@
|
|||||||
;Impianto Helpi x impacchettatrice - Finassi
|
;Impianto Helpi x impacchettatrice - Finassi
|
||||||
CNCTYPE=MODBUS_TCP_HELPI
|
CNCTYPE=MODBUS_TCP_HELPI
|
||||||
PING_MS_TIMEOUT=1000
|
PING_MS_TIMEOUT=1000
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=HELPI
|
VENDOR=HELPI
|
||||||
MODEL=HELPI
|
MODEL=HELPI
|
||||||
|
|
||||||
[CNC]
|
[CNC]
|
||||||
IP=10.74.82.65
|
IP=10.150.0.20
|
||||||
PORT=502
|
PORT=502
|
||||||
|
|
||||||
[SERVER]
|
[SERVER]
|
||||||
MPIP=https://iis01.egalware.com
|
MPIP=http://10.150.0.1
|
||||||
;MPIP=https://gwms.egalware.com
|
|
||||||
MPURL=/MP/IO
|
MPURL=/MP/IO
|
||||||
CMDBASE=/IOB/input/
|
CMDBASE=/IOB/input/
|
||||||
CMDFLOG=/IOB/flog/
|
CMDFLOG=/IOB/flog/
|
||||||
CMDALIVE=/IOB
|
CMDALIVE=/IOB
|
||||||
CMDENABLED=/IOB/enabled/
|
CMDENABLED=/IOB/enabled/
|
||||||
CMDADV1=?valore=
|
CMDADV1=?valore=
|
||||||
CMDREBO=/IOB/sendReboot?idxMacchina=
|
CMDREBO=/sendReboot.aspx?idxMacchina=
|
||||||
;CMDREBO=/sendReboot.aspx?idxMacchina=
|
|
||||||
|
|
||||||
[MEMORY]
|
[MEMORY]
|
||||||
ADDR_READ=41060
|
ADDR_READ=41050
|
||||||
ADDR_WRITE=41060
|
ADDR_WRITE=41060
|
||||||
SIZE_READ=0
|
SIZE_READ=60
|
||||||
SIZE_WRITE=0
|
SIZE_WRITE=50
|
||||||
HR_BASE_ADDR=40000
|
HR_BASE_ADDR=0
|
||||||
|
;HR_BASE_ADDR=40000
|
||||||
|
DELTA_BASE=0
|
||||||
|
|
||||||
|
|
||||||
[BLINK]
|
[BLINK]
|
||||||
@@ -71,5 +72,8 @@ MEM_BLOCK=FINASSI_HELPI_01_MBlock.json
|
|||||||
; conf aree allarme
|
; conf aree allarme
|
||||||
ALARM_CONF=FINASSI_HELPI_01_alarm.json
|
ALARM_CONF=FINASSI_HELPI_01_alarm.json
|
||||||
|
|
||||||
|
; rimozione check limiti min/max dynData
|
||||||
|
disDynDataRangeCheck=true
|
||||||
|
|
||||||
[BRANCH]
|
[BRANCH]
|
||||||
NAME=master
|
NAME=master
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"name": "NumPacchi",
|
"name": "NumPacchi",
|
||||||
"description": "Numero Pacchi Richiesti",
|
"description": "Numero Pacchi Richiesti",
|
||||||
"memAddr": "41098",
|
"memAddr": "41098",
|
||||||
"tipoMem": "INT",
|
"tipoMem": "IntLH",
|
||||||
"index": 1098,
|
"index": 1098,
|
||||||
"size": 2,
|
"size": 2,
|
||||||
"unit": "#"
|
"unit": "#"
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
"minVal": 0,
|
"minVal": 0,
|
||||||
"maxVal": 32767,
|
"maxVal": 32767,
|
||||||
"unit": "#",
|
"unit": "#",
|
||||||
"func": "MEDIAN",
|
"func": "POINT",
|
||||||
"period": 90,
|
"period": 90,
|
||||||
"factor": 1
|
"factor": 1
|
||||||
},
|
},
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
"minVal": 0,
|
"minVal": 0,
|
||||||
"maxVal": 1,
|
"maxVal": 1,
|
||||||
"unit": "#",
|
"unit": "#",
|
||||||
"func": "MEDIAN",
|
"func": "POINT",
|
||||||
"period": 90,
|
"period": 90,
|
||||||
"factor": 1
|
"factor": 1
|
||||||
},
|
},
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
"index": 1062,
|
"index": 1062,
|
||||||
"size": 16,
|
"size": 16,
|
||||||
"unit": "#",
|
"unit": "#",
|
||||||
"func": "LAST",
|
"func": "POINT",
|
||||||
"period": 90
|
"period": 90
|
||||||
},
|
},
|
||||||
"LOTTO": {
|
"LOTTO": {
|
||||||
@@ -98,18 +98,18 @@
|
|||||||
"index": 1078,
|
"index": 1078,
|
||||||
"size": 16,
|
"size": 16,
|
||||||
"unit": "#",
|
"unit": "#",
|
||||||
"func": "LAST",
|
"func": "POINT",
|
||||||
"period": 90
|
"period": 90
|
||||||
},
|
},
|
||||||
"NumPacchi": {
|
"NumPacchi": {
|
||||||
"name": "NumPacchi",
|
"name": "NumPacchi",
|
||||||
"description": "Numero Pacchi Richiesti",
|
"description": "Numero Pacchi Richiesti",
|
||||||
"memAddr": "41098",
|
"memAddr": "41098",
|
||||||
"tipoMem": "INT",
|
"tipoMem": "IntLH",
|
||||||
"index": 1098,
|
"index": 1098,
|
||||||
"size": 2,
|
"size": 2,
|
||||||
"unit": "#",
|
"unit": "#",
|
||||||
"func": "MEDIAN",
|
"func": "POINT",
|
||||||
"period": 90,
|
"period": 90,
|
||||||
"factor": 1
|
"factor": 1
|
||||||
},
|
},
|
||||||
@@ -117,11 +117,11 @@
|
|||||||
"name": "NumPacchiFatti",
|
"name": "NumPacchiFatti",
|
||||||
"description": "Numero Pacchi Fatti",
|
"description": "Numero Pacchi Fatti",
|
||||||
"memAddr": "41100",
|
"memAddr": "41100",
|
||||||
"tipoMem": "INT",
|
"tipoMem": "IntLH",
|
||||||
"index": 1100,
|
"index": 1100,
|
||||||
"size": 2,
|
"size": 2,
|
||||||
"unit": "#",
|
"unit": "#",
|
||||||
"func": "MEDIAN",
|
"func": "POINT",
|
||||||
"period": 90,
|
"period": 90,
|
||||||
"factor": 1
|
"factor": 1
|
||||||
},
|
},
|
||||||
@@ -129,11 +129,11 @@
|
|||||||
"name": "EpochStart",
|
"name": "EpochStart",
|
||||||
"description": "DateTime inizio lavorazione formato EPOCH",
|
"description": "DateTime inizio lavorazione formato EPOCH",
|
||||||
"memAddr": "41102",
|
"memAddr": "41102",
|
||||||
"tipoMem": "INT",
|
"tipoMem": "IntLH",
|
||||||
"index": 1102,
|
"index": 1102,
|
||||||
"size": 2,
|
"size": 2,
|
||||||
"unit": "#",
|
"unit": "EPOCH",
|
||||||
"func": "LAST",
|
"func": "POINT",
|
||||||
"period": 90,
|
"period": 90,
|
||||||
"factor": 1
|
"factor": 1
|
||||||
},
|
},
|
||||||
@@ -141,23 +141,23 @@
|
|||||||
"name": "EpochStop",
|
"name": "EpochStop",
|
||||||
"description": "DateTime fine lavorazione formato EPOCH",
|
"description": "DateTime fine lavorazione formato EPOCH",
|
||||||
"memAddr": "41104",
|
"memAddr": "41104",
|
||||||
"tipoMem": "INT",
|
"tipoMem": "IntLH",
|
||||||
"index": 1104,
|
"index": 1104,
|
||||||
"size": 2,
|
"size": 2,
|
||||||
"unit": "#",
|
"unit": "EPOCH",
|
||||||
"func": "LAST",
|
"func": "POINT",
|
||||||
"period": 90,
|
"period": 90,
|
||||||
"factor": 1
|
"factor": 1
|
||||||
},
|
},
|
||||||
"PPM": {
|
"PPM": {
|
||||||
"name": "PPM",
|
"name": "PPM",
|
||||||
"description": "Velocit� espressa come Pacchi Per Minuto",
|
"description": "Velocita espressa come Pacchi Per Minuto",
|
||||||
"memAddr": "41106",
|
"memAddr": "41106",
|
||||||
"tipoMem": "Real",
|
"tipoMem": "RealLH",
|
||||||
"index": 1106,
|
"index": 1106,
|
||||||
"size": 2,
|
"size": 2,
|
||||||
"unit": "#",
|
"unit": "#",
|
||||||
"func": "LAST",
|
"func": "POINT",
|
||||||
"period": 90,
|
"period": 90,
|
||||||
"factor": 1
|
"factor": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"tipoMem": "DInt",
|
"tipoMem": "DInt",
|
||||||
"memAddr": "41094",
|
"memAddr": "41094",
|
||||||
"index": 1094,
|
"index": 1094,
|
||||||
"size": 2,
|
"size": 4,
|
||||||
"messages": [
|
"messages": [
|
||||||
"AUSILIARI NON INSERITI",
|
"AUSILIARI NON INSERITI",
|
||||||
"TERMICA SBOBINATORI",
|
"TERMICA SBOBINATORI",
|
||||||
@@ -37,8 +37,7 @@
|
|||||||
"BYPASS SPORTELLI INSERITO",
|
"BYPASS SPORTELLI INSERITO",
|
||||||
"BARRA SALDANTE NON IN POSIZIONE, EFFETTUARE SALDATURA MANUALE",
|
"BARRA SALDANTE NON IN POSIZIONE, EFFETTUARE SALDATURA MANUALE",
|
||||||
"GESTIONALE: MACCHINA IN CICLO",
|
"GESTIONALE: MACCHINA IN CICLO",
|
||||||
"GESTIONALE: RICETTA NON TROVATA",
|
"GESTIONALE: RICETTA NON TROVATA"
|
||||||
"PROBLEMA FC BYPASS EMERGENZA BARRA"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -46,8 +45,9 @@
|
|||||||
"tipoMem": "DInt",
|
"tipoMem": "DInt",
|
||||||
"memAddr": "41096",
|
"memAddr": "41096",
|
||||||
"index": 1096,
|
"index": 1096,
|
||||||
"size": 2,
|
"size": 4,
|
||||||
"messages": [
|
"messages": [
|
||||||
|
"PROBLEMA FC BYPASS EMERGENZA BARRA",
|
||||||
"PROBLEMA FC EMERGENZA BARRA",
|
"PROBLEMA FC EMERGENZA BARRA",
|
||||||
"##",
|
"##",
|
||||||
"##",
|
"##",
|
||||||
@@ -78,7 +78,6 @@
|
|||||||
"##",
|
"##",
|
||||||
"##",
|
"##",
|
||||||
"##",
|
"##",
|
||||||
"##",
|
|
||||||
"##"
|
"##"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
;Configurazione IOB-WIN
|
||||||
|
[IOB]
|
||||||
|
;Centro di lavoro OMP (https://omp.it/) con controllo siemens S7-1200 + OpcUa
|
||||||
|
CNCTYPE=OpcUaSiemensOMP
|
||||||
|
PING_MS_TIMEOUT=500
|
||||||
|
|
||||||
|
[MACHINE]
|
||||||
|
VENDOR=OMP
|
||||||
|
MODEL=Infilatrice
|
||||||
|
|
||||||
|
[CNC]
|
||||||
|
IP=10.150.0.41
|
||||||
|
PORT=4840
|
||||||
|
GETPRGNAME=true
|
||||||
|
|
||||||
|
[SERVER]
|
||||||
|
MPIP=http://10.150.0.1
|
||||||
|
MPURL=/MP/IO
|
||||||
|
CMDBASE=/IOB/input/
|
||||||
|
CMDFLOG=/IOB/flog/
|
||||||
|
CMDALIVE=/IOB
|
||||||
|
CMDENABLED=/IOB/enabled/
|
||||||
|
CMDADV1=?valore=
|
||||||
|
CMDREBO=/sendReboot.aspx?idxMacchina=
|
||||||
|
|
||||||
|
[MEMORY]
|
||||||
|
ADDR_READ=DB9999.DBB0
|
||||||
|
ADDR_WRITE=DB9999.DBB0
|
||||||
|
SIZE_READ=0
|
||||||
|
SIZE_WRITE=0
|
||||||
|
|
||||||
|
|
||||||
|
[BLINK]
|
||||||
|
;MAX_COUNTER_BLINK = 30
|
||||||
|
MAX_COUNTER_BLINK = 15
|
||||||
|
;bit0 = 0
|
||||||
|
;bit1 = 0
|
||||||
|
;bit2 = 1
|
||||||
|
;bit3 = 1
|
||||||
|
;bit4 = 1
|
||||||
|
;bit5 = 0
|
||||||
|
;bit6 = 0
|
||||||
|
;bit7 = 0
|
||||||
|
BLINK_FILT=0
|
||||||
|
;BLINK_FILT=28
|
||||||
|
|
||||||
|
[OPTPAR]
|
||||||
|
AUTO_CHANGE_ODL=false
|
||||||
|
CHANGE_ODL_MODE=TIME
|
||||||
|
CHANGE_ODL_HOURS=24
|
||||||
|
CHANGE_ODL_IDLE_MIN=5
|
||||||
|
PZCOUNT_MODE=OPC
|
||||||
|
DISABLE_PZCOUNT=FALSE
|
||||||
|
ENABLE_SEND_PZC_BLOCK=TRUE
|
||||||
|
MIN_SEND_PZC_BLOCK=0
|
||||||
|
MAX_SEND_PZC_BLOCK=100
|
||||||
|
ENABLE_DYN_DATA=FALSE
|
||||||
|
FORCE_DYN_DATA=TRUE
|
||||||
|
ENABLE_DATA_FILTER=TRUE
|
||||||
|
ENABLE_CLI_RESTART=TRUE
|
||||||
|
|
||||||
|
; conf parametri memoria READ/WRITE
|
||||||
|
OPC_PARAM_CONF=FINASSI_OMP_01.json
|
||||||
|
|
||||||
|
[BRANCH]
|
||||||
|
NAME=master
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
{
|
||||||
|
"BrowseFullVal": "ns=3;s=ServerInterfaces",
|
||||||
|
"BrowseNSIndex": 4,
|
||||||
|
"BrowseValue": 1,
|
||||||
|
"keyPartCount": "Conteggio",
|
||||||
|
"keyPartReq": "Set Quantità Lotto",
|
||||||
|
"keyPartId": "Generale: Nome Ricetta",
|
||||||
|
"keyProgName": "Generale: Nome Ricetta",
|
||||||
|
"keyRunMode": "",
|
||||||
|
"pingAsPowerOn": true,
|
||||||
|
"condWork": [
|
||||||
|
{
|
||||||
|
"keyName": "Selettore in Automatico",
|
||||||
|
"targetValue": "True"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keyName": "Memoria Ciclo Automatico",
|
||||||
|
"targetValue": "True"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"condPowerOn": {
|
||||||
|
"checkMode": "AND",
|
||||||
|
"checkList": []
|
||||||
|
},
|
||||||
|
"condReady": {
|
||||||
|
"checkMode": "AND",
|
||||||
|
"checkList": []
|
||||||
|
},
|
||||||
|
"condManual": {
|
||||||
|
"checkMode": "AND",
|
||||||
|
"checkList": [
|
||||||
|
{
|
||||||
|
"keyName": "Selettore in Manuale",
|
||||||
|
"targetValue": "True"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"condEStop": {
|
||||||
|
"checkMode": "AND",
|
||||||
|
"checkList": []
|
||||||
|
},
|
||||||
|
"condError": {
|
||||||
|
"checkMode": "AND",
|
||||||
|
"checkList": [
|
||||||
|
{
|
||||||
|
"keyName": "Memoria Allarme Attivo",
|
||||||
|
"targetValue": "True"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"condCountEnabled": {
|
||||||
|
"checkMode": "AND",
|
||||||
|
"checkList": []
|
||||||
|
},
|
||||||
|
"condWarmUpCoolDown": {
|
||||||
|
"checkMode": "OR",
|
||||||
|
"checkList": []
|
||||||
|
},
|
||||||
|
"condWarning": {
|
||||||
|
"checkMode": "AND",
|
||||||
|
"checkList": []
|
||||||
|
},
|
||||||
|
"condSetup": {
|
||||||
|
"checkMode": "AND",
|
||||||
|
"checkList": [
|
||||||
|
{
|
||||||
|
"keyName": "Fine Lotto (1=Stop Ciclo)",
|
||||||
|
"targetValue": "1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"fluxLogVeto": [
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"itemTranslation": {
|
||||||
|
"fdovrd": "PATH FEED OVERRIDE",
|
||||||
|
"rovrd": "PATH RAPID OVERRIDE"
|
||||||
|
},
|
||||||
|
"paramsEndThresh": {
|
||||||
|
"InvDDone": 50
|
||||||
|
},
|
||||||
|
"mMapWrite": {
|
||||||
|
"setPzComm": {
|
||||||
|
"name": "setPzComm",
|
||||||
|
"description": "Qty",
|
||||||
|
"tipoMem": "Int",
|
||||||
|
"memAddr": "ns=4;i=11",
|
||||||
|
"index": 0,
|
||||||
|
"size": 4
|
||||||
|
},
|
||||||
|
"setProg": {
|
||||||
|
"name": "setProg",
|
||||||
|
"description": "Programma",
|
||||||
|
"tipoMem": "String",
|
||||||
|
"memAddr": "ns=4;i=9",
|
||||||
|
"index": 0,
|
||||||
|
"size": 30
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"subscribedItems": [
|
||||||
|
"ns=4;i=1",
|
||||||
|
"ns=4;i=2",
|
||||||
|
"ns=4;i=3",
|
||||||
|
"ns=4;i=4",
|
||||||
|
"ns=4;i=5",
|
||||||
|
"ns=4;i=6",
|
||||||
|
"ns=4;i=7",
|
||||||
|
"ns=4;i=8",
|
||||||
|
"ns=4;i=9",
|
||||||
|
"ns=4;i=10",
|
||||||
|
"ns=4;i=11",
|
||||||
|
"ns=4;i=12",
|
||||||
|
"ns=4;i=13",
|
||||||
|
"ns=4;i=14"
|
||||||
|
],
|
||||||
|
"WatchDog": {
|
||||||
|
"IsEnabled": false,
|
||||||
|
"MemConfRead": "ns=4;s=tomes_1_Watchdog",
|
||||||
|
"MemConfWrite": "ns=4;s=tomach_1_watchdog",
|
||||||
|
"MaxVal": 9999
|
||||||
|
},
|
||||||
|
"actStopProd": {
|
||||||
|
"ns=4;i=14": "1"
|
||||||
|
},
|
||||||
|
"actSetRecipe": {
|
||||||
|
"ns=4;i=10": "1"
|
||||||
|
},
|
||||||
|
"actResetCounter": {
|
||||||
|
"ns=4;i=13": "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
;Impianto Cedax di Turi (test) - Giacovelli
|
;Impianto Cedax di Turi (test) - Giacovelli
|
||||||
CNCTYPE=MODBUS_TCP_CEDAX
|
CNCTYPE=MODBUS_TCP_CEDAX
|
||||||
PING_MS_TIMEOUT=1000
|
PING_MS_TIMEOUT=1000
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=CEDAX
|
VENDOR=CEDAX
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;Impianto Cedax di Turi (test) - Giacovelli
|
;Impianto Cedax di Turi (test) - Giacovelli
|
||||||
CNCTYPE=MODBUS_TCP_CEDAX
|
CNCTYPE=MODBUS_TCP_CEDAX
|
||||||
PING_MS_TIMEOUT=1000
|
PING_MS_TIMEOUT=1000
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=CEDAX
|
VENDOR=CEDAX
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;Impianto Cedax di Turi (test) - Giacovelli
|
;Impianto Cedax di Turi (test) - Giacovelli
|
||||||
CNCTYPE=MODBUS_TCP_CEDAX
|
CNCTYPE=MODBUS_TCP_CEDAX
|
||||||
PING_MS_TIMEOUT=1000
|
PING_MS_TIMEOUT=1000
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=CEDAX
|
VENDOR=CEDAX
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;Impianto Cedax di Turi (test) - Giacovelli
|
;Impianto Cedax di Turi (test) - Giacovelli
|
||||||
CNCTYPE=MODBUS_TCP_CENTERFRIGO
|
CNCTYPE=MODBUS_TCP_CENTERFRIGO
|
||||||
PING_MS_TIMEOUT=1000
|
PING_MS_TIMEOUT=1000
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=Centerfrigo
|
VENDOR=Centerfrigo
|
||||||
|
|||||||
@@ -1,31 +1,63 @@
|
|||||||
{
|
{
|
||||||
"mMapWrite": {
|
"mMapWrite": {
|
||||||
"TestWrite": {
|
"SetPoint_Tunnel_Req": {
|
||||||
"name": "TestWrite",
|
"name": "SetPoint_Tunnel_Req",
|
||||||
"description": "Test Scrittura",
|
"description": "Setpoint Tunnel",
|
||||||
"memAddr": "41621",
|
"memAddr": "44010",
|
||||||
"tipoMem": "Real",
|
"tipoMem": "RealLH",
|
||||||
"index": 1621,
|
"index": 4010,
|
||||||
"size": 2,
|
"size": 2,
|
||||||
"func": "MEDIAN",
|
|
||||||
"period": 60,
|
|
||||||
"factor": 1,
|
"factor": 1,
|
||||||
"minVal": -100,
|
"minVal": -5,
|
||||||
"maxVal": 100,
|
"maxVal": 15,
|
||||||
"unit": "°C"
|
"unit": "°C"
|
||||||
},
|
},
|
||||||
"SetPoint_Tunnel": {
|
"SetPoint_Cella_01_Req": {
|
||||||
"name": "SetPoint_Tunnel",
|
"name": "SetPoint_Cella_01_Req",
|
||||||
"description": "Setpoint Tunnel",
|
"description": "Setpoint Cella 01",
|
||||||
"memAddr": "41560",
|
"memAddr": "44012",
|
||||||
"tipoMem": "Real",
|
"tipoMem": "RealLH",
|
||||||
"index": 1560,
|
"index": 4012,
|
||||||
"size": 2,
|
"size": 2,
|
||||||
"func": "MEDIAN",
|
|
||||||
"period": 60,
|
|
||||||
"factor": 1,
|
"factor": 1,
|
||||||
"minVal": -100,
|
"minVal": -5,
|
||||||
"maxVal": 100,
|
"maxVal": 15,
|
||||||
|
"unit": "°C"
|
||||||
|
},
|
||||||
|
"SetPoint_Cella_02_Req": {
|
||||||
|
"name": "SetPoint_Cella_02_Req",
|
||||||
|
"description": "Setpoint Cella 02",
|
||||||
|
"memAddr": "44014",
|
||||||
|
"tipoMem": "RealLH",
|
||||||
|
"index": 4014,
|
||||||
|
"size": 2,
|
||||||
|
"factor": 1,
|
||||||
|
"minVal": -5,
|
||||||
|
"maxVal": 15,
|
||||||
|
"unit": "°C"
|
||||||
|
},
|
||||||
|
"SetPoint_Cella_03_Req": {
|
||||||
|
"name": "SetPoint_Cella_03_Req",
|
||||||
|
"description": "Setpoint Cella 03",
|
||||||
|
"memAddr": "44016",
|
||||||
|
"tipoMem": "RealLH",
|
||||||
|
"index": 4016,
|
||||||
|
"size": 2,
|
||||||
|
"factor": 1,
|
||||||
|
"minVal": -5,
|
||||||
|
"maxVal": 15,
|
||||||
|
"unit": "°C"
|
||||||
|
},
|
||||||
|
"SetPoint_Cella_04_Req": {
|
||||||
|
"name": "SetPoint_Cella_04_Req",
|
||||||
|
"description": "Setpoint Cella 04",
|
||||||
|
"memAddr": "44018",
|
||||||
|
"tipoMem": "RealLH",
|
||||||
|
"index": 4018,
|
||||||
|
"size": 2,
|
||||||
|
"factor": 1,
|
||||||
|
"minVal": -5,
|
||||||
|
"maxVal": 15,
|
||||||
"unit": "°C"
|
"unit": "°C"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;Centro di lavoro OpcUa
|
;Centro di lavoro OpcUa
|
||||||
CNCTYPE=OpcUaOmronIcoel
|
CNCTYPE=OpcUaOmronIcoel
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=ICOEL
|
VENDOR=ICOEL
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;WebService SOAP x sizer
|
;WebService SOAP x sizer
|
||||||
CNCTYPE=IcoelSoap
|
CNCTYPE=IcoelSoap
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
;IOB_NAME=GIACO_ICOEL
|
;IOB_NAME=GIACO_ICOEL
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;Accesso gestione sync DB x sync ICOEL --> MoonPro_ISF --> MoonPro_IS
|
;Accesso gestione sync DB x sync ICOEL --> MoonPro_ISF --> MoonPro_IS
|
||||||
CNCTYPE=IcoelDb
|
CNCTYPE=IcoelDb
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
;IOB_NAME=GIACO_ICOEL
|
;IOB_NAME=GIACO_ICOEL
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
;Macchina pulitrice RobotService x Donati
|
;Macchina pulitrice RobotService x Donati
|
||||||
CNCTYPE=SIEMENS_NWSE
|
CNCTYPE=SIEMENS_NWSE
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=NWS
|
VENDOR=NWS
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
;Configurazione IOB-WIN
|
||||||
|
[IOB]
|
||||||
|
CNCTYPE=FANUC
|
||||||
|
|
||||||
|
[MACHINE]
|
||||||
|
VENDOR=COLCOM
|
||||||
|
MODEL=DMG-MORI
|
||||||
|
|
||||||
|
[CNC]
|
||||||
|
; TEST FANUC!
|
||||||
|
IP=192.168.100.78
|
||||||
|
PORT=8193
|
||||||
|
GETPRGNAME=true
|
||||||
|
|
||||||
|
[SERVER]
|
||||||
|
MPIP=192.168.111.104
|
||||||
|
MPURL=/MP/IO
|
||||||
|
CMDBASE=/IOB/input/
|
||||||
|
CMDFLOG=/IOB/flog/
|
||||||
|
CMDALIVE=/IOB
|
||||||
|
CMDENABLED=/IOB/enabled/
|
||||||
|
CMDADV1=?valore=
|
||||||
|
CMDREBO=/sendReboot.aspx?idxMacchina=
|
||||||
|
|
||||||
|
[MEMORY]
|
||||||
|
; Red: Y12.4 | Yellow: Y51.1 (porta chiusa, da NEGARE) | Green Y12.6 | Alarm Y 51.4 | Blu Y12.7
|
||||||
|
;BIT0=CONN
|
||||||
|
BIT1=Y12.6
|
||||||
|
BIT2=PZCOUNT.PAR.6711
|
||||||
|
BIT3=Y12.4
|
||||||
|
BIT4=Y12.7
|
||||||
|
;BIT5=Y11.2
|
||||||
|
BIT5=X18.3
|
||||||
|
BIT6=X11.3
|
||||||
|
AREAD_START=0
|
||||||
|
AREAD_SIZE=9999
|
||||||
|
AREAG_SIZE=48
|
||||||
|
AREAR_START=0
|
||||||
|
AREAR_SIZE=64
|
||||||
|
AREAX_START=0
|
||||||
|
AREAX_SIZE=64
|
||||||
|
AREAY_START=0
|
||||||
|
AREAY_SIZE=64
|
||||||
|
PAR_START=6711
|
||||||
|
PAR_SIZE=3
|
||||||
|
|
||||||
|
[BLINK]
|
||||||
|
;MAX_COUNTER_BLINK = 30
|
||||||
|
MAX_COUNTER_BLINK = 15
|
||||||
|
;bit0 = 0
|
||||||
|
;bit1 = 0
|
||||||
|
;bit2 = 1
|
||||||
|
;bit3 = 1
|
||||||
|
;bit4 = 1
|
||||||
|
;bit5 = 0
|
||||||
|
;bit6 = 0
|
||||||
|
;bit7 = 0
|
||||||
|
BLINK_FILT=0
|
||||||
|
;BLINK_FILT=28
|
||||||
|
|
||||||
|
[OPTPAR]
|
||||||
|
;PZCOUNT_MODE=STD|BIT
|
||||||
|
PZCOUNT_MODE=STD.PAR.6711
|
||||||
|
PZGTOT_MODE=STD.PAR.6712
|
||||||
|
;PZREQ_MODE=STD.PAR.6713
|
||||||
|
ENABLE_PZ_RESET=TRUE
|
||||||
|
ENABLE_PZ_RESET_stopSetup=TRUE
|
||||||
|
;gestione invio pezzi in blocco
|
||||||
|
ENABLE_SEND_PZC_BLOCK=TRUE
|
||||||
|
MIN_SEND_PZC_BLOCK=0
|
||||||
|
MAX_SEND_PZC_BLOCK=100
|
||||||
|
|
||||||
|
|
||||||
|
[BRANCH]
|
||||||
|
NAME=master
|
||||||
@@ -38,6 +38,8 @@ CLI_INST=SteamWareSim
|
|||||||
;STARTLIST=GIACO_ICOEL_002
|
;STARTLIST=GIACO_ICOEL_002
|
||||||
;STARTLIST=GIACO_CENTERFRIGO
|
;STARTLIST=GIACO_CENTERFRIGO
|
||||||
;STARTLIST=GIACO_NWSE
|
;STARTLIST=GIACO_NWSE
|
||||||
STARTLIST=SIMUL_01
|
;STARTLIST=SIM_DP_01
|
||||||
|
;STARTLIST=FINASSI_HELPI_01
|
||||||
|
STARTLIST=FINASSI_OMP_01
|
||||||
|
|
||||||
MAXCNC=10
|
MAXCNC=10
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
@@ -50,7 +51,7 @@ SIM_PZCNT=10|3
|
|||||||
SIM_ALARM=1000|20
|
SIM_ALARM=1000|20
|
||||||
SIM_MANU=50|6
|
SIM_MANU=50|6
|
||||||
; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi
|
; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi
|
||||||
SIM_MULTI=1
|
IS_MULTI=1
|
||||||
; indica gestione e simulazione bit 5 --> slow/emergenza
|
; indica gestione e simulazione bit 5 --> slow/emergenza
|
||||||
SIM_SLOW=3500|20
|
SIM_SLOW=3500|20
|
||||||
; indica gestione e simulazione bit 6 --> warmup/cooldown
|
; indica gestione e simulazione bit 6 --> warmup/cooldown
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
[IOB]
|
[IOB]
|
||||||
CNCTYPE=SIMULA
|
CNCTYPE=SIMULA
|
||||||
PING_MS_TIMEOUT=500
|
PING_MS_TIMEOUT=500
|
||||||
|
MinDeltaSec=5
|
||||||
|
|
||||||
[MACHINE]
|
[MACHINE]
|
||||||
VENDOR=STEAMWARE
|
VENDOR=STEAMWARE
|
||||||
@@ -50,7 +51,7 @@ SIM_PZCNT=10|2
|
|||||||
SIM_ALARM=1000|20
|
SIM_ALARM=1000|20
|
||||||
SIM_MANU=50|6
|
SIM_MANU=50|6
|
||||||
; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi
|
; 1 = indica che la macchina è multi --> allo scadere del contapezzo gestisce ANCHE il giro tavola sui bit relativi
|
||||||
SIM_MULTI=1
|
IS_MULTI=1
|
||||||
; indica gestione e simulazione bit 5 --> slow/emergenza
|
; indica gestione e simulazione bit 5 --> slow/emergenza
|
||||||
SIM_SLOW=6500|20
|
SIM_SLOW=6500|20
|
||||||
; indica gestione e simulazione bit 6 --> warmup/cooldown
|
; indica gestione e simulazione bit 6 --> warmup/cooldown
|
||||||
|
|||||||
@@ -74,6 +74,25 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\Remote_DEBUG\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x86\Remote_DEBUG\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="AutoUpdater.NET, Version=1.7.0.0, Culture=neutral, PublicKeyToken=501435c91b35f4bc, processorArchitecture=MSIL">
|
<Reference Include="AutoUpdater.NET, Version=1.7.0.0, Culture=neutral, PublicKeyToken=501435c91b35f4bc, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Autoupdater.NET.Official.1.7.0\lib\net45\AutoUpdater.NET.dll</HintPath>
|
<HintPath>..\packages\Autoupdater.NET.Official.1.7.0\lib\net45\AutoUpdater.NET.dll</HintPath>
|
||||||
@@ -94,7 +113,7 @@
|
|||||||
<HintPath>..\packages\EgwProxy.Icoel.3.6.2206.2811\lib\EgwProxy.Icoel.DataLayer.dll</HintPath>
|
<HintPath>..\packages\EgwProxy.Icoel.3.6.2206.2811\lib\EgwProxy.Icoel.DataLayer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgwProxy.MultiCncLib, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="EgwProxy.MultiCncLib, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EgwProxy.MultiCncLib.3.6.2207.1116\lib\EgwProxy.MultiCncLib.dll</HintPath>
|
<HintPath>..\packages\EgwProxy.MultiCncLib.3.6.2207.1211\lib\EgwProxy.MultiCncLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgwProxy.OsaiCncLib, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="EgwProxy.OsaiCncLib, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\EgwProxy.OsaiCncLib.3.6.2205.2015\lib\EgwProxy.OsaiCncLib.dll</HintPath>
|
<HintPath>..\packages\EgwProxy.OsaiCncLib.3.6.2205.2015\lib\EgwProxy.OsaiCncLib.dll</HintPath>
|
||||||
@@ -112,8 +131,8 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>ExtLib\krcc.dll</HintPath>
|
<HintPath>ExtLib\krcc.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MapoSDK, Version=6.14.2206.2718, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MapoSDK, Version=6.14.2207.2913, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MapoSDK.6.14.2206.2718\lib\MapoSDK.dll</HintPath>
|
<HintPath>..\packages\MapoSDK.6.14.2207.2913\lib\MapoSDK.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MathNet.Numerics, Version=4.15.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MathNet.Numerics, Version=4.15.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MathNet.Numerics.4.15.0\lib\net461\MathNet.Numerics.dll</HintPath>
|
<HintPath>..\packages\MathNet.Numerics.4.15.0\lib\net461\MathNet.Numerics.dll</HintPath>
|
||||||
@@ -210,6 +229,8 @@
|
|||||||
<Compile Include="IobModbusTCPCenterfrigo.cs" />
|
<Compile Include="IobModbusTCPCenterfrigo.cs" />
|
||||||
<Compile Include="IobModbusTCPHelpi.cs" />
|
<Compile Include="IobModbusTCPHelpi.cs" />
|
||||||
<Compile Include="IobModbusTCPCedax.cs" />
|
<Compile Include="IobModbusTCPCedax.cs" />
|
||||||
|
<Compile Include="IobOpcUaSiemensOMP.cs" />
|
||||||
|
<Compile Include="IobOpcUaSiemens.cs" />
|
||||||
<Compile Include="IobOpcUaOmronIcoel.cs" />
|
<Compile Include="IobOpcUaOmronIcoel.cs" />
|
||||||
<Compile Include="IobOpcUaOmron.cs" />
|
<Compile Include="IobOpcUaOmron.cs" />
|
||||||
<Compile Include="IobOpcUaEwonBLM.cs" />
|
<Compile Include="IobOpcUaEwonBLM.cs" />
|
||||||
@@ -360,16 +381,16 @@
|
|||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="DATA\CONF\FINASSI_HELPI_01.ini">
|
<None Include="DATA\CONF\FINASSI_HELPI_01.ini">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="DATA\CONF\FINASSI_HELPI_01.json">
|
<None Include="DATA\CONF\FINASSI_HELPI_01.json">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="DATA\CONF\FINASSI_HELPI_01_alarm.json">
|
<None Include="DATA\CONF\FINASSI_HELPI_01_alarm.json">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="DATA\CONF\FINASSI_HELPI_01_MBlock.json">
|
<None Include="DATA\CONF\FINASSI_HELPI_01_MBlock.json">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="DATA\CONF\GIACO_ICOEL_002.ini">
|
<None Include="DATA\CONF\GIACO_ICOEL_002.ini">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
@@ -602,6 +623,12 @@
|
|||||||
<None Include="DATA\CONF\MECART_80.json">
|
<None Include="DATA\CONF\MECART_80.json">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="DATA\CONF\FINASSI_OMP_01.ini">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Include="DATA\CONF\FINASSI_OMP_01.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Include="DATA\CONF\STEL_200.ini">
|
<None Include="DATA\CONF\STEL_200.ini">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace IOB_WIN_NEXT
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dati di conf del server MoonPro cui comunicare
|
/// Dati di conf del server MoonPro cui comunicare
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public serverMapo serverData { get; set; } = new serverMapo("127.0.0.1", "/", "/IOB/input/", "/IOB/flog/", "/IOB", "/IOB/enabled/", "/sendReboot.aspx?idxMacchina=", "/IOB/getCurrOdlStart/");
|
public serverMapo serverData { get; set; } = new serverMapo("127.0.0.1", "/", "/IOB/input/", "/IOB/flog/", "/IOB/ulog/", "/IOB", "/IOB/enabled/", "/sendReboot.aspx?idxMacchina=", "/IOB/getCurrOdlStart/","SteamWare","/IOB/forceSplitOdlFull", "/IOB/getIdlePeriod", "/IOB/rawTransfJson");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Slot (Siemens S7)
|
/// Slot (Siemens S7)
|
||||||
@@ -123,6 +123,11 @@ namespace IOB_WIN_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string versIOB { get; set; } = "0";
|
public string versIOB { get; set; } = "0";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Minimo delta in sec x considerare variazioni info
|
||||||
|
/// </summary>
|
||||||
|
public int minDeltaSec { get; set; } = 2;
|
||||||
|
|
||||||
#endregion Public Properties
|
#endregion Public Properties
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +151,10 @@ namespace IOB_WIN_NEXT
|
|||||||
/// <param name="CMDENABLED_">Comando x check abilitato</param>
|
/// <param name="CMDENABLED_">Comando x check abilitato</param>
|
||||||
/// <param name="CMDREBO_">Comando x reboot</param>
|
/// <param name="CMDREBO_">Comando x reboot</param>
|
||||||
/// <param name="CMD_ODL_STARTED_">Comando x check data avvio ODL</param>
|
/// <param name="CMD_ODL_STARTED_">Comando x check data avvio ODL</param>
|
||||||
|
/// <param name="CLI_INST_">Installazione</param>
|
||||||
/// <param name="CMD_FORCLE_SPLIT_ODL_">Comando x forzare split ODL</param>
|
/// <param name="CMD_FORCLE_SPLIT_ODL_">Comando x forzare split ODL</param>
|
||||||
|
/// <param name="CMD_IDLE_TIME_">URL calcolo idle time</param>
|
||||||
|
/// <param name="CMDRAWTRANSFJSON_">Url invio raw transf</param>
|
||||||
public serverMapo(string MPIP_, string MPURL_ = "/MP/IO", string CMDBASE_ = "/IOB/input/", string CMDFLOG_ = "/IOB/flog/", string CMDULOG_ = "/IOB/ulog/", string CMDALIVE_ = "IOB", string CMDENABLED_ = "/IOB/enabled/", string CMDREBO_ = "/sendReboot.aspx?idxMacchina=", string CMD_ODL_STARTED_ = "/IOB/getCurrOdlStart/", string CLI_INST_ = "SteamWare", string CMD_FORCLE_SPLIT_ODL_ = "/IOB/forceSplitOdlFull/", string CMD_IDLE_TIME_ = "/IOB/getIdlePeriod/", string CMDRAWTRANSFJSON_ = "/IOB/rawTransfJson/")
|
public serverMapo(string MPIP_, string MPURL_ = "/MP/IO", string CMDBASE_ = "/IOB/input/", string CMDFLOG_ = "/IOB/flog/", string CMDULOG_ = "/IOB/ulog/", string CMDALIVE_ = "IOB", string CMDENABLED_ = "/IOB/enabled/", string CMDREBO_ = "/sendReboot.aspx?idxMacchina=", string CMD_ODL_STARTED_ = "/IOB/getCurrOdlStart/", string CLI_INST_ = "SteamWare", string CMD_FORCLE_SPLIT_ODL_ = "/IOB/forceSplitOdlFull/", string CMD_IDLE_TIME_ = "/IOB/getIdlePeriod/", string CMDRAWTRANSFJSON_ = "/IOB/rawTransfJson/")
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(MPIP_))
|
if (!string.IsNullOrEmpty(MPIP_))
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace IOB_WIN_NEXT
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// LookUpTable di decodifica da CNC a segnali tipo bitmap MAPO
|
/// LookUpTable di decodifica da CNC a segnali tipo bitmap MAPO
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private Dictionary<string, string> signLUT = new Dictionary<string, string>();
|
internal Dictionary<string, string> signLUT = new Dictionary<string, string>();
|
||||||
|
|
||||||
#endregion Private Fields
|
#endregion Private Fields
|
||||||
|
|
||||||
@@ -1112,10 +1112,10 @@ namespace IOB_WIN_NEXT
|
|||||||
int newVal = -1;
|
int newVal = -1;
|
||||||
Int32.TryParse(outputVal.ToString(), out newVal);
|
Int32.TryParse(outputVal.ToString(), out newVal);
|
||||||
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
|
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
|
||||||
if (isVerboseLog)
|
//if (isVerboseLog)
|
||||||
{
|
//{
|
||||||
lgInfo("[3] contapezziPLC contapezzi: {0}", contapezziPLC);
|
lgInfo("[3] contapezziPLC contapezzi: {0}", contapezziPLC);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
stopwatch.Stop();
|
stopwatch.Stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ namespace IOB_WIN_NEXT
|
|||||||
public DateTime lastDisconnCheck;
|
public DateTime lastDisconnCheck;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Data/ora ultima volta che IOB è stato dichairato online
|
/// Data/ora ultima volta che IOB è stato dichiarato online
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime lastIobOnline = DateTime.Now.AddHours(-1);
|
public DateTime lastIobOnline = DateTime.Now.AddHours(-1);
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ namespace IOB_WIN_NEXT
|
|||||||
if (IOBConf != null)
|
if (IOBConf != null)
|
||||||
{
|
{
|
||||||
// init oggetto redis...
|
// init oggetto redis...
|
||||||
redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.codIOB, IOBConf.tipoIob.ToString());
|
redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.codIOB, IOBConf.tipoIob.ToString(), IOBConf.minDeltaSec);
|
||||||
|
|
||||||
// initi oggetto TCMan
|
// initi oggetto TCMan
|
||||||
tcMan = new TCMan(IOBConf.TCLambda, IOBConf.TCMaxDelayFactor, IOBConf.TCMaxIncrPz);
|
tcMan = new TCMan(IOBConf.TCLambda, IOBConf.TCMaxDelayFactor, IOBConf.TCMaxIncrPz);
|
||||||
@@ -1367,7 +1367,7 @@ namespace IOB_WIN_NEXT
|
|||||||
* */
|
* */
|
||||||
|
|
||||||
// serializzo il valore...
|
// serializzo il valore...
|
||||||
BaseRawTransf newVal = new BaseRawTransf(DateTime.Now, mesContent, mesType);
|
BaseRawTransf newVal = new BaseRawTransf(DateTime.Now, (Newtonsoft.Json.Linq.JObject)mesContent, mesType);
|
||||||
string encodedVal = JsonConvert.SerializeObject(newVal);
|
string encodedVal = JsonConvert.SerializeObject(newVal);
|
||||||
// --> accodo (valore già formattato)!
|
// --> accodo (valore già formattato)!
|
||||||
QueueRawTransf.Enqueue(encodedVal);
|
QueueRawTransf.Enqueue(encodedVal);
|
||||||
@@ -3155,7 +3155,7 @@ namespace IOB_WIN_NEXT
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lgError($"Errore in invio richiesta registrazione allarme: URL: {lastUrl}{Environment.NewLine}Payload:{Environment.NewLine}{rawData}");
|
lgError($"Errore in invio richiesta registrazione allarme | resp: {resp} | URL: {lastUrl}{Environment.NewLine}Payload:{Environment.NewLine}{rawData}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fatto;
|
return fatto;
|
||||||
@@ -4902,6 +4902,7 @@ namespace IOB_WIN_NEXT
|
|||||||
{
|
{
|
||||||
Funzione = funz,
|
Funzione = funz,
|
||||||
Period = periodo,
|
Period = periodo,
|
||||||
|
UM = item.Value.unit,
|
||||||
DTStart = DateTime.Now.AddHours(-1),
|
DTStart = DateTime.Now.AddHours(-1),
|
||||||
dataArray = new List<double>()
|
dataArray = new List<double>()
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ namespace IOB_WIN_NEXT
|
|||||||
if (adpRunning)
|
if (adpRunning)
|
||||||
{
|
{
|
||||||
lgInfo("Connessione OK");
|
lgInfo("Connessione OK");
|
||||||
|
lastReadPLC = DateTime.Now;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -269,6 +270,7 @@ namespace IOB_WIN_NEXT
|
|||||||
sw.Start();
|
sw.Start();
|
||||||
elencoSyncState = dbProxy.DataController.SyncStateDoImportAll();
|
elencoSyncState = dbProxy.DataController.SyncStateDoImportAll();
|
||||||
sw.Stop();
|
sw.Stop();
|
||||||
|
lastReadPLC = DateTime.Now;
|
||||||
lgInfo($"DB: esecuzione task dbProxy.DataController.SyncStateGetAll() in {sw.ElapsedMilliseconds} ms");
|
lgInfo($"DB: esecuzione task dbProxy.DataController.SyncStateGetAll() in {sw.ElapsedMilliseconds} ms");
|
||||||
|
|
||||||
if (elencoSyncState != null)
|
if (elencoSyncState != null)
|
||||||
|
|||||||
+124
-19
@@ -238,7 +238,7 @@ namespace IOB_WIN_NEXT
|
|||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
lgError(exc, "Errore in getDynData x ModBus TCP PLC --> ciclo disconnect/reconnect | LUT: {useLUT}");
|
lgError(exc, $"Errore in getDynData x ModBus TCP PLC --> ciclo disconnect/reconnect | LUT: {useLUT}{Environment.NewLine}{exc}");
|
||||||
tryDisconnect();
|
tryDisconnect();
|
||||||
outVal = new Dictionary<string, string>();
|
outVal = new Dictionary<string, string>();
|
||||||
tryConnect();
|
tryConnect();
|
||||||
@@ -540,15 +540,16 @@ namespace IOB_WIN_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="startAddr"></param>
|
/// <param name="startAddr"></param>
|
||||||
/// <param name="currRegVal">Valore in formato INT da registri</param>
|
/// <param name="currRegVal">Valore in formato INT da registri</param>
|
||||||
|
/// <param name="baseAddr">Indirizzo di base dei registri</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool writeInputReg(int startAddr, int[] currRegVal)
|
public bool writeInputReg(int startAddr, int[] currRegVal, int baseAddr)
|
||||||
{
|
{
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
if (currPLC.Connected)
|
if (currPLC.Connected)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
currPLC.WriteMultipleRegisters(startAddr + deltaBase, currRegVal);
|
currPLC.WriteMultipleRegisters(startAddr + deltaBase + (40000 - baseAddr), currRegVal);
|
||||||
answ = true;
|
answ = true;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@@ -797,13 +798,36 @@ namespace IOB_WIN_NEXT
|
|||||||
CurrVal = ModbusClient.ConvertIntToRegisters(valInt);
|
CurrVal = ModbusClient.ConvertIntToRegisters(valInt);
|
||||||
}
|
}
|
||||||
|
|
||||||
fatto = writeInputReg(currMem.index, CurrVal);
|
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case plcDataType.IntLH:
|
||||||
|
valInt = getScaledInt(currMem, true);
|
||||||
|
if (byteSize == 1)
|
||||||
|
{
|
||||||
|
CurrVal[1] = valInt;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CurrVal = ModbusClient.ConvertIntToRegisters(valInt);
|
||||||
|
Array.Reverse(CurrVal);
|
||||||
|
}
|
||||||
|
|
||||||
|
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case plcDataType.DInt:
|
case plcDataType.DInt:
|
||||||
valUInt = getScaledUInt(currMem, true);
|
valUInt = getScaledUInt(currMem, true);
|
||||||
CurrVal = ModbusClient.ConvertLongToRegisters(valInt);
|
CurrVal = ModbusClient.ConvertLongToRegisters(valInt);
|
||||||
fatto = writeInputReg(currMem.index, CurrVal);
|
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case plcDataType.DIntLH:
|
||||||
|
valUInt = getScaledUInt(currMem, true);
|
||||||
|
CurrVal = ModbusClient.ConvertLongToRegisters(valInt);
|
||||||
|
Array.Reverse(CurrVal);
|
||||||
|
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//case plcDataType.Word:
|
//case plcDataType.Word:
|
||||||
@@ -817,19 +841,27 @@ namespace IOB_WIN_NEXT
|
|||||||
// break;
|
// break;
|
||||||
|
|
||||||
case plcDataType.Real:
|
case plcDataType.Real:
|
||||||
|
case plcDataType.RealHL:
|
||||||
valDouble = getScaledDouble(currMem);
|
valDouble = getScaledDouble(currMem);
|
||||||
CurrVal = ModbusClient.ConvertFloatToRegisters((float)valDouble, ModbusClient.RegisterOrder.HighLow);
|
CurrVal = ModbusClient.ConvertFloatToRegisters((float)valDouble, ModbusClient.RegisterOrder.HighLow);
|
||||||
fatto = writeInputReg(currMem.index, CurrVal);
|
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//case plcDataType.String:
|
case plcDataType.FloatBADC:
|
||||||
// // se ho writePre --> "allungo" di 2 la dimensione della stringa x MemBlock...
|
case plcDataType.RealLH:
|
||||||
// if (writePre)
|
valDouble = getScaledDouble(currMem);
|
||||||
// {
|
CurrVal = ModbusClient.ConvertFloatToRegisters((float)valDouble, ModbusClient.RegisterOrder.LowHigh);
|
||||||
// MemBlock = new byte[byteSize + 2];
|
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
|
||||||
// }
|
break;
|
||||||
// saveStringOnMemBlock(ref MemBlock, 0, currMem.size, currMem.value);
|
|
||||||
// break;
|
case plcDataType.String:
|
||||||
|
CurrVal = ModbusClient.ConvertStringToRegisters(currMem.value.PadRight(currMem.size * 2));
|
||||||
|
var regLen = ModbusClient.ConvertIntToRegisters(currMem.size * 2 - 2);
|
||||||
|
Array.Copy(regLen, 0, CurrVal, CurrVal.Length - regLen.Length, regLen.Length);
|
||||||
|
//CurrVal[CurrVal.Length - 2] = regLen[1];
|
||||||
|
//CurrVal[CurrVal.Length - 1] = regLen[0];
|
||||||
|
fatto = writeInputReg(currMem.index, CurrVal, parametri.holdRegBaseAddr);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -876,7 +908,7 @@ namespace IOB_WIN_NEXT
|
|||||||
// SE è necessario refresh...
|
// SE è necessario refresh...
|
||||||
if (needRefresh)
|
if (needRefresh)
|
||||||
{
|
{
|
||||||
lgInfoStartup("Refreshing connection...");
|
lgInfo("Refreshing connection...");
|
||||||
if (parametri != null)
|
if (parametri != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -1123,6 +1155,8 @@ namespace IOB_WIN_NEXT
|
|||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// converte valore in tipo desiderato
|
/// converte valore in tipo desiderato
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1137,6 +1171,7 @@ namespace IOB_WIN_NEXT
|
|||||||
switch (tipoMem)
|
switch (tipoMem)
|
||||||
{
|
{
|
||||||
case plcDataType.Real:
|
case plcDataType.Real:
|
||||||
|
case plcDataType.RealHL:
|
||||||
case plcDataType.FloatABCD:
|
case plcDataType.FloatABCD:
|
||||||
if (size == 4)
|
if (size == 4)
|
||||||
{
|
{
|
||||||
@@ -1148,16 +1183,17 @@ namespace IOB_WIN_NEXT
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case plcDataType.RealLH:
|
||||||
case plcDataType.FloatCDAB:
|
case plcDataType.FloatCDAB:
|
||||||
if (size == 4)
|
if (size == 4)
|
||||||
{
|
{
|
||||||
// invero array...
|
// inverto array...
|
||||||
Array.Reverse(listInt);
|
Array.Reverse(listInt);
|
||||||
valore = ModbusClient.ConvertRegistersToDouble(listInt);
|
valore = ModbusClient.ConvertRegistersToDouble(listInt);
|
||||||
}
|
}
|
||||||
else if (size == 2)
|
else if (size == 2)
|
||||||
{
|
{
|
||||||
// non serve cambaire nulla...
|
// inverto array...
|
||||||
Array.Reverse(listInt);
|
Array.Reverse(listInt);
|
||||||
valore = ModbusClient.ConvertRegistersToFloat(listInt);
|
valore = ModbusClient.ConvertRegistersToFloat(listInt);
|
||||||
}
|
}
|
||||||
@@ -1191,6 +1227,21 @@ namespace IOB_WIN_NEXT
|
|||||||
valore = listInt[0];
|
valore = listInt[0];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case plcDataType.IntLH:
|
||||||
|
case plcDataType.DIntLH:
|
||||||
|
if (size == 4)
|
||||||
|
{
|
||||||
|
Array.Reverse(listInt);
|
||||||
|
valore = ModbusClient.ConvertRegistersToLong(listInt);
|
||||||
|
}
|
||||||
|
else if (size == 2)
|
||||||
|
{
|
||||||
|
Array.Reverse(listInt);
|
||||||
|
valore = ModbusClient.ConvertRegistersToInt(listInt);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return valore;
|
return valore;
|
||||||
}
|
}
|
||||||
@@ -1233,6 +1284,10 @@ namespace IOB_WIN_NEXT
|
|||||||
valInt = (int)(temp * 10 * currMem.factor) / 10;
|
valInt = (int)(temp * 10 * currMem.factor) / 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
valInt = (int)temp;
|
||||||
|
}
|
||||||
|
|
||||||
return valInt;
|
return valInt;
|
||||||
}
|
}
|
||||||
@@ -1292,11 +1347,13 @@ namespace IOB_WIN_NEXT
|
|||||||
// procedo x ogni valore configurato...
|
// procedo x ogni valore configurato...
|
||||||
foreach (var item in memItemList)
|
foreach (var item in memItemList)
|
||||||
{
|
{
|
||||||
|
listInt = new int[item.Value.size];
|
||||||
// attesa 50 ms prima di procedere x evitare burst dati
|
// attesa 50 ms prima di procedere x evitare burst dati
|
||||||
if (!useLUT)
|
if (!useLUT)
|
||||||
{
|
{
|
||||||
Thread.Sleep(50);
|
Thread.Sleep(50);
|
||||||
}
|
}
|
||||||
|
string valString = "";
|
||||||
double valore = 0;
|
double valore = 0;
|
||||||
double valoreScal = 0;
|
double valoreScal = 0;
|
||||||
bool dataOk = false;
|
bool dataOk = false;
|
||||||
@@ -1318,7 +1375,16 @@ namespace IOB_WIN_NEXT
|
|||||||
|
|
||||||
case modBusAddrType.InputRegister:
|
case modBusAddrType.InputRegister:
|
||||||
listInt = readInputReg(item.Value.index, item.Value.size);
|
listInt = readInputReg(item.Value.index, item.Value.size);
|
||||||
|
if (item.Value.tipoMem == plcDataType.String)
|
||||||
|
{
|
||||||
|
// valore string...
|
||||||
|
valString = ModbusClient.ConvertRegistersToString(listInt, 0, item.Value.size);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// valori numerici...
|
||||||
valore = convertFromReg(listInt, item.Value.size, item.Value.tipoMem);
|
valore = convertFromReg(listInt, item.Value.size, item.Value.tipoMem);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1345,9 +1411,20 @@ namespace IOB_WIN_NEXT
|
|||||||
if (HoldingRegisterLUT.ContainsKey(lutAddress))
|
if (HoldingRegisterLUT.ContainsKey(lutAddress))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
if (listInt.Length == 2)
|
||||||
{
|
{
|
||||||
listInt = HoldingRegisterLUT[lutAddress];
|
listInt = HoldingRegisterLUT[lutAddress];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// faccio ciclo x copiare 2 alla volta...
|
||||||
|
for (int i = 0; i < listInt.Length; i += 2)
|
||||||
|
{
|
||||||
|
Array.Copy(HoldingRegisterLUT[lutAddress + i], 0, listInt, i, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
lgError($"Errore in lettura da HoldingRegisterLUT per indirizzo {lutAddress} | item {item.Key}{Environment.NewLine}{exc}");
|
lgError($"Errore in lettura da HoldingRegisterLUT per indirizzo {lutAddress} | item {item.Key}{Environment.NewLine}{exc}");
|
||||||
@@ -1359,21 +1436,47 @@ namespace IOB_WIN_NEXT
|
|||||||
{
|
{
|
||||||
listInt = readHoldReg(item.Value.index - 1, item.Value.size);
|
listInt = readHoldReg(item.Value.index - 1, item.Value.size);
|
||||||
}
|
}
|
||||||
|
if (item.Value.tipoMem == plcDataType.String)
|
||||||
|
{
|
||||||
|
// valore string...
|
||||||
|
valString = ModbusClient.ConvertRegistersToString(listInt, 0, item.Value.size);
|
||||||
|
valString = valString.Replace("\n", "").Replace("\r", "").Replace("\0", string.Empty).Trim();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
valore = convertFromReg(listInt, item.Value.size, item.Value.tipoMem);
|
valore = convertFromReg(listInt, item.Value.size, item.Value.tipoMem);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (item.Value.tipoMem == plcDataType.String)
|
||||||
|
{
|
||||||
|
saveValueString(ref outVal, valString, item.Key);
|
||||||
|
lgDebug($"getDataDictionary: valore ricevuto | {item.Key} | val: {valString}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// verifica limite... con delta da impianto
|
// verifica limite... con delta da impianto
|
||||||
dataOk = (valore > (item.Value.minVal + deltaVal) && valore < (item.Value.maxVal - deltaVal));
|
dataOk = (valore > (item.Value.minVal + deltaVal) && valore < (item.Value.maxVal - deltaVal));
|
||||||
if (dataOk || disDynDataRangeCheck)
|
if (dataOk || disDynDataRangeCheck)
|
||||||
|
{
|
||||||
|
// verifica valori EPOCH x convertirli in datetime...
|
||||||
|
if (item.Value.unit == "EPOCH")
|
||||||
|
{
|
||||||
|
valString = TimeUtils.epochConvert(valore).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
saveValueString(ref outVal, valString, item.Key);
|
||||||
|
lgDebug($"getDataDictionary: valore EPOCH ricevuto | {item.Key} | val: {valore} | valString: {valString}");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// moltiplico x fattore conversione...
|
// moltiplico x fattore conversione...
|
||||||
valoreScal = valore * item.Value.factor;
|
valoreScal = valore * item.Value.factor;
|
||||||
saveValue(ref outVal, valoreScal, item.Key);
|
saveValue(ref outVal, valoreScal, item.Key);
|
||||||
lgDebug($"getDataDictionary: valore ricevuto | {item.Key} | val: {valore} | valoreScal: {valoreScal}");
|
lgDebug($"getDataDictionary: valore ricevuto | {item.Key} | val: {valore} | valoreScal: {valoreScal}");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lgError($"getDataDictionary: valore scartato x limiti min/max | {item.Key} | val: {valore} | valoreScal: {valoreScal} | min-max: {item.Value.minVal}-{item.Value.maxVal} | deltaVal: {deltaVal}");
|
lgError($"getDataDictionary: valore scartato x limiti min/max | {item.Key} | val: {valore} | valoreScal: {valoreScal} | min-max: {item.Value.minVal}-{item.Value.maxVal} | deltaVal: {deltaVal}");
|
||||||
@@ -1381,6 +1484,7 @@ namespace IOB_WIN_NEXT
|
|||||||
lgDebug($"--> rimesso in coda lettura | parametro: {item.Key} | index: {item.Value.index} | size: {item.Value.size}");
|
lgDebug($"--> rimesso in coda lettura | parametro: {item.Key} | index: {item.Value.index} | size: {item.Value.size}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return readErrorList;
|
return readErrorList;
|
||||||
}
|
}
|
||||||
@@ -1419,7 +1523,7 @@ namespace IOB_WIN_NEXT
|
|||||||
/// Effettua lettura blocco memoria indicato e lo salva in copia locale HoldingRegisterLUT
|
/// Effettua lettura blocco memoria indicato e lo salva in copia locale HoldingRegisterLUT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="startAddr">Indirizzo di partenza</param>
|
/// <param name="startAddr">Indirizzo di partenza</param>
|
||||||
/// <param name="numReg">NUm registri da leggere (max 120)</param>
|
/// <param name="numReg">Num registri da leggere (max 120)</param>
|
||||||
private void readBlockHoldingReg(int startAddr, int numReg, int baseAddr)
|
private void readBlockHoldingReg(int startAddr, int numReg, int baseAddr)
|
||||||
{
|
{
|
||||||
bool allOk = false;
|
bool allOk = false;
|
||||||
@@ -1441,6 +1545,7 @@ namespace IOB_WIN_NEXT
|
|||||||
rawData = currPLC.ReadHoldingRegisters(startAddr - baseAddr, numReg);
|
rawData = currPLC.ReadHoldingRegisters(startAddr - baseAddr, numReg);
|
||||||
stopwatch.Stop();
|
stopwatch.Stop();
|
||||||
lgTrace($"Lettura in blocco HoldingRegisters| startAddr: {startAddr} | numReg {numReg} | rawData.lenght: {rawData.Length} | {stopwatch.ElapsedMilliseconds}ms");
|
lgTrace($"Lettura in blocco HoldingRegisters| startAddr: {startAddr} | numReg {numReg} | rawData.lenght: {rawData.Length} | {stopwatch.ElapsedMilliseconds}ms");
|
||||||
|
lastReadPLC = DateTime.Now;
|
||||||
// salvo in LUT la versione ESPLOSA 2 byte alla volta...
|
// salvo in LUT la versione ESPLOSA 2 byte alla volta...
|
||||||
if (rawData.Length > 0)
|
if (rawData.Length > 0)
|
||||||
{
|
{
|
||||||
@@ -1474,7 +1579,7 @@ namespace IOB_WIN_NEXT
|
|||||||
{
|
{
|
||||||
currReadErrors++;
|
currReadErrors++;
|
||||||
allOk = false;
|
allOk = false;
|
||||||
lgError($"Eccezione in readBlockHoldingReg | currReadErrors: {currReadErrors}{Environment.NewLine}{exc}");
|
lgError($"Eccezione in readBlockHoldingReg | startAddr: {startAddr} | baseAddr: {baseAddr} | numReg: {numReg} | currReadErrors: {currReadErrors} |{Environment.NewLine}{exc}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -222,5 +222,6 @@ namespace IOB_WIN_NEXT
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion Protected Methods
|
#endregion Protected Methods
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1114,7 +1114,9 @@ namespace IOB_WIN_NEXT
|
|||||||
await application.CheckApplicationInstanceCertificate(silent: false, minimumKeySize: 0).ConfigureAwait(false);
|
await application.CheckApplicationInstanceCertificate(silent: false, minimumKeySize: 0).ConfigureAwait(false);
|
||||||
|
|
||||||
lgInfo($"Chiamata UAClient con configurazione standard: {application.ApplicationConfiguration.ApplicationName}");
|
lgInfo($"Chiamata UAClient con configurazione standard: {application.ApplicationConfiguration.ApplicationName}");
|
||||||
UA_ref = new UAClient(application.ApplicationConfiguration, cIobConf.codIOB, opcUaParams.Identity.UserName, opcUaParams.Identity.Passwd, isVerboseLog, ClientBase.ValidateResponse);
|
string userName = opcUaParams == null || opcUaParams.Identity == null ? "" : opcUaParams.Identity.UserName;
|
||||||
|
string passwd = opcUaParams == null || opcUaParams.Identity == null ? "" : opcUaParams.Identity.Passwd;
|
||||||
|
UA_ref = new UAClient(application.ApplicationConfiguration, cIobConf.codIOB, userName, passwd, isVerboseLog, ClientBase.ValidateResponse);
|
||||||
|
|
||||||
lgInfo($"Chiamata apertura OpcUa Client: {cIobConf.cncIpAddr}:{port}");
|
lgInfo($"Chiamata apertura OpcUa Client: {cIobConf.cncIpAddr}:{port}");
|
||||||
UA_ref.ServerUrl = $"opc.tcp://{cIobConf.cncIpAddr}:{port}";
|
UA_ref.ServerUrl = $"opc.tcp://{cIobConf.cncIpAddr}:{port}";
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace IOB_WIN_NEXT
|
|||||||
protected override void plcWriteParams(ref List<objItem> updatedPar)
|
protected override void plcWriteParams(ref List<objItem> updatedPar)
|
||||||
{
|
{
|
||||||
base.plcWriteParams(ref updatedPar);
|
base.plcWriteParams(ref updatedPar);
|
||||||
|
#if false
|
||||||
// se DEVO gestire setup Mecolpress...
|
// se DEVO gestire setup Mecolpress...
|
||||||
if (opcUaParams.SetupConf.SetupMode == IOB_UT_NEXT.MachineSetupMode.MECOLPRESS)
|
if (opcUaParams.SetupConf.SetupMode == IOB_UT_NEXT.MachineSetupMode.MECOLPRESS)
|
||||||
{
|
{
|
||||||
@@ -99,6 +99,7 @@ namespace IOB_WIN_NEXT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
|
|||||||
@@ -0,0 +1,369 @@
|
|||||||
|
using MapoSDK;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Opc.Ua;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
|
|
||||||
|
namespace IOB_WIN_NEXT
|
||||||
|
{
|
||||||
|
public class IobOpcUaSiemens : IobOpcUa
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Estende l'init della classe base, impiegando il pacchetto Nuget OPC-UA foundation con la
|
||||||
|
/// gestione specifica per Siemens OPC-UA (es OPC, Cereria Finassi) https://github.com/OPCFoundation/UA-.NETStandard
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="caller"></param>
|
||||||
|
/// <param name="IOBConf"></param>
|
||||||
|
public IobOpcUaSiemens(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
|
||||||
|
{
|
||||||
|
lgInfo("Init OpcUa Siemens");
|
||||||
|
// inizializzo classe base...
|
||||||
|
if (!string.IsNullOrEmpty(getOptPar("CHANGE_ODL_MODE")))
|
||||||
|
{
|
||||||
|
CHANGE_ODL_MODE = getOptPar("CHANGE_ODL_MODE");
|
||||||
|
}
|
||||||
|
sendKeyRichiesta = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Processo i task richiesti e li elimino dalla coda 1:1
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="task2exe"></param>
|
||||||
|
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
|
||||||
|
{
|
||||||
|
// uso metodo base x ora
|
||||||
|
return base.executeTasks(task2exe);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua vero processing contapezzi
|
||||||
|
/// </summary>
|
||||||
|
public override void processContapezzi()
|
||||||
|
{
|
||||||
|
if (utils.CRB("enableContapezzi"))
|
||||||
|
{
|
||||||
|
// check condizione validazione
|
||||||
|
if (checkMultiCondition(opcUaParams.condCountEnabled) || opcUaParams.condCountEnabled.checkList.Count == 0)
|
||||||
|
{
|
||||||
|
// cerco parametro contapezzi...
|
||||||
|
string currPzCount = getDataItemValue(opcUaParams.keyPartCount);
|
||||||
|
|
||||||
|
// se ho un contapezzi... processo...
|
||||||
|
if (!string.IsNullOrEmpty(currPzCount))
|
||||||
|
{
|
||||||
|
int newVal = -1;
|
||||||
|
bool fatto = Int32.TryParse(currPzCount, out newVal);
|
||||||
|
|
||||||
|
if (fatto)
|
||||||
|
{
|
||||||
|
// gestione decremento contapezzi: viene "messo via" solo SE c'è un
|
||||||
|
// effettivo decremento contapezzi...
|
||||||
|
if (newVal < contapezziPLC)
|
||||||
|
{
|
||||||
|
pzCountResetted = true;
|
||||||
|
// incremento contatore richiesta
|
||||||
|
countKeyRichiesta = countKeyRichiesta + 1;
|
||||||
|
// log
|
||||||
|
lgInfo("Contapezzi resettato (PLC) --> pzCountResetted = true");
|
||||||
|
}
|
||||||
|
|
||||||
|
// salvo nuovo valore contapezziPLC
|
||||||
|
contapezziPLC = newVal > -1 ? newVal : contapezziPLC;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lgError($"Errore in decodifica valore contapezzi, valore rilevato: {currPzCount}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lgError("Errore in decodifica valore contapezzi, valore vuoto!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CHANGE_ODL_MODE == "PZCOUNT_RESET")
|
||||||
|
{
|
||||||
|
// controllo comunque, se è ZERO il contapezzi, e sul server è maggiore il
|
||||||
|
// valore x ODL e NON abilitato il trigger reset --> abilito trigger...
|
||||||
|
if (!pzCountResetted && contapezziPLC == 0 && contapezziIOB > 0)
|
||||||
|
{
|
||||||
|
pzCountResetted = true;
|
||||||
|
// incremento contatore richiesta
|
||||||
|
countKeyRichiesta = countKeyRichiesta + 1;
|
||||||
|
// log
|
||||||
|
lgInfo("Contapezzi resettato (PLC==0 e IOB>PLC) --> pzCountResetted = true");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua reset del contapezzi, NON POSSIBILE in questa versione
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override bool resetcontapezziPLC()
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua IMPOSTAZIONE FORZATA del contapezzi, NON POSSIBILE in questa versione
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override bool setcontapezziPLC(int newPzCount)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Protected Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Modalità cambio ODL
|
||||||
|
/// </summary>
|
||||||
|
protected string CHANGE_ODL_MODE = "";
|
||||||
|
|
||||||
|
protected bool testDone = false;
|
||||||
|
|
||||||
|
#endregion Protected Fields
|
||||||
|
|
||||||
|
#region Protected Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
|
||||||
|
/// </summary>
|
||||||
|
protected override void decodeToBaseBitmap()
|
||||||
|
{
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
// init a zero...
|
||||||
|
B_input = 0;
|
||||||
|
|
||||||
|
/* -----------------------------------------------------
|
||||||
|
* STATE MACHINE 60 STD / SIMULA
|
||||||
|
*------------------------------------------------------
|
||||||
|
* bitmap MAPO
|
||||||
|
* B0: POWER_ON
|
||||||
|
* B1: RUN
|
||||||
|
* B2: pzCount
|
||||||
|
* B3: allarme
|
||||||
|
* B4: manuale
|
||||||
|
* B5: SlowTC (NON gestito qui)
|
||||||
|
* B6: warm-up / cool-down / setup
|
||||||
|
* B7: emergenza ARMATA (1=ok, 0 = premuta)
|
||||||
|
---------------------------------------------------- */
|
||||||
|
|
||||||
|
// se valido il check ping lo eseguo... altrimenti lo do x buono
|
||||||
|
bool checkPing = !opcUaParams.pingAsPowerOn;
|
||||||
|
string currRun = "N.A.";
|
||||||
|
if (!checkPing)
|
||||||
|
{
|
||||||
|
checkPing = (testPingMachine == IPStatus.Success);
|
||||||
|
}
|
||||||
|
// bit 0 (poweron) imposto a 1 SE pingo + PowerOn=="ON"...
|
||||||
|
bool powerOnOk = checkPing && hasPowerOn;
|
||||||
|
// procedo SOLO SE mi da ping OK...
|
||||||
|
if (checkPing)
|
||||||
|
{
|
||||||
|
B_input = powerOnOk ? 1 : 0;
|
||||||
|
|
||||||
|
// variabili RUN...
|
||||||
|
if (!string.IsNullOrEmpty(opcUaParams.keyRunMode))
|
||||||
|
{
|
||||||
|
currRun = getDataItemValue(opcUaParams.keyRunMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
// salvo running come = working...
|
||||||
|
isRunning = isWorking;
|
||||||
|
|
||||||
|
// se ho emergenza premuta --> emergenza!
|
||||||
|
if (hasEStopArmed)
|
||||||
|
{
|
||||||
|
B_input += (1 << 7);
|
||||||
|
}
|
||||||
|
// se ho emergenza premuta --> emergenza!
|
||||||
|
if (isWarmUpCoolDown)
|
||||||
|
{
|
||||||
|
B_input += (1 << 6);
|
||||||
|
}
|
||||||
|
// se ho almeno 1 allarme E NON SONO IN AUTO --> ALARM!
|
||||||
|
if (hasError)
|
||||||
|
{
|
||||||
|
B_input += (1 << 3);
|
||||||
|
}
|
||||||
|
if (isWorking)
|
||||||
|
{
|
||||||
|
// RUN = LAVORA!
|
||||||
|
B_input += (1 << 1);
|
||||||
|
}
|
||||||
|
else if (powerOnOk && (!isReady || isManual))
|
||||||
|
{
|
||||||
|
// se NON ready --> manual
|
||||||
|
B_input += (1 << 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// se abilitato watchdog...
|
||||||
|
if (opcUaParams.WatchDog.IsEnabled)
|
||||||
|
{
|
||||||
|
if (adesso.Subtract(lastWatchDogPLC).TotalSeconds > 2)
|
||||||
|
{
|
||||||
|
lastWatchDogPLC = adesso;
|
||||||
|
WatchDog++;
|
||||||
|
WatchDog = WatchDog > opcUaParams.WatchDog.MaxVal ? 0 : WatchDog;
|
||||||
|
|
||||||
|
lgTrace($"WatchDog val: {WatchDog}");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WriteValue commWriteVal = new WriteValue();
|
||||||
|
commWriteVal.NodeId = new NodeId(opcUaParams.WatchDog.MemConfWrite);
|
||||||
|
commWriteVal.AttributeId = Attributes.Value;
|
||||||
|
commWriteVal.Value = new DataValue();
|
||||||
|
commWriteVal.Value.Value = WatchDog;
|
||||||
|
|
||||||
|
List<WriteValue> nodes2Write = new List<WriteValue>();
|
||||||
|
nodes2Write.Add(commWriteVal);
|
||||||
|
|
||||||
|
UA_ref.WriteNodes(nodes2Write);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
lgError($"Eccezione in gestione WatchDog, valore attuale {WatchDog}{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lgTrace("WatchDog disabilitato");
|
||||||
|
}
|
||||||
|
|
||||||
|
// controllo se sono poweroff e se non ho dati buoni da > 2 minuti --> disconnetto
|
||||||
|
if (!powerOnOk && adesso.Subtract(lastCurrent).TotalMinutes > 2)
|
||||||
|
{
|
||||||
|
tryDisconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
// solo se non ho veto check
|
||||||
|
int vFactor = 2;
|
||||||
|
if (vetoCheckStatus < adesso)
|
||||||
|
{
|
||||||
|
lgDebug($"Stato variabili checkPing: {testPingMachine}");
|
||||||
|
// imposto veto per vetoSeconds...
|
||||||
|
vetoCheckStatus = adesso.AddSeconds(vetoSeconds * vFactor);
|
||||||
|
}
|
||||||
|
|
||||||
|
// log opzionale!
|
||||||
|
if (verboseLog)
|
||||||
|
{
|
||||||
|
lgDebug($"Trasformazione checkPing: {checkPing} | hasPowerOn: {hasPowerOn} | B_input: {B_input} | currRun = {currRun}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua vera scrittura parametri
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updatedPar"></param>
|
||||||
|
protected override void plcWriteParams(ref List<objItem> updatedPar)
|
||||||
|
{
|
||||||
|
dataConf currMem = null;
|
||||||
|
int byteSize = 0;
|
||||||
|
string memAddrWrite = "";
|
||||||
|
string serObj = "";
|
||||||
|
if (updatedPar != null)
|
||||||
|
{
|
||||||
|
List<WriteValue> nodes2Write = new List<WriteValue>();
|
||||||
|
// controllo i parametri... ne gestisco 4...
|
||||||
|
foreach (var item in updatedPar)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
memAddrWrite = "";
|
||||||
|
int valInt = 0;
|
||||||
|
double valReal = 0;
|
||||||
|
// cerco in area memMapWrite...
|
||||||
|
if (memMap.mMapWrite.ContainsKey(item.uid))
|
||||||
|
{
|
||||||
|
// recupero!
|
||||||
|
currMem = memMap.mMapWrite[item.uid];
|
||||||
|
byteSize = currMem.size;
|
||||||
|
memAddrWrite = currMem.memAddr;
|
||||||
|
|
||||||
|
WriteValue commWriteVal = new WriteValue();
|
||||||
|
commWriteVal.NodeId = new NodeId(currMem.memAddr);
|
||||||
|
commWriteVal.AttributeId = Attributes.Value;
|
||||||
|
commWriteVal.Value = new DataValue();
|
||||||
|
commWriteVal.Value.Value = item.reqValue;
|
||||||
|
|
||||||
|
// faccio preliminarmente upsertKey...
|
||||||
|
upsertKey(currMem.name, currMem.value);
|
||||||
|
serObj = JsonConvert.SerializeObject(item);
|
||||||
|
lgInfo($"Inizio processing plcWriteParams per {currMem.name} | valore richiesto {currMem.value}");
|
||||||
|
lgInfo($"---------------{Environment.NewLine}UPDATED PARAM:{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
|
||||||
|
serObj = JsonConvert.SerializeObject(currMem);
|
||||||
|
lgInfo($"---------------{Environment.NewLine}MEMORY CONTENT:{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
|
||||||
|
|
||||||
|
switch (currMem.tipoMem)
|
||||||
|
{
|
||||||
|
case plcDataType.Boolean:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case plcDataType.Int:
|
||||||
|
case plcDataType.DInt:
|
||||||
|
case plcDataType.Word:
|
||||||
|
case plcDataType.DWord:
|
||||||
|
int.TryParse(item.reqValue, out valInt);
|
||||||
|
commWriteVal.Value.Value = valInt;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case plcDataType.Real:
|
||||||
|
double.TryParse(item.reqValue, out valReal);
|
||||||
|
commWriteVal.Value.Value = valReal;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case plcDataType.String:
|
||||||
|
commWriteVal.Value.Value = item.reqValue;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
lgInfo($"---------------{Environment.NewLine}OPC-UA data:{Environment.NewLine}NodeId: {commWriteVal.NodeId}{Environment.NewLine}Value: {commWriteVal.Value.Value}{Environment.NewLine}---------------");
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(memAddrWrite))
|
||||||
|
{
|
||||||
|
nodes2Write.Add(commWriteVal);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lgInfo($"Errore: memAddrWrite vuoto!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lgInfo($"Errore uid non trovato in area write memory: {item.uid}, ci sono {memMap.mMapWrite.Count} in area write");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
lgError($"Eccezione in fase di plcWriteParams per item {item.uid} con valore {item.value}{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nodes2Write.Count > 0)
|
||||||
|
{
|
||||||
|
UA_ref.WriteNodes(nodes2Write);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Protected Methods
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
using MapoSDK;
|
||||||
|
using Opc.Ua;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace IOB_WIN_NEXT
|
||||||
|
{
|
||||||
|
public class IobOpcUaSiemensOMP : IobOpcUaSiemens
|
||||||
|
{
|
||||||
|
#region Public Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Estende l'init della classe base, impiegando il pacchetto Nuget OPC-UA foundation con la
|
||||||
|
/// gestione specifica per EWON (es Monti, Tenditalia) https://github.com/OPCFoundation/UA-.NETStandard
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="caller"></param>
|
||||||
|
/// <param name="IOBConf"></param>
|
||||||
|
public IobOpcUaSiemensOMP(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
|
||||||
|
{
|
||||||
|
lgInfo("Init OpcUa Siemens versione OMP (Cereria Finassi)");
|
||||||
|
|
||||||
|
// inizializzo classe base...
|
||||||
|
if (!string.IsNullOrEmpty(getOptPar("CHANGE_ODL_MODE")))
|
||||||
|
{
|
||||||
|
CHANGE_ODL_MODE = getOptPar("CHANGE_ODL_MODE");
|
||||||
|
}
|
||||||
|
sendKeyRichiesta = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Constructors
|
||||||
|
|
||||||
|
#region Public Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Processo i task richiesti e li elimino dalla coda 1:1
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="task2exe"></param>
|
||||||
|
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
|
||||||
|
{
|
||||||
|
// uso metodo base x salvare esito scrittura
|
||||||
|
var writeResult = base.executeTasks(task2exe);
|
||||||
|
|
||||||
|
// aggiungo comportamento custom: se ho impostato nome ricetta (programma) --> imposto
|
||||||
|
// richiesta caricamento se ho richiesto reset o fine lavoro --> imposto azzeramento
|
||||||
|
// esco restituendo risutlato scrittura iniziali
|
||||||
|
if (task2exe != null)
|
||||||
|
{
|
||||||
|
// controllo se memMap != null...
|
||||||
|
if (memMap != null)
|
||||||
|
{
|
||||||
|
bool taskOk = false;
|
||||||
|
string taskVal = "";
|
||||||
|
// cerco task specifici x OMP
|
||||||
|
foreach (var item in task2exe)
|
||||||
|
{
|
||||||
|
taskOk = false;
|
||||||
|
taskVal = "";
|
||||||
|
// converto richiesta in enum...
|
||||||
|
taskType tName = taskType.nihil;
|
||||||
|
Enum.TryParse(item.Key, out tName);
|
||||||
|
// controllo sulla KEY...
|
||||||
|
switch (tName)
|
||||||
|
{
|
||||||
|
case taskType.setProg:
|
||||||
|
// recupero dati da memMap...
|
||||||
|
if (memMap != null && memMap.mMapWrite != null)
|
||||||
|
{
|
||||||
|
if (memMap.mMapWrite.ContainsKey(item.Key))
|
||||||
|
{
|
||||||
|
dataConf currMem = memMap.mMapWrite[item.Key];
|
||||||
|
string addr = currMem.memAddr;
|
||||||
|
taskVal = $"SET task: {item.Key} --> {item.Value} | mem: {currMem.memAddr} - {currMem.size} byte";
|
||||||
|
// salvo il nuovo valore nella memoria... così prox invio lo trasmetterà
|
||||||
|
memMap.mMapWrite[item.Key].value = item.Value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
taskVal = $"NO DATA MEM, SET task: {item.Key} --> {item.Value}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
taskVal = $"NO MemMap found, SET task: {item.Key} --> {item.Value}";
|
||||||
|
}
|
||||||
|
// salvo in currProd..
|
||||||
|
saveProdData(new KeyValuePair<string, string>(item.Key, item.Value));
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case taskType.startSetup:
|
||||||
|
setFineLotto();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case taskType.stopSetup:
|
||||||
|
setInizioProd();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | SKIPPED | NO EXEC";
|
||||||
|
lgInfo($"Chiamata senza processing: taskOk: {taskOk} | taskVal: {taskVal}");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lgError($"Attenzione! memMap è nullo, non posso eseguire task2exe!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return writeResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool resetcontapezziPLC()
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<WriteValue> nodes2Write = new List<WriteValue>();
|
||||||
|
foreach (var item in opcUaParams.actResetCounter)
|
||||||
|
{
|
||||||
|
WriteValue commWriteVal = new WriteValue();
|
||||||
|
commWriteVal.NodeId = new NodeId(item.Key);
|
||||||
|
commWriteVal.AttributeId = Attributes.Value;
|
||||||
|
commWriteVal.Value = new DataValue();
|
||||||
|
commWriteVal.Value.Value = item.Value;
|
||||||
|
|
||||||
|
nodes2Write.Add(commWriteVal);
|
||||||
|
}
|
||||||
|
// vera scrittura
|
||||||
|
UA_ref.WriteNodes(nodes2Write);
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Private Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Azioni specifiche x indicare fine lotto di produzione
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private bool setFineLotto()
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<WriteValue> nodes2Write = new List<WriteValue>();
|
||||||
|
foreach (var item in opcUaParams.actStopProd)
|
||||||
|
{
|
||||||
|
WriteValue commWriteVal = new WriteValue();
|
||||||
|
commWriteVal.NodeId = new NodeId(item.Key);
|
||||||
|
commWriteVal.AttributeId = Attributes.Value;
|
||||||
|
commWriteVal.Value = new DataValue();
|
||||||
|
commWriteVal.Value.Value = item.Value;
|
||||||
|
|
||||||
|
nodes2Write.Add(commWriteVal);
|
||||||
|
}
|
||||||
|
// vera scrittura
|
||||||
|
UA_ref.WriteNodes(nodes2Write);
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Azioni specifiche x iniziare produzione (impostazione ricetta)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
private bool setInizioProd()
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<WriteValue> nodes2Write = new List<WriteValue>();
|
||||||
|
foreach (var item in opcUaParams.actSetRecipe)
|
||||||
|
{
|
||||||
|
WriteValue commWriteVal = new WriteValue();
|
||||||
|
commWriteVal.NodeId = new NodeId(item.Key);
|
||||||
|
commWriteVal.AttributeId = Attributes.Value;
|
||||||
|
commWriteVal.Value = new DataValue();
|
||||||
|
commWriteVal.Value.Value = item.Value;
|
||||||
|
|
||||||
|
nodes2Write.Add(commWriteVal);
|
||||||
|
}
|
||||||
|
// vera scrittura
|
||||||
|
UA_ref.WriteNodes(nodes2Write);
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Private Methods
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -80,12 +80,12 @@ namespace IOB_WIN_NEXT
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
currDispData.semIn = Semaforo.SV;
|
currDispData.semIn = Semaforo.SV;
|
||||||
|
// in primis salvo data ping comunque...
|
||||||
|
lastPING = DateTime.Now;
|
||||||
|
|
||||||
// se passa il ping faccio il resto...
|
// se passa il ping faccio il resto...
|
||||||
if (testPingMachine == IPStatus.Success)
|
if (testPingMachine == IPStatus.Success)
|
||||||
{
|
{
|
||||||
// in primis salvo data ping...
|
|
||||||
lastPING = DateTime.Now;
|
|
||||||
connectionOk = true;
|
connectionOk = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+469
-457
@@ -8,112 +8,6 @@ namespace IOB_WIN_NEXT
|
|||||||
{
|
{
|
||||||
public class IobSimula : IobGeneric
|
public class IobSimula : IobGeneric
|
||||||
{
|
{
|
||||||
#region Protected Fields
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Parametri simulazione oscillazione bit 2
|
|
||||||
/// </summary>
|
|
||||||
protected simPar bit2;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Parametri simulazione oscillazione bit 3
|
|
||||||
/// </summary>
|
|
||||||
protected simPar bit3;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Parametri simulazione oscillazione bit 4
|
|
||||||
/// </summary>
|
|
||||||
protected simPar bit4;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Parametri simulazione oscillazione bit 5
|
|
||||||
/// </summary>
|
|
||||||
protected simPar bit5;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Parametri simulazione oscillazione bit 6
|
|
||||||
/// </summary>
|
|
||||||
protected simPar bit6;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Parametri simulazione oscillazione bit 7
|
|
||||||
/// </summary>
|
|
||||||
protected simPar bit7;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// pallet corrente
|
|
||||||
/// </summary>
|
|
||||||
protected int cP = 1;
|
|
||||||
|
|
||||||
protected bool disableSimStatus = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ultimo controllo decremento eventi
|
|
||||||
/// </summary>
|
|
||||||
protected DateTime lastEvCheck;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Ultimo istante in cui sono stati generati dati di simulazione
|
|
||||||
/// </summary>
|
|
||||||
protected DateTime lastSimData;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Ultimo istante in cui sono stati ridotti dati simulazione duration
|
|
||||||
/// </summary>
|
|
||||||
protected DateTime lastRedDuration;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Matricola OPR simulato
|
|
||||||
/// </summary>
|
|
||||||
protected int matrOpr = 1;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Durata minima ODL x reset quando pezzi iob > pezzi macchina...
|
|
||||||
/// </summary>
|
|
||||||
protected int minDurataODL = 480;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// pallet successivo (next)
|
|
||||||
/// </summary>
|
|
||||||
protected int nP = 1;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// periodo base del simulatore (in millisecondi)
|
|
||||||
/// </summary>
|
|
||||||
protected int periodoMSec = 1000;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// variabile di appoggio x stato segnale contapezzo
|
|
||||||
/// </summary>
|
|
||||||
protected bool sigPzCount = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Simulazione registrazione dichiarazioni utente
|
|
||||||
/// </summary>
|
|
||||||
protected simPar simDich;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// BOOL: indica se simulare powerOn/Off (bit 0 e 1) compresi WarmUp e CoolDown
|
|
||||||
/// </summary>
|
|
||||||
protected bool simPowerOnOff;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Simulazione effettuazione controlli utente
|
|
||||||
/// </summary>
|
|
||||||
protected simPar simRC;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Simulazione registro scarti utente
|
|
||||||
/// </summary>
|
|
||||||
protected simPar simRS;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Tempo di MINIMO attesa x simulazione parametri
|
|
||||||
/// </summary>
|
|
||||||
protected int waitSimPar = utils.CRI("waitSimPar");
|
|
||||||
|
|
||||||
#endregion Protected Fields
|
|
||||||
|
|
||||||
#region Public Fields
|
#region Public Fields
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -200,18 +94,454 @@ namespace IOB_WIN_NEXT
|
|||||||
|
|
||||||
#endregion Public Constructors
|
#endregion Public Constructors
|
||||||
|
|
||||||
#region Private Methods
|
#region Public Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Decodifica il resto dell'area x i dati accessori (allarmi, ...)
|
/// Processo i task richiesti e li elimino dalla coda 1:1 (in realtà SOLO forceSetPzCount x ora)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void decodeOtherData()
|
/// <param name="task2exe"></param>
|
||||||
|
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
|
||||||
|
{
|
||||||
|
// Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti...
|
||||||
|
Dictionary<string, string> taskDone = new Dictionary<string, string>();
|
||||||
|
// controlo SE sia disabilitata simulazione principale
|
||||||
|
if (!disableSimStatus)
|
||||||
|
{
|
||||||
|
string taskVal = "";
|
||||||
|
// verifico non sia null
|
||||||
|
if (task2exe != null)
|
||||||
|
{
|
||||||
|
// cerco task specifici
|
||||||
|
foreach (var item in task2exe)
|
||||||
|
{
|
||||||
|
taskVal = "";
|
||||||
|
// converto richiesta in enum...
|
||||||
|
taskType tName = taskType.nihil;
|
||||||
|
Enum.TryParse(item.Key, out tName);
|
||||||
|
// controllo sulla KEY
|
||||||
|
switch (tName)
|
||||||
|
{
|
||||||
|
case taskType.setArt:
|
||||||
|
case taskType.setComm:
|
||||||
|
case taskType.setProg:
|
||||||
|
case taskType.setPzComm:
|
||||||
|
memMap.mMapWrite[item.Key].value = item.Value;
|
||||||
|
taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | UPDATED memMap.mMapWrite";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case taskType.setParameter:
|
||||||
|
// richiedo da URL i parametri WRITE da popolare
|
||||||
|
lgInfo("Chiamata processMemWriteRequests");
|
||||||
|
taskVal = processMemWriteRequests();
|
||||||
|
// se restituiscce "" faccio altra prova...
|
||||||
|
if (string.IsNullOrEmpty(taskVal))
|
||||||
|
{
|
||||||
|
// i parametri me li aspetto come stringa composta paramName|paramvalue
|
||||||
|
if (item.Value.Contains("|"))
|
||||||
|
{
|
||||||
|
string[] paramsJob = item.Value.Split('|');
|
||||||
|
taskVal = $"REQUEST SET PARAMETERS: {paramsJob[0]} --> {paramsJob[1]}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
taskVal = $"WRONG REQUEST FOR SET PARAMETERS: {item.Value} doesnt contain pipe for splitting key/value";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case taskType.nihil:
|
||||||
|
case taskType.fixStopSetup:
|
||||||
|
case taskType.forceResetPzCount:
|
||||||
|
case taskType.sendWatchDogMes2Plc:
|
||||||
|
case taskType.startSetup:
|
||||||
|
case taskType.stopSetup:
|
||||||
|
taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | SKIPPED | NO EXEC";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case taskType.forceSetPzCount:
|
||||||
|
// forzo sul SIM il valore pzCount dell'IOB...
|
||||||
|
int newPzCount = contapezziPLC;
|
||||||
|
bool fatto = int.TryParse(item.Value, out newPzCount);
|
||||||
|
if (fatto)
|
||||||
|
{
|
||||||
|
// verifico SE sia ammesso il cambio ...
|
||||||
|
int deltaPzCount = newPzCount - contapezziPLC;
|
||||||
|
double maxDelta = DateTime.Now.Subtract(plcLastPzRead).TotalMinutes / (plcAvgTc / 60);
|
||||||
|
// se incremento superiore del doppio atteso --> segnalo errore
|
||||||
|
// e NON accetto
|
||||||
|
if (deltaPzCount > (maxDelta * maxPzDeltaPerc) / 100)
|
||||||
|
{
|
||||||
|
lgError($"[DELTA CHECK]: intremento contapezziPLC troppo elevato: lettura {newPzCount} | contapezzi attuale: {contapezziPLC} | ultima lettura PLC: {plcLastPzRead} | TCiclo medio: {plcAvgTc}s | incremento accettato ");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
contapezziPLC = newPzCount;
|
||||||
|
taskVal = $"Set new contapezziPLC: {contapezziPLC}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
taskVal = "SKIPPED | NO EXEC";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// aggiungo task!
|
||||||
|
taskDone.Add(item.Key, taskVal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return taskDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupera e processa allarmi CNC...
|
||||||
|
/// </summary>
|
||||||
|
public override Dictionary<string, string> getCncAlarms()
|
||||||
|
{
|
||||||
|
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
||||||
|
return outVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero dati dinamici...
|
||||||
|
/// </summary>
|
||||||
|
public override Dictionary<string, string> getDynData()
|
||||||
|
{
|
||||||
|
// valore non presente in vers default... se gestito fare override
|
||||||
|
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
||||||
|
// verificare periodo SIM parametri... se passato li invio altrimenti NO... FIX a 20 sec
|
||||||
|
if (lastSimData.AddSeconds(waitSimPar) < DateTime.Now)
|
||||||
|
{
|
||||||
|
Random rnd = new Random();
|
||||||
|
// controllo conf memorie json (se ci sono...)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (memMap.mMapWrite.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in memMap.mMapWrite)
|
||||||
|
{
|
||||||
|
outVal.Add(item.Key, item.Value.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (memMap.mMapRead.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var item in memMap.mMapRead)
|
||||||
|
{
|
||||||
|
// se il TIPO di valore è livello --> simulo variazione da MAX --> min,
|
||||||
|
// con un delta in CALO pari a factor * (80-120)%
|
||||||
|
if (item.Value.name == "SIM_LEVEL")
|
||||||
|
{
|
||||||
|
// verifico last value
|
||||||
|
float lastVal = 0;
|
||||||
|
float.TryParse(item.Value.value, out lastVal);
|
||||||
|
if (lastVal == 0)
|
||||||
|
{
|
||||||
|
lastVal = item.Value.maxVal - (float)item.Value.factor;
|
||||||
|
}
|
||||||
|
// decremento casuale...
|
||||||
|
float newVal = lastVal - ((float)item.Value.factor * rnd.Next(40, 120) / 100);
|
||||||
|
// se inferiore a minimo --> massimo!
|
||||||
|
if (newVal < item.Value.minVal)
|
||||||
|
{
|
||||||
|
newVal = item.Value.maxVal;
|
||||||
|
}
|
||||||
|
// salvo il suo VALUE...
|
||||||
|
item.Value.value = $"{newVal}";
|
||||||
|
outVal.Add(item.Key, $"{newVal}");
|
||||||
|
}
|
||||||
|
// altrimenti siulazione random walk...
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (item.Value.factor == 1)
|
||||||
|
{
|
||||||
|
// uso factor come valore MAX ammesso
|
||||||
|
int randVal = rnd.Next(item.Value.minVal, item.Value.maxVal);
|
||||||
|
outVal.Add(item.Key, randVal.ToString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// uso factor come fattore di divisione x simulare decimali
|
||||||
|
float randVal = ((float)rnd.Next(item.Value.minVal, item.Value.maxVal)) / (float)item.Value.factor;
|
||||||
|
outVal.Add(item.Key, randVal.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
lastSimData = DateTime.Now;
|
||||||
|
}
|
||||||
|
return outVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Recupero programma in lavorazione
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override string getPrgName()
|
||||||
|
{
|
||||||
|
// NOME DEL SIM!
|
||||||
|
string prgName = $"PROG_{cIobConf.codIOB}";
|
||||||
|
return prgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary> Recupero info sistema generiche <returns></returns>
|
||||||
|
public override Dictionary<string, string> getSysInfo()
|
||||||
|
{
|
||||||
|
// valore non presente in vers default... se gestito fare override
|
||||||
|
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
||||||
|
outVal.Add("MACHINE", "IOB_SIM");
|
||||||
|
return outVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua vero processing contapezzi
|
||||||
|
/// </summary>
|
||||||
|
public override void processContapezzi()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private Random rnd = new Random();
|
/// <summary>
|
||||||
private int currSimAlarmCode = 0;
|
/// Processo contatori eventi...
|
||||||
private List<string> alarmMessages = new List<string>();
|
/// </summary>
|
||||||
|
public override void processVHF()
|
||||||
|
{
|
||||||
|
if (lastEvCheck.AddMilliseconds(periodoMSec) < DateTime.Now)
|
||||||
|
{
|
||||||
|
// decremento contatore ultimo evento
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (bit2 != null)
|
||||||
|
bit2.wait--;
|
||||||
|
|
||||||
|
if (bit3 != null)
|
||||||
|
bit3.wait--;
|
||||||
|
|
||||||
|
if (bit4 != null)
|
||||||
|
bit4.wait--;
|
||||||
|
|
||||||
|
if (bit5 != null)
|
||||||
|
bit5.wait--;
|
||||||
|
|
||||||
|
if (simDich != null)
|
||||||
|
simDich.wait--;
|
||||||
|
|
||||||
|
if (simRC != null)
|
||||||
|
simRC.wait--;
|
||||||
|
|
||||||
|
if (simRS != null)
|
||||||
|
simRS.wait--;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
lastEvCheck = DateTime.Now;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua lettura semafori principale <paramref name="currDispData">Parametri da
|
||||||
|
/// aggiornare x display in form</paramref>
|
||||||
|
/// </summary>
|
||||||
|
public override void readSemafori(ref newDisplayData currDispData)
|
||||||
|
{
|
||||||
|
base.readSemafori(ref currDispData);
|
||||||
|
|
||||||
|
// controlo SE sia disabilitata simulazione principale
|
||||||
|
if (!disableSimStatus)
|
||||||
|
{
|
||||||
|
// decodifica e gestione
|
||||||
|
decodeToBaseBitmap();
|
||||||
|
decodeOtherData();
|
||||||
|
reportRawInput(ref currDispData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Effettua reset del contapezzi
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public override bool resetcontapezziPLC()
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// ...SE abilitato da conf IOB
|
||||||
|
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET") == "TRUE")
|
||||||
|
{
|
||||||
|
// fingo di aver fatto...
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void tryConnect()
|
||||||
|
{
|
||||||
|
base.tryConnect();
|
||||||
|
connectionOk = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void tryDisconnect()
|
||||||
|
{
|
||||||
|
base.tryDisconnect();
|
||||||
|
connectionOk = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Methods
|
||||||
|
|
||||||
|
#region Protected Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parametri simulazione oscillazione bit 2
|
||||||
|
/// </summary>
|
||||||
|
protected simPar bit2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parametri simulazione oscillazione bit 3
|
||||||
|
/// </summary>
|
||||||
|
protected simPar bit3;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parametri simulazione oscillazione bit 4
|
||||||
|
/// </summary>
|
||||||
|
protected simPar bit4;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parametri simulazione oscillazione bit 5
|
||||||
|
/// </summary>
|
||||||
|
protected simPar bit5;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parametri simulazione oscillazione bit 6
|
||||||
|
/// </summary>
|
||||||
|
protected simPar bit6;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Parametri simulazione oscillazione bit 7
|
||||||
|
/// </summary>
|
||||||
|
protected simPar bit7;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// pallet corrente
|
||||||
|
/// </summary>
|
||||||
|
protected int cP = 1;
|
||||||
|
|
||||||
|
protected bool disableSimStatus = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ultimo controllo decremento eventi
|
||||||
|
/// </summary>
|
||||||
|
protected DateTime lastEvCheck;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ultimo istante in cui sono stati ridotti dati simulazione duration
|
||||||
|
/// </summary>
|
||||||
|
protected DateTime lastRedDuration;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ultimo istante in cui sono stati generati dati di simulazione
|
||||||
|
/// </summary>
|
||||||
|
protected DateTime lastSimData;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Matricola OPR simulato
|
||||||
|
/// </summary>
|
||||||
|
protected int matrOpr = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Durata minima ODL x reset quando pezzi iob > pezzi macchina...
|
||||||
|
/// </summary>
|
||||||
|
protected int minDurataODL = 480;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// pallet successivo (next)
|
||||||
|
/// </summary>
|
||||||
|
protected int nP = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// periodo base del simulatore (in millisecondi)
|
||||||
|
/// </summary>
|
||||||
|
protected int periodoMSec = 1000;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// variabile di appoggio x stato segnale contapezzo
|
||||||
|
/// </summary>
|
||||||
|
protected bool sigPzCount = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Simulazione registrazione dichiarazioni utente
|
||||||
|
/// </summary>
|
||||||
|
protected simPar simDich;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// BOOL: indica se simulare powerOn/Off (bit 0 e 1) compresi WarmUp e CoolDown
|
||||||
|
/// </summary>
|
||||||
|
protected bool simPowerOnOff;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Simulazione effettuazione controlli utente
|
||||||
|
/// </summary>
|
||||||
|
protected simPar simRC;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Simulazione registro scarti utente
|
||||||
|
/// </summary>
|
||||||
|
protected simPar simRS;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tempo di MINIMO attesa x simulazione parametri
|
||||||
|
/// </summary>
|
||||||
|
protected int waitSimPar = utils.CRI("waitSimPar");
|
||||||
|
|
||||||
|
#endregion Protected Fields
|
||||||
|
|
||||||
|
#region Protected Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Salvo valori PLC
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="updatedPar"></param>
|
||||||
|
protected override void plcWriteParams(ref List<objItem> updatedPar)
|
||||||
|
{
|
||||||
|
dataConf currMem = null;
|
||||||
|
int byteSize = 0;
|
||||||
|
byte[] MemBlock = new byte[1];
|
||||||
|
string memAddrWrite = "";
|
||||||
|
string serObj = "";
|
||||||
|
if (updatedPar != null)
|
||||||
|
{
|
||||||
|
// controllo i parametri... ne gestisco 4...
|
||||||
|
foreach (var item in updatedPar)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
memAddrWrite = "";
|
||||||
|
// cerco in area memMapWrite...
|
||||||
|
if (memMap.mMapWrite.ContainsKey(item.uid))
|
||||||
|
{
|
||||||
|
// recupero!
|
||||||
|
currMem = memMap.mMapWrite[item.uid];
|
||||||
|
byteSize = currMem.size;
|
||||||
|
memAddrWrite = currMem.memAddr;
|
||||||
|
MemBlock = new byte[byteSize];
|
||||||
|
// faccio preliminarmente upsertKey...
|
||||||
|
upsertKey(currMem.name, currMem.value);
|
||||||
|
serObj = JsonConvert.SerializeObject(item, Formatting.Indented);
|
||||||
|
lgInfo($"Inizio processing plcWriteParams per {currMem.name} | valore richiesto {currMem.value}{Environment.NewLine}---------------UPDATED PARAM---------------{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
|
||||||
|
serObj = JsonConvert.SerializeObject(currMem, Formatting.Indented);
|
||||||
|
lgInfo($"---------------MEMORY CONTENT---------------{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
|
||||||
|
lgInfo($"---------------MemBlock data---------------{Environment.NewLine}{BitConverter.ToString(MemBlock)}{Environment.NewLine}--------------- END data ---------------");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lgInfo($"Errore uid non trovato in area write memory: {item.uid}, ci sono {memMap.mMapWrite.Count} in area write");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
lgError($"Eccezione in fase di plcWriteParams per item {item.uid} con valore {item.value}{Environment.NewLine}{exc}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Decremento duration del bit indicato secondo stesse regole di ritardo dei bit di wait
|
/// Decremento duration del bit indicato secondo stesse regole di ritardo dei bit di wait
|
||||||
@@ -226,21 +556,27 @@ namespace IOB_WIN_NEXT
|
|||||||
case 2:
|
case 2:
|
||||||
bit2.duration--;
|
bit2.duration--;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
bit3.duration--;
|
bit3.duration--;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
bit4.duration--;
|
bit4.duration--;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
bit5.duration--;
|
bit5.duration--;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
bit6.duration--;
|
bit6.duration--;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
bit7.duration--;
|
bit7.duration--;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -248,6 +584,27 @@ namespace IOB_WIN_NEXT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion Protected Methods
|
||||||
|
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private List<string> alarmMessages = new List<string>();
|
||||||
|
|
||||||
|
private int currSimAlarmCode = 0;
|
||||||
|
|
||||||
|
private Random rnd = new Random();
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Private Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Decodifica il resto dell'area x i dati accessori (allarmi, ...)
|
||||||
|
/// </summary>
|
||||||
|
private void decodeOtherData()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
|
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -674,351 +1031,6 @@ namespace IOB_WIN_NEXT
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion Private Methods
|
#endregion Private Methods
|
||||||
|
|
||||||
#region Protected Methods
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Salvo valori PLC
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="updatedPar"></param>
|
|
||||||
protected override void plcWriteParams(ref List<objItem> updatedPar)
|
|
||||||
{
|
|
||||||
dataConf currMem = null;
|
|
||||||
int byteSize = 0;
|
|
||||||
byte[] MemBlock = new byte[1];
|
|
||||||
string memAddrWrite = "";
|
|
||||||
string serObj = "";
|
|
||||||
if (updatedPar != null)
|
|
||||||
{
|
|
||||||
// controllo i parametri... ne gestisco 4...
|
|
||||||
foreach (var item in updatedPar)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
memAddrWrite = "";
|
|
||||||
// cerco in area memMapWrite...
|
|
||||||
if (memMap.mMapWrite.ContainsKey(item.uid))
|
|
||||||
{
|
|
||||||
// recupero!
|
|
||||||
currMem = memMap.mMapWrite[item.uid];
|
|
||||||
byteSize = currMem.size;
|
|
||||||
memAddrWrite = currMem.memAddr;
|
|
||||||
MemBlock = new byte[byteSize];
|
|
||||||
// faccio preliminarmente upsertKey...
|
|
||||||
upsertKey(currMem.name, currMem.value);
|
|
||||||
serObj = JsonConvert.SerializeObject(item, Formatting.Indented);
|
|
||||||
lgInfo($"Inizio processing plcWriteParams per {currMem.name} | valore richiesto {currMem.value}{Environment.NewLine}---------------UPDATED PARAM---------------{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
|
|
||||||
serObj = JsonConvert.SerializeObject(currMem, Formatting.Indented);
|
|
||||||
lgInfo($"---------------MEMORY CONTENT---------------{Environment.NewLine}{serObj}{Environment.NewLine}---------------");
|
|
||||||
lgInfo($"---------------MemBlock data---------------{Environment.NewLine}{BitConverter.ToString(MemBlock)}{Environment.NewLine}--------------- END data ---------------");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lgInfo($"Errore uid non trovato in area write memory: {item.uid}, ci sono {memMap.mMapWrite.Count} in area write");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
lgError($"Eccezione in fase di plcWriteParams per item {item.uid} con valore {item.value}{Environment.NewLine}{exc}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Protected Methods
|
|
||||||
|
|
||||||
#region Public Methods
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Processo i task richiesti e li elimino dalla coda 1:1 (in realtà SOLO forceSetPzCount x ora)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="task2exe"></param>
|
|
||||||
public override Dictionary<string, string> executeTasks(Dictionary<string, string> task2exe)
|
|
||||||
{
|
|
||||||
// Verificare il protocollo: dovrebeb togliere SOLO i task eseguiti...
|
|
||||||
Dictionary<string, string> taskDone = new Dictionary<string, string>();
|
|
||||||
// controlo SE sia disabilitata simulazione principale
|
|
||||||
if (!disableSimStatus)
|
|
||||||
{
|
|
||||||
string taskVal = "";
|
|
||||||
// verifico non sia null
|
|
||||||
if (task2exe != null)
|
|
||||||
{
|
|
||||||
// cerco task specifici
|
|
||||||
foreach (var item in task2exe)
|
|
||||||
{
|
|
||||||
taskVal = "";
|
|
||||||
// converto richiesta in enum...
|
|
||||||
taskType tName = taskType.nihil;
|
|
||||||
Enum.TryParse(item.Key, out tName);
|
|
||||||
// controllo sulla KEY
|
|
||||||
switch (tName)
|
|
||||||
{
|
|
||||||
case taskType.setArt:
|
|
||||||
case taskType.setComm:
|
|
||||||
case taskType.setProg:
|
|
||||||
case taskType.setPzComm:
|
|
||||||
memMap.mMapWrite[item.Key].value = item.Value;
|
|
||||||
taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | UPDATED memMap.mMapWrite";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case taskType.setParameter:
|
|
||||||
// richiedo da URL i parametri WRITE da popolare
|
|
||||||
lgInfo("Chiamata processMemWriteRequests");
|
|
||||||
taskVal = processMemWriteRequests();
|
|
||||||
// se restituiscce "" faccio altra prova...
|
|
||||||
if (string.IsNullOrEmpty(taskVal))
|
|
||||||
{
|
|
||||||
// i parametri me li aspetto come stringa composta paramName|paramvalue
|
|
||||||
if (item.Value.Contains("|"))
|
|
||||||
{
|
|
||||||
string[] paramsJob = item.Value.Split('|');
|
|
||||||
taskVal = $"REQUEST SET PARAMETERS: {paramsJob[0]} --> {paramsJob[1]}";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
taskVal = $"WRONG REQUEST FOR SET PARAMETERS: {item.Value} doesnt contain pipe for splitting key/value";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case taskType.nihil:
|
|
||||||
case taskType.fixStopSetup:
|
|
||||||
case taskType.forceResetPzCount:
|
|
||||||
case taskType.sendWatchDogMes2Plc:
|
|
||||||
case taskType.startSetup:
|
|
||||||
case taskType.stopSetup:
|
|
||||||
taskVal = $"taskReq: {tName} | key: {item.Key} | val: {item.Value} | SKIPPED | NO EXEC";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case taskType.forceSetPzCount:
|
|
||||||
// forzo sul SIM il valore pzCount dell'IOB...
|
|
||||||
int newPzCount = contapezziPLC;
|
|
||||||
bool fatto = int.TryParse(item.Value, out newPzCount);
|
|
||||||
if (fatto)
|
|
||||||
{
|
|
||||||
// verifico SE sia ammesso il cambio ...
|
|
||||||
int deltaPzCount = newPzCount - contapezziPLC;
|
|
||||||
double maxDelta = DateTime.Now.Subtract(plcLastPzRead).TotalMinutes / (plcAvgTc / 60);
|
|
||||||
// se incremento superiore del doppio atteso --> segnalo errore e NON accetto
|
|
||||||
if (deltaPzCount > (maxDelta * maxPzDeltaPerc) / 100)
|
|
||||||
{
|
|
||||||
lgError($"[DELTA CHECK]: intremento contapezziPLC troppo elevato: lettura {newPzCount} | contapezzi attuale: {contapezziPLC} | ultima lettura PLC: {plcLastPzRead} | TCiclo medio: {plcAvgTc}s | incremento accettato ");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
contapezziPLC = newPzCount;
|
|
||||||
taskVal = $"Set new contapezziPLC: {contapezziPLC}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
taskVal = "SKIPPED | NO EXEC";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// aggiungo task!
|
|
||||||
taskDone.Add(item.Key, taskVal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return taskDone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Recupera e processa allarmi CNC...
|
|
||||||
/// </summary>
|
|
||||||
public override Dictionary<string, string> getCncAlarms()
|
|
||||||
{
|
|
||||||
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
|
||||||
return outVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Recupero dati dinamici...
|
|
||||||
/// </summary>
|
|
||||||
public override Dictionary<string, string> getDynData()
|
|
||||||
{
|
|
||||||
// valore non presente in vers default... se gestito fare override
|
|
||||||
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
|
||||||
// verificare periodo SIM parametri... se passato li invio altrimenti NO... FIX a 20 sec
|
|
||||||
if (lastSimData.AddSeconds(waitSimPar) < DateTime.Now)
|
|
||||||
{
|
|
||||||
Random rnd = new Random();
|
|
||||||
// controllo conf memorie json (se ci sono...)
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (memMap.mMapWrite.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var item in memMap.mMapWrite)
|
|
||||||
{
|
|
||||||
outVal.Add(item.Key, item.Value.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (memMap.mMapRead.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (var item in memMap.mMapRead)
|
|
||||||
{
|
|
||||||
// se il TIPO di valore è livello --> simulo variazione da MAX --> min, con un delta in CALO pari a factor * (80-120)%
|
|
||||||
if (item.Value.name == "SIM_LEVEL")
|
|
||||||
{
|
|
||||||
// verifico last value
|
|
||||||
float lastVal = 0;
|
|
||||||
float.TryParse(item.Value.value, out lastVal);
|
|
||||||
if (lastVal == 0)
|
|
||||||
{
|
|
||||||
lastVal = item.Value.maxVal - (float)item.Value.factor;
|
|
||||||
}
|
|
||||||
// decremento casuale...
|
|
||||||
float newVal = lastVal - ((float)item.Value.factor * rnd.Next(40, 120) / 100);
|
|
||||||
// se inferiore a minimo --> massimo!
|
|
||||||
if (newVal < item.Value.minVal)
|
|
||||||
{
|
|
||||||
newVal = item.Value.maxVal;
|
|
||||||
}
|
|
||||||
// salvo il suo VALUE...
|
|
||||||
item.Value.value = $"{newVal}";
|
|
||||||
outVal.Add(item.Key, $"{newVal}");
|
|
||||||
}
|
|
||||||
// altrimenti siulazione random walk...
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (item.Value.factor == 1)
|
|
||||||
{
|
|
||||||
// uso factor come valore MAX ammesso
|
|
||||||
int randVal = rnd.Next(item.Value.minVal, item.Value.maxVal);
|
|
||||||
outVal.Add(item.Key, randVal.ToString());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// uso factor come fattore di divisione x simulare decimali
|
|
||||||
float randVal = ((float)rnd.Next(item.Value.minVal, item.Value.maxVal)) / (float)item.Value.factor;
|
|
||||||
outVal.Add(item.Key, randVal.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
lastSimData = DateTime.Now;
|
|
||||||
}
|
|
||||||
return outVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Recupero programma in lavorazione
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public override string getPrgName()
|
|
||||||
{
|
|
||||||
// NOME DEL SIM!
|
|
||||||
string prgName = $"PROG_{cIobConf.codIOB}";
|
|
||||||
return prgName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Recupero info sistema generiche
|
|
||||||
/// <returns></returns>
|
|
||||||
public override Dictionary<string, string> getSysInfo()
|
|
||||||
{
|
|
||||||
// valore non presente in vers default... se gestito fare override
|
|
||||||
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
|
||||||
outVal.Add("MACHINE", "IOB_SIM");
|
|
||||||
return outVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Effettua vero processing contapezzi
|
|
||||||
/// </summary>
|
|
||||||
public override void processContapezzi()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Processo contatori eventi...
|
|
||||||
/// </summary>
|
|
||||||
public override void processVHF()
|
|
||||||
{
|
|
||||||
if (lastEvCheck.AddMilliseconds(periodoMSec) < DateTime.Now)
|
|
||||||
{
|
|
||||||
// decremento contatore ultimo evento
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (bit2 != null)
|
|
||||||
bit2.wait--;
|
|
||||||
|
|
||||||
if (bit3 != null)
|
|
||||||
bit3.wait--;
|
|
||||||
|
|
||||||
if (bit4 != null)
|
|
||||||
bit4.wait--;
|
|
||||||
|
|
||||||
if (bit5 != null)
|
|
||||||
bit5.wait--;
|
|
||||||
|
|
||||||
if (simDich != null)
|
|
||||||
simDich.wait--;
|
|
||||||
|
|
||||||
if (simRC != null)
|
|
||||||
simRC.wait--;
|
|
||||||
|
|
||||||
if (simRS != null)
|
|
||||||
simRS.wait--;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
lastEvCheck = DateTime.Now;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Effettua lettura semafori principale
|
|
||||||
/// <paramref name="currDispData">Parametri da aggiornare x display in form</paramref>
|
|
||||||
/// </summary>
|
|
||||||
public override void readSemafori(ref newDisplayData currDispData)
|
|
||||||
{
|
|
||||||
base.readSemafori(ref currDispData);
|
|
||||||
|
|
||||||
// controlo SE sia disabilitata simulazione principale
|
|
||||||
if (!disableSimStatus)
|
|
||||||
{
|
|
||||||
// decodifica e gestione
|
|
||||||
decodeToBaseBitmap();
|
|
||||||
decodeOtherData();
|
|
||||||
reportRawInput(ref currDispData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Effettua reset del contapezzi
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public override bool resetcontapezziPLC()
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
// ...SE abilitato da conf IOB
|
|
||||||
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET") == "TRUE")
|
|
||||||
{
|
|
||||||
// fingo di aver fatto...
|
|
||||||
answ = true;
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void tryConnect()
|
|
||||||
{
|
|
||||||
base.tryConnect();
|
|
||||||
connectionOk = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void tryDisconnect()
|
|
||||||
{
|
|
||||||
base.tryDisconnect();
|
|
||||||
connectionOk = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion Public Methods
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ namespace IOB_WIN_NEXT
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected int MAXCNC = 1;
|
protected int MAXCNC = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Valore minimo x considerare variazione delta parametri IOB solo x dati DataOra esecuzione
|
||||||
|
/// </summary>
|
||||||
|
protected int MinDeltaSec = 2;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Modalità di avvio
|
/// Modalità di avvio
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -662,6 +667,7 @@ namespace IOB_WIN_NEXT
|
|||||||
CMDREBO = fIni.ReadString("SERVER", "CMDREBO", "/IOB/sendRebootGateway?GWIP=");
|
CMDREBO = fIni.ReadString("SERVER", "CMDREBO", "/IOB/sendRebootGateway?GWIP=");
|
||||||
CMDIOB2CALL = fIni.ReadString("SERVER", "CMDIOB2CALL", "/IOB/getIob2call?GWIP=");
|
CMDIOB2CALL = fIni.ReadString("SERVER", "CMDIOB2CALL", "/IOB/getIob2call?GWIP=");
|
||||||
MAXCNC = fIni.ReadInteger("IOB", "MAXCNC", 1);
|
MAXCNC = fIni.ReadInteger("IOB", "MAXCNC", 1);
|
||||||
|
MinDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 1);
|
||||||
string STARTLIST = fIni.ReadString("IOB", "STARTLIST", "");
|
string STARTLIST = fIni.ReadString("IOB", "STARTLIST", "");
|
||||||
// Gestione IOB da avviare
|
// Gestione IOB da avviare
|
||||||
IOB2START = new List<string>();
|
IOB2START = new List<string>();
|
||||||
@@ -703,7 +709,7 @@ namespace IOB_WIN_NEXT
|
|||||||
{
|
{
|
||||||
firstIob = IOB2START[0];
|
firstIob = IOB2START[0];
|
||||||
}
|
}
|
||||||
redisMan = new RedisIobCache(MPIP, firstIob, "NA");
|
redisMan = new RedisIobCache(MPIP, firstIob, "NA", MinDeltaSec);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ namespace IOB_WIN_NEXT
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
m_configuration.ApplicationName,
|
m_configuration.ApplicationName,
|
||||||
30 * 60 * 1000,
|
60 * 60 * 1000,
|
||||||
CurrUserIdentity,
|
CurrUserIdentity,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
<package id="Autoupdater.NET.Official" version="1.7.0" targetFramework="net462" />
|
<package id="Autoupdater.NET.Official" version="1.7.0" targetFramework="net462" />
|
||||||
<package id="EasyModbusTCP" version="5.6.0" targetFramework="net462" />
|
<package id="EasyModbusTCP" version="5.6.0" targetFramework="net462" />
|
||||||
<package id="EgwProxy.Icoel" version="3.6.2206.2811" targetFramework="net462" />
|
<package id="EgwProxy.Icoel" version="3.6.2206.2811" targetFramework="net462" />
|
||||||
<package id="EgwProxy.MultiCncLib" version="3.6.2207.1116" targetFramework="net462" />
|
<package id="EgwProxy.MultiCncLib" version="3.6.2207.1211" targetFramework="net462" />
|
||||||
<package id="EgwProxy.OsaiCncLib" version="3.6.2205.2015" targetFramework="net462" />
|
<package id="EgwProxy.OsaiCncLib" version="3.6.2205.2015" targetFramework="net462" />
|
||||||
<package id="EntityFramework" version="6.4.4" targetFramework="net462" />
|
<package id="EntityFramework" version="6.4.4" targetFramework="net462" />
|
||||||
<package id="MapoSDK" version="6.14.2206.2718" targetFramework="net462" />
|
<package id="MapoSDK" version="6.14.2207.2913" targetFramework="net462" />
|
||||||
<package id="MathNet.Numerics" version="4.15.0" targetFramework="net462" />
|
<package id="MathNet.Numerics" version="4.15.0" targetFramework="net462" />
|
||||||
<package id="Microsoft.CodeAnalysis.NetAnalyzers" version="6.0.0" targetFramework="net462" developmentDependency="true" />
|
<package id="Microsoft.CodeAnalysis.NetAnalyzers" version="6.0.0" targetFramework="net462" developmentDependency="true" />
|
||||||
<package id="Microsoft.VisualStudio.SlowCheetah" version="4.0.8" targetFramework="net462" developmentDependency="true" />
|
<package id="Microsoft.VisualStudio.SlowCheetah" version="4.0.8" targetFramework="net462" developmentDependency="true" />
|
||||||
|
|||||||
@@ -34,8 +34,7 @@ MOVE /Y %2"zh" %2"lib\"
|
|||||||
|
|
||||||
if %1 == "Release" goto Release
|
if %1 == "Release" goto Release
|
||||||
if %1 == "Debug" goto Debug
|
if %1 == "Debug" goto Debug
|
||||||
REM if %1 == "FANUC" goto FANUC
|
if %1 == "Remote_DEBUG" goto RemoteDebug
|
||||||
REM if %1 == "SIEMENS" goto SIEMENS
|
|
||||||
|
|
||||||
:Release
|
:Release
|
||||||
REM INIZIO eliminando i files pdb
|
REM INIZIO eliminando i files pdb
|
||||||
@@ -46,29 +45,20 @@ goto END
|
|||||||
|
|
||||||
:Debug
|
:Debug
|
||||||
echo Debug: nulla da eliminare
|
echo Debug: nulla da eliminare
|
||||||
|
|
||||||
|
REM copia script verso server remoto
|
||||||
|
REM ROBOCOPY . \\10.150.0.1\Steamware\IOB-WIN-NEXT-DEB /MIR
|
||||||
|
|
||||||
goto END
|
goto END
|
||||||
|
|
||||||
REM :CMS
|
|
||||||
REM echo CMS: Elimino files IOT di SCM
|
:RemoteDebug
|
||||||
REM REM INIZIO eliminando i files pdb
|
echo Debug remoto: effettuo robocopy sync
|
||||||
REM del /S %2"*.pdb""
|
|
||||||
REM del %2"DATA\CONF\IOT_ByteList.map"
|
REM copia script verso server remoto (FINASSI)
|
||||||
REM del %2"DATA\CONF\IOT_WordList.map"
|
ROBOCOPY . \\10.150.0.1\Steamware\IOB-WIN-NEXT-DEB /MIR
|
||||||
REM del %2"DATA\CONF\IOT_DWordList.map"
|
|
||||||
REM del %2"DATA\CONF\IOT_StringList.map"
|
goto END
|
||||||
REM del %2"DATA\CONF\EsaKvara.ini"
|
|
||||||
REM del /S %2"SCMEgwProxy.MultiCncLib.dll"
|
|
||||||
REM del /S %2"SCMEgwProxy.MultiCncLib.xml"
|
|
||||||
REM ora verifico tipo controllo esatto...
|
|
||||||
REM if %1 == "CMS-FANUC" goto FANUC
|
|
||||||
REM if %1 == "CMS-SIEMENS" goto SIEMENS
|
|
||||||
REM if %1 == "CMS-OSAI" goto OSAI
|
|
||||||
REM
|
|
||||||
REM :FANUC
|
|
||||||
REM goto END
|
|
||||||
REM
|
|
||||||
REM :SIEMENS
|
|
||||||
REM goto END
|
|
||||||
|
|
||||||
:END
|
:END
|
||||||
echo Fatto!
|
echo Fatto!
|
||||||
+16
-75
@@ -2,83 +2,24 @@
|
|||||||
echo Effettua setup dei file specifici per i vari ambienti pre build installer: verifica da nome configurazione %1
|
echo Effettua setup dei file specifici per i vari ambienti pre build installer: verifica da nome configurazione %1
|
||||||
|
|
||||||
|
|
||||||
REM if %1 == "Release" goto Release
|
if %1 == "Release" goto Release
|
||||||
REM if %1 == "Debug" goto Debug
|
if %1 == "Debug" goto Debug
|
||||||
REM if %1 == "FANUC" goto CMS
|
if %1 == "Remote_DEBUG" goto RemoteDebug
|
||||||
REM if %1 == "SIEMENS" goto CMS
|
|
||||||
REM
|
:Release
|
||||||
REM :Release
|
echo Release: nulla da copiare
|
||||||
REM echo Release: nulla da copiare
|
goto END
|
||||||
REM goto END
|
|
||||||
REM
|
:Debug
|
||||||
REM :Debug
|
echo Debug: copia file ini x simulazione Debug
|
||||||
REM echo Debug: copia file ini x simulazione ESA
|
|
||||||
REM del %2"DATA\CONF\EsaKvara.ini"
|
REM del %2"DATA\CONF\EsaKvara.ini"
|
||||||
REM copy %2"Resources\SCM\EsaKvara_SIM.ini" %2"DATA\CONF\EsaKvara.ini"
|
REM copy %2"Resources\SCM\EsaKvara_SIM.ini" %2"DATA\CONF\EsaKvara.ini"
|
||||||
REM goto END
|
goto END
|
||||||
REM
|
|
||||||
REM :CMS
|
|
||||||
REM echo CMS: copio files CMS - Zogno
|
:RemoteDebug
|
||||||
REM del %2"Resources\MTCA.ico"
|
echo RemoteDebug: nulla da copiare
|
||||||
REM del %2"DATA\CONF\Adapter_ItemList.xml"
|
goto END
|
||||||
REM del %2"DATA\CONF\AlarmList.map"
|
|
||||||
REM del %2"DATA\CONF\AlarmListCNC.map"
|
|
||||||
REM del %2"DATA\CONF\AnalogData.map"
|
|
||||||
REM del %2"DATA\CONF\CounterList.map"
|
|
||||||
REM del %2"DATA\CONF\StatusList.map"
|
|
||||||
REM REM del /F /Q %2"DATA\CONF\*.*"
|
|
||||||
REM copy %2"Resources\CMS\CMS.ico" %2"Resources\MTCA.ico"
|
|
||||||
REM copy %2"Resources\CMS\AlarmListEmpty.map" %2"DATA\CONF\AlarmListCNC.map"
|
|
||||||
REM REM ora verifico tipo controllo esatto...
|
|
||||||
REM if %1 == "CMS-FANUC" goto FANUC
|
|
||||||
REM if %1 == "CMS-SIEMENS" goto SIEMENS
|
|
||||||
REM if %1 == "CMS-OSAI" goto OSAI
|
|
||||||
REM
|
|
||||||
REM :SCM
|
|
||||||
REM echo SCM: copio files SCM - Rimini
|
|
||||||
REM del %2"Resources\MTCA.ico"
|
|
||||||
REM del %2"DATA\CONF\Adapter_ItemList.xml"
|
|
||||||
REM del %2"DATA\CONF\AlarmList.map"
|
|
||||||
REM REM del %2"DATA\CONF\EsaKvara.ini"
|
|
||||||
REM del %2"DATA\CONF\IOT_ByteList.map"
|
|
||||||
REM del %2"DATA\CONF\IOT_WordList.map"
|
|
||||||
REM del %2"DATA\CONF\IOT_DWordList.map"
|
|
||||||
REM del %2"DATA\CONF\IOT_StringList.map"
|
|
||||||
REM REM del /F /Q %2"DATA\CONF\*.*"
|
|
||||||
REM copy %2"Resources\SCM\SCM.ico" %2"Resources\MTCA.ico"
|
|
||||||
REM copy %2"Resources\SCM\SCM_ESA.xml" %2"DATA\CONF\Adapter_ItemList.xml"
|
|
||||||
REM copy %2"Resources\SCM\AlarmListEsaGv.map" %2"DATA\CONF\AlarmList.map"
|
|
||||||
REM copy %2"Resources\SCM\AlarmListEsaGvCNC.map" %2"DATA\CONF\AlarmListCNC.map"
|
|
||||||
REM copy %2"Resources\SCM\EsaKvara_PROD.ini" %2"DATA\CONF\EsaKvara.ini"
|
|
||||||
REM copy %2"Resources\SCM\IOT_ByteList.map" %2"DATA\CONF\IOT_ByteList.map"
|
|
||||||
REM copy %2"Resources\SCM\IOT_WordList.map" %2"DATA\CONF\IOT_WordList.map"
|
|
||||||
REM copy %2"Resources\SCM\IOT_DWordList.map" %2"DATA\CONF\IOT_DWordList.map"
|
|
||||||
REM copy %2"Resources\SCM\IOT_StringList.map" %2"DATA\CONF\IOT_StringList.map"
|
|
||||||
REM goto END
|
|
||||||
REM
|
|
||||||
REM :FANUC
|
|
||||||
REM copy %2"Resources\CMS\FANUC.xml" %2"DATA\CONF\Adapter_ItemList.xml"
|
|
||||||
REM copy %2"Resources\CMS\AlarmListFANUC.map" %2"DATA\CONF\AlarmList.map"
|
|
||||||
REM copy %2"Resources\CMS\AnalogDataFANUC.map" %2"DATA\CONF\AnalogData.map"
|
|
||||||
REM copy %2"Resources\CMS\CounterListFANUC.map" %2"DATA\CONF\CounterList.map"
|
|
||||||
REM copy %2"Resources\CMS\StatusListFANUC.map" %2"DATA\CONF\StatusList.map"
|
|
||||||
REM goto END
|
|
||||||
REM
|
|
||||||
REM :SIEMENS
|
|
||||||
REM copy %2"Resources\CMS\SIEMENS.xml" %2"DATA\CONF\Adapter_ItemList.xml"
|
|
||||||
REM copy %2"Resources\CMS\AlarmListSIEMENS.map" %2"DATA\CONF\AlarmList.map"
|
|
||||||
REM copy %2"Resources\CMS\AnalogDataSIEMENS.map" %2"DATA\CONF\AnalogData.map"
|
|
||||||
REM copy %2"Resources\CMS\CounterListSIEMENS.map" %2"DATA\CONF\CounterList.map"
|
|
||||||
REM copy %2"Resources\CMS\StatusListSIEMENS.map" %2"DATA\CONF\StatusList.map"
|
|
||||||
REM goto END
|
|
||||||
REM
|
|
||||||
REM :OSAI
|
|
||||||
REM copy %2"Resources\CMS\OSAI.xml" %2"DATA\CONF\Adapter_ItemList.xml"
|
|
||||||
REM copy %2"Resources\CMS\AlarmListOSAI.map" %2"DATA\CONF\AlarmList.map"
|
|
||||||
REM copy %2"Resources\CMS\AnalogDataOSAI.map" %2"DATA\CONF\AnalogData.map"
|
|
||||||
REM copy %2"Resources\CMS\CounterListOSAI.map" %2"DATA\CONF\CounterList.map"
|
|
||||||
REM copy %2"Resources\CMS\StatusListOSAI.map" %2"DATA\CONF\StatusList.map"
|
|
||||||
REM goto END
|
|
||||||
|
|
||||||
:END
|
:END
|
||||||
echo Fatto!
|
echo Fatto!
|
||||||
@@ -60,6 +60,25 @@
|
|||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\Remote_DEBUG\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x86\Remote_DEBUG\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<LangVersion>7.3</LangVersion>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
|||||||
Reference in New Issue
Block a user