update x scrittura PLC ogni checkPeriod
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Le informazioni generali relative a un assembly sono controllate dal seguente
|
||||
@@ -32,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
|
||||
// usando l'asterisco '*' come illustrato di seguito:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("1.1.2005.28")]
|
||||
[assembly: AssemblyFileVersion("1.1.2005.28")]
|
||||
|
||||
+12
-11
@@ -1,18 +1,12 @@
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using NLog.LayoutRenderers;
|
||||
using S7.Net;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MHT_Siemens
|
||||
@@ -38,7 +32,7 @@ namespace MHT_Siemens
|
||||
/// </summary>
|
||||
public static Logger lg;
|
||||
/// <summary>
|
||||
/// oggetto uiTimer x gestioen refresh UI
|
||||
/// oggetto uiTimer x gestione refresh UI
|
||||
/// </summary>
|
||||
protected Timer uiTimer = new Timer();
|
||||
/// <summary>
|
||||
@@ -100,7 +94,7 @@ namespace MHT_Siemens
|
||||
private void startCheckTimer()
|
||||
{
|
||||
// ogni 5 minuti watchdog
|
||||
checkTimer.Interval = sampleTimer.Interval * 60 * 5;
|
||||
checkTimer.Interval = sampleTimer.Interval * 60;
|
||||
checkTimer.Tick += CheckTimer_Tick;
|
||||
checkTimer.Start();
|
||||
}
|
||||
@@ -142,7 +136,7 @@ namespace MHT_Siemens
|
||||
lgInfo("Starting loadMemConf");
|
||||
if (File.Exists(setupFile))
|
||||
{
|
||||
lgInfo($"File found: {setupFile}");
|
||||
lgInfo("Setup File found!");
|
||||
try
|
||||
{
|
||||
StreamReader reader = new StreamReader(setupFile);
|
||||
@@ -230,7 +224,10 @@ namespace MHT_Siemens
|
||||
{
|
||||
lgInfo("Connection error!");
|
||||
}
|
||||
|
||||
// loggo che COMUNQUE forzo scrittura su PLC!
|
||||
lgInfo("Forced PLC write");
|
||||
// invio a PLC
|
||||
saveToPLC();
|
||||
}
|
||||
private void SampleTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
@@ -429,7 +426,11 @@ namespace MHT_Siemens
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!currPLC.IsConnected) currPLC.Open();
|
||||
if (!currPLC.IsConnected)
|
||||
{
|
||||
currPLC.Open();
|
||||
}
|
||||
|
||||
if (!currPLC.IsConnected)
|
||||
{
|
||||
lgError("Errore connessione");
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
"csvHasHeader": true,
|
||||
"csvSeparator": ";",
|
||||
"confPLC": {
|
||||
"ipAdrr": "192.168.0.102",
|
||||
"tipoCpu": "S71500",
|
||||
"ipAdrr": "192.168.214.1",
|
||||
"tipoCpu": "S7300",
|
||||
"rack": 0,
|
||||
"slot": 1
|
||||
"slot": 2
|
||||
},
|
||||
"parametersList": {
|
||||
"DB999.DBD32": {
|
||||
"DB701.DBD142": {
|
||||
"Column": "Valore assoluto",
|
||||
"Index": 7,
|
||||
"MemConf": "DB999.DBD32",
|
||||
"MemConf": "DB701.DBD142",
|
||||
"DataType": "real"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user