Ancora fix senza conf precedente, Mitsubishi...
This commit is contained in:
@@ -27,6 +27,11 @@ namespace IOB_UT_NEXT.Config.Base
|
||||
/// </summary>
|
||||
public bool IsMulti { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se si voglia recuperare il PROG NAME dal CNC
|
||||
/// </summary>
|
||||
public bool GetProgName { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Dati configurazione CNC
|
||||
/// </summary>
|
||||
@@ -40,7 +45,7 @@ namespace IOB_UT_NEXT.Config.Base
|
||||
/// <summary>
|
||||
/// Configurazione specifica FANUC (se applicabile)
|
||||
/// </summary>
|
||||
public FanucDto FanucConf { get; set; }
|
||||
public MemoryDto MemoryConf { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione specifica Siemens (se applicabile)
|
||||
|
||||
@@ -142,6 +142,7 @@ namespace IOB_UT_NEXT.Config
|
||||
{
|
||||
Vendor = fIni.ReadString("MACHINE", "VENDOR", "STEAMWARE"),
|
||||
Model = fIni.ReadString("MACHINE", "MODEL", "ND"),
|
||||
GetProgName = fIni.ReadBoolean("CNC", "GETPRGNAME", true),
|
||||
ConnectConf = new ConnectionDto()
|
||||
{
|
||||
IpAddr = fIni.ReadString("CNC", "IP", "::1"),
|
||||
@@ -181,11 +182,11 @@ namespace IOB_UT_NEXT.Config
|
||||
newConfObj.DeviceConf.SignalLUT.Add(item.Key, item.Value);
|
||||
}
|
||||
}
|
||||
// cerco dati specifici x popolare l'area Fanuc
|
||||
if (memDict.Where(x => x.Key.StartsWith("AREA") || x.Key.StartsWith("PAR")).Count() > 0)
|
||||
// cerco dati specifici x popolare l'area Memoria (Fanuc/Mitsubischi/...)
|
||||
if (memDict.Where(x => x.Key.StartsWith("AREA") || x.Key.StartsWith("PAR") || x.Key.StartsWith("SIGN")).Count() > 0)
|
||||
{
|
||||
// init fanuc...
|
||||
newConfObj.DeviceConf.FanucConf = new FanucDto();
|
||||
newConfObj.DeviceConf.MemoryConf = new MemoryDto();
|
||||
// inizio setup prendendo quelli con valori addrSize
|
||||
foreach (var item in memDict.Where(x => x.Key.EndsWith("SIZE")))
|
||||
{
|
||||
@@ -206,13 +207,15 @@ namespace IOB_UT_NEXT.Config
|
||||
AddressStart = addrStart,
|
||||
AddressSize = addrSize
|
||||
};
|
||||
newConfObj.DeviceConf.FanucConf.MemConf.Add(mId, memArea);
|
||||
newConfObj.DeviceConf.MemoryConf.AreaConf.Add(mId, memArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// salvo eventuale memTrace...
|
||||
newConfObj.DeviceConf.MemoryConf.Mem2Trace = fIni.ReadString("OPTPAR", "MEM_2_TRACE", "");
|
||||
|
||||
// parametri opzionali Siemens
|
||||
if (!string.IsNullOrEmpty(fIni.ReadString("CNC", "CPUTYPE", "")))
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using IOB_UT_NEXT.Config.Mem;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IOB_UT_NEXT.Config.Special
|
||||
{
|
||||
/// <summary>
|
||||
/// Configurazione specifica memoria per FANUC
|
||||
/// </summary>
|
||||
public class FanucDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Conf aree di memoria da gestire
|
||||
/// </summary>
|
||||
public Dictionary<string, MemAreaDto> MemConf { get; set; } = new Dictionary<string, MemAreaDto>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using IOB_UT_NEXT.Config.Mem;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IOB_UT_NEXT.Config.Special
|
||||
{
|
||||
/// <summary>
|
||||
/// Configurazione memoria a banchi (es: Fanuc, Mitsubishi, ...)
|
||||
/// </summary>
|
||||
public class MemoryDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Conf aree di memoria da gestire
|
||||
/// </summary>
|
||||
public Dictionary<string, MemAreaDto> AreaConf { get; set; } = new Dictionary<string, MemAreaDto>();
|
||||
|
||||
/// <summary>
|
||||
/// Valori dei bit di memoria da gestire con trace ad ogni check x debug
|
||||
/// </summary>
|
||||
public string Mem2Trace { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@
|
||||
<Compile Include="Config\IobConfTree.cs" />
|
||||
<Compile Include="Config\Mem\MemArea.cs" />
|
||||
<Compile Include="Config\Special\ActionDto.cs" />
|
||||
<Compile Include="Config\Special\FanucDto.cs" />
|
||||
<Compile Include="Config\Special\MemoryDto.cs" />
|
||||
<Compile Include="Config\Special\SpecializedDto.cs" />
|
||||
<Compile Include="Config\Special\SiemensDto.cs" />
|
||||
<Compile Include="DataModel\Fimat.cs" />
|
||||
|
||||
@@ -23,25 +23,25 @@ namespace IOB_WIN_BECKHOFF
|
||||
/// </summary>
|
||||
protected override void loadIobType()
|
||||
{
|
||||
if (IOBConf != null)
|
||||
if (IOBConfFull != null)
|
||||
{
|
||||
switch (tipoScelto)
|
||||
{
|
||||
case tipoAdapter.BECKHOFF:
|
||||
case tipoAdapter.BECKHOFF_CPA:
|
||||
iobObj = new IobBeckhoff.BeckhoffCpa(this, IOBConf, IOBConfFull);
|
||||
iobObj = new IobBeckhoff.BeckhoffCpa(this, IOBConfFull);
|
||||
btnStart.Enabled = true;
|
||||
break;
|
||||
|
||||
case tipoAdapter.SIMULA:
|
||||
case tipoAdapter.ND:
|
||||
default:
|
||||
iobObj = new IOB_WIN_FORM.Iob.Simula(this, IOBConf, IOBConfFull);
|
||||
iobObj = new IOB_WIN_FORM.Iob.Simula(this, IOBConfFull);
|
||||
btnStart.Enabled = false;
|
||||
break;
|
||||
}
|
||||
lblCncText = $"CNC: {IOBConf.tipoIob} [{IOBConf.cncIpAddr}:{IOBConf.cncPort}]";
|
||||
lblSrvUrlText = $"SRV: {IOBConf.serverData.MPIP} | URL: {IOBConf.serverData.MPURL}{IOBConf.serverData.CMDBASE}";
|
||||
lblCncText = $"CNC: {IOBConfFull.GenConf.IobType} [{IOBConfFull.DeviceConf.ConnectConf.IpAddr}:{IOBConfFull.DeviceConf.ConnectConf.Port}]";
|
||||
lblSrvUrlText = $"SRV: {IOBConfFull.MapoMesConf.IpAddr} | URL: {IOBConfFull.MapoMesConf.ApiUrl("")}";
|
||||
|
||||
// aggancio evento refresh
|
||||
iobObj.eh_refreshed += IobObj_eh_refreshed;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace IOB_WIN_BECKHOFF.Iob
|
||||
public class GenericNext : IOB_WIN_FORM.Iob.Generic
|
||||
{
|
||||
|
||||
public GenericNext(AdapterFormNext caller, IobConfiguration IOBConf, IobConfTree IobConfFull) : base((IOB_WIN_FORM.AdapterForm)caller, IOBConf, IobConfFull)
|
||||
public GenericNext(AdapterFormNext caller, IobConfTree IobConfFull) : base((IOB_WIN_FORM.AdapterForm)caller, IobConfFull)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,8 @@ namespace IOB_WIN_BECKHOFF.IobBeckhoff
|
||||
/// Estende l'init della classe base
|
||||
/// </summary>
|
||||
/// <param name="caller">Form chiamante</param>
|
||||
/// <param name="IOBConf">Configurazione (legacy)</param>
|
||||
/// <param name="IobConfFull">Configurazione (v 4.x)</param>
|
||||
public Beckhoff(AdapterFormNext caller, IobConfiguration IOBConf, IobConfTree IobConfFull) : base(caller, IOBConf, IobConfFull)
|
||||
public Beckhoff(AdapterFormNext caller, IobConfTree IobConfFull) : base(caller, IobConfFull)
|
||||
{
|
||||
lgInfo("NEW IobBeckhoff Adapter");
|
||||
// gestione invio ritardato contapezzi
|
||||
@@ -108,8 +107,8 @@ namespace IOB_WIN_BECKHOFF.IobBeckhoff
|
||||
if (!connectionOk)
|
||||
{
|
||||
int port = 851;
|
||||
int.TryParse(cIobConf.cncPort, out port);
|
||||
string addr = !string.IsNullOrEmpty(cIobConf.cncIpAddr) ? cIobConf.cncIpAddr : "local";
|
||||
int.TryParse(IOBConfFull.DeviceConf.ConnectConf.Port, out port);
|
||||
string addr = !string.IsNullOrEmpty(IOBConfFull.DeviceConf.ConnectConf.IpAddr) ? IOBConfFull.DeviceConf.ConnectConf.IpAddr : "local";
|
||||
lgInfo($"Parametri TC client | addr: {addr} | port: {port}");
|
||||
// predispongo dataVal
|
||||
foreach (var item in memMap.mMapRead)
|
||||
|
||||
@@ -14,9 +14,8 @@ namespace IOB_WIN_BECKHOFF.IobBeckhoff
|
||||
/// Estende l'init della classe base
|
||||
/// </summary>
|
||||
/// <param name="caller">Form chiamante</param>
|
||||
/// <param name="IOBConf">Configurazione (legacy)</param>
|
||||
/// <param name="IobConfFull">Configurazione (v 4.x)</param>
|
||||
public BeckhoffCpa(AdapterFormNext caller, IobConfiguration IOBConf, IobConfTree IobConfFull) : base(caller, IOBConf, IobConfFull)
|
||||
public BeckhoffCpa(AdapterFormNext caller, IobConfTree IobConfFull) : base(caller, IobConfFull)
|
||||
{
|
||||
lgInfo("START IobBeckhoffCPA Adapter specifico");
|
||||
|
||||
|
||||
@@ -8525,7 +8525,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
i_counters = new int[32];
|
||||
lastPeriodicLog = DateTime.Now;
|
||||
// fix parametri generali...
|
||||
enablePrgName = true;
|
||||
enablePrgName = IOBConfFull.DeviceConf.GetProgName;
|
||||
// valore standard divieto accodamento segnali IN
|
||||
string VETO_QUEUE_IN = getOptPar("VETO_QUEUE_IN");
|
||||
if (!string.IsNullOrEmpty(VETO_QUEUE_IN))
|
||||
|
||||
@@ -17,20 +17,20 @@ namespace IOB_WIN_KAWASAKI
|
||||
/// </summary>
|
||||
protected override void loadIobType()
|
||||
{
|
||||
if (IOBConf != null)
|
||||
if (IOBConfFull != null)
|
||||
{
|
||||
switch (tipoScelto)
|
||||
{
|
||||
|
||||
case tipoAdapter.KAWASAKI:
|
||||
iobObj = new Iob.Kawasaki(this, IOBConf, IOBConfFull);
|
||||
iobObj = new Iob.Kawasaki(this, IOBConfFull);
|
||||
btnStart.Enabled = true;
|
||||
break;
|
||||
|
||||
case tipoAdapter.SIMULA:
|
||||
case tipoAdapter.ND:
|
||||
default:
|
||||
iobObj = new IOB_WIN_FORM.Iob.Simula(this, IOBConf, IOBConfFull);
|
||||
iobObj = new IOB_WIN_FORM.Iob.Simula(this, IOBConfFull);
|
||||
btnStart.Enabled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
/// <param name="caller">Form chiamante</param>
|
||||
/// <param name="IOBConf">Configurazione (legacy)</param>
|
||||
/// <param name="IobConfFull">Configurazione (v 4.x)</param>
|
||||
public GenericNext(AdapterFormNext caller, IobConfiguration IOBConf, IobConfTree IobConfFull) : base((IOB_WIN_FORM.AdapterForm)caller, IOBConf, IobConfFull)
|
||||
public GenericNext(AdapterFormNext caller, IobConfTree IobConfFull) : base((IOB_WIN_FORM.AdapterForm)caller, IobConfFull)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,8 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
/// estende l'init della classe base...
|
||||
/// </summary>
|
||||
/// <param name="caller">Form chiamante</param>
|
||||
/// <param name="IOBConf">Configurazione (legacy)</param>
|
||||
/// <param name="IobConfFull">Configurazione (v 4.x)</param>
|
||||
public Kawasaki(AdapterFormNext caller, IobConfiguration IOBConf, IobConfTree IobConfFull) : base(caller, IOBConf, IobConfFull)
|
||||
public Kawasaki(AdapterFormNext caller, IobConfTree IobConfFull) : base(caller, IobConfFull)
|
||||
{
|
||||
// gestione invio ritardato contapezzi
|
||||
pzCountDelay = utils.CRI("pzCountDelay");
|
||||
@@ -144,7 +143,7 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
case taskType.stopSetup:
|
||||
// reset contapezzi fine setup // reset contapezzi fine setup SE
|
||||
// ESPLICITAMENTE IMPOSTATO
|
||||
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE")
|
||||
if (getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE")
|
||||
{
|
||||
resetContapezziPLC();
|
||||
}
|
||||
@@ -212,7 +211,7 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
contapezziPLC = pzCounter;
|
||||
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
|
||||
// indicazione area)
|
||||
if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
|
||||
if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
|
||||
{
|
||||
#if false
|
||||
string memAddr = getOptPar("PZCOUNT_MODE");
|
||||
@@ -357,7 +356,7 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
{
|
||||
bool answ = false;
|
||||
// ...SE abilitato da conf IOB
|
||||
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET") == "TRUE")
|
||||
if (getOptPar("ENABLE_PZ_RESET") == "TRUE")
|
||||
{
|
||||
// scrivo valore 0 x il contapezzi
|
||||
try
|
||||
@@ -402,7 +401,7 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
{
|
||||
// ora provo connessione...
|
||||
parentForm.commPlcActive = true;
|
||||
string connPar = string.Format("TCP {0}", cIobConf.cncIpAddr);
|
||||
string connPar = $"TCP {IOBConfFull.DeviceConf.ConnectConf.IpAddr}";
|
||||
KAWASAKI_ref.connect(connPar);
|
||||
parentForm.commPlcActive = false;
|
||||
lgInfo("szStatusConnection: " + KAWASAKI_ref.IsConnected);
|
||||
@@ -423,9 +422,9 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lgFatal(string.Format("Errore nella connessione all'adapter KAWASAKI: {0}{1}{2}", szStatusConnection, Environment.NewLine, exc));
|
||||
lgFatal($"Errore nella connessione all'adapter KAWASAKI: {szStatusConnection}{Environment.NewLine}{exc}");
|
||||
connectionOk = false;
|
||||
lgInfo(string.Format("Eccezione in TryConnect, Adapter KAWASAKI NON running, pausa di {0} msec prima di ulteriori tentativi di riconnessione", utils.CRI("waitRecMSec")));
|
||||
lgInfo($"Eccezione in TryConnect, Adapter KAWASAKI NON running, pausa di {utils.CRI("waitRecMSec")} msec prima di ulteriori tentativi di riconnessione");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -435,7 +434,7 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
needRefresh = true;
|
||||
if (verboseLog || periodicLog)
|
||||
{
|
||||
lgInfo(string.Format("Attenzione: KAWASAKI controllo PING fallito per IP {0}", cIobConf.cncPingAddr));
|
||||
lgInfo($"Attenzione: KAWASAKI controllo PING fallito per IP {IOBConfFull.DeviceConf.ConnectConf.PingIpAddr}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -720,12 +719,7 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
{
|
||||
// Creo oggetto connessione NC
|
||||
parentForm.commPlcActive = true;
|
||||
lgInfoStartup("Start init Adapter KAWASAKI all'IP {0} | --> IOB {1}", cIobConf.cncIpAddr, cIobConf.codIOB);
|
||||
|
||||
// inizializzo correttamente aree memoria secondo CONF - iniFileName
|
||||
IniFile fIni = new IniFile(cIobConf.iniFileName);
|
||||
// fix enable prgName
|
||||
enablePrgName = fIni.ReadBoolean("CNC", "GETPRGNAME", true);
|
||||
lgInfoStartup($"Start init Adapter KAWASAKI all'IP {IOBConfFull.DeviceConf.ConnectConf.IpAddr} | --> IOB {IOBConfFull.GenConf.CodIOB}");
|
||||
|
||||
// SE è necessario refresh...
|
||||
if (needRefresh)
|
||||
@@ -736,7 +730,7 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
{
|
||||
try
|
||||
{
|
||||
string connPar = string.Format("TCP {0}", cIobConf.cncIpAddr);
|
||||
string connPar = $"TCP {IOBConfFull.DeviceConf.ConnectConf.IpAddr}";
|
||||
KAWASAKI_ref = new KRcc.Commu(connPar);
|
||||
// disconnetto e connetto...
|
||||
if (isVerboseLog)
|
||||
@@ -765,7 +759,7 @@ namespace IOB_WIN_KAWASAKI.Iob
|
||||
{
|
||||
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
|
||||
// indicazione area)
|
||||
if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
|
||||
if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
|
||||
{
|
||||
if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
|
||||
{
|
||||
|
||||
@@ -23,19 +23,19 @@ namespace IOB_WIN_MITSUBISHI
|
||||
/// </summary>
|
||||
protected override void loadIobType()
|
||||
{
|
||||
if (IOBConf != null)
|
||||
if (IOBConfFull != null)
|
||||
{
|
||||
switch (tipoScelto)
|
||||
{
|
||||
case tipoAdapter.MITSUBISHI:
|
||||
iobObj = new Mitsubishi(this, IOBConf, IOBConfFull);
|
||||
iobObj = new Mitsubishi(this, IOBConfFull);
|
||||
btnStart.Enabled = true;
|
||||
break;
|
||||
|
||||
case tipoAdapter.SIMULA:
|
||||
case tipoAdapter.ND:
|
||||
default:
|
||||
iobObj = new IOB_WIN_FORM.Iob.Simula(this, IOBConf, IOBConfFull);
|
||||
iobObj = new IOB_WIN_FORM.Iob.Simula(this, IOBConfFull);
|
||||
btnStart.Enabled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -10,9 +10,8 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
/// Adapter generico del progetto IOB specifico
|
||||
/// </summary>
|
||||
/// <param name="caller">Form chiamante</param>
|
||||
/// <param name="IOBConf">Configurazione (legacy)</param>
|
||||
/// <param name="IobConfFull">Configurazione (v 4.x)</param>
|
||||
public GenericNext(AdapterFormNext caller, IobConfiguration IOBConf, IobConfTree IobConfFull) : base((IOB_WIN_FORM.AdapterForm)caller, IOBConf, IobConfFull)
|
||||
public GenericNext(AdapterFormNext caller, IobConfTree IobConfFull) : base((IOB_WIN_FORM.AdapterForm)caller, IobConfFull)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -17,9 +17,8 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
/// Estende l'init della classe base...
|
||||
/// </summary>
|
||||
/// <param name="caller">Form chiamante</param>
|
||||
/// <param name="IOBConf">Configurazione (legacy)</param>
|
||||
/// <param name="IobConfFull">Configurazione (v 4.x)</param>
|
||||
public Mitsubishi(AdapterFormNext caller, IobConfiguration IOBConf, IobConfTree IobConfFull) : base(caller, IOBConf, IobConfFull)
|
||||
public Mitsubishi(AdapterFormNext caller, IobConfTree IobConfFull) : base(caller, IobConfFull)
|
||||
{
|
||||
lgInfo("Start init Mitsubishi");
|
||||
// gestione invio ritardato contapezzi
|
||||
@@ -27,25 +26,52 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
lastPzCountSend = DateTime.Now;
|
||||
lastWarnODL = DateTime.Now;
|
||||
|
||||
// inizializzo correttamente aree memoria secondo CONF - iniFileName
|
||||
IniFile fIni = new IniFile(IOBConf.iniFileName);
|
||||
// inizializzo correttamente aree memoria secondo CONF - da IobConfFull
|
||||
IOB_UT_NEXT.Config.Mem.MemAreaDto currArea= new IOB_UT_NEXT.Config.Mem.MemAreaDto();
|
||||
string aName = "AREAV";
|
||||
if (IobConfFull.DeviceConf.MemoryConf.AreaConf.ContainsKey(aName))
|
||||
{
|
||||
currArea = IobConfFull.DeviceConf.MemoryConf.AreaConf[aName];
|
||||
MemVarStart = currArea.AddressStart;
|
||||
MemVarSize = currArea.AddressSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
MemVarStart = 500;
|
||||
MemVarSize = 1;
|
||||
}
|
||||
aName = "PAR";
|
||||
if (IobConfFull.DeviceConf.MemoryConf.AreaConf.ContainsKey(aName))
|
||||
{
|
||||
currArea = IobConfFull.DeviceConf.MemoryConf.AreaConf[aName];
|
||||
ParamStart = currArea.AddressStart;
|
||||
ParamSize = currArea.AddressSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
ParamStart = 8001;
|
||||
ParamSize = 1;
|
||||
}
|
||||
aName = "SIGN";
|
||||
if (IobConfFull.DeviceConf.MemoryConf.AreaConf.ContainsKey(aName))
|
||||
{
|
||||
currArea = IobConfFull.DeviceConf.MemoryConf.AreaConf[aName];
|
||||
SignStart = currArea.AddressStart;
|
||||
SignSize = currArea.AddressSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
SignStart = 10096;
|
||||
SignSize = 1;
|
||||
}
|
||||
|
||||
// inizializzo aree di memoria correnti...
|
||||
MemVarStart = fIni.ReadInteger("MEMORY", "AREAV_START", 500);
|
||||
MemVarSize = fIni.ReadInteger("MEMORY", "AREAV_SIZE", 1);
|
||||
ParamStart = fIni.ReadInteger("MEMORY", "PAR_START", 8001);
|
||||
ParamSize = fIni.ReadInteger("MEMORY", "PAR_SIZE", 1);
|
||||
SignStart = fIni.ReadInteger("MEMORY", "SIGN_START", 10096);
|
||||
SignSize = fIni.ReadInteger("MEMORY", "SIGN_SIZE", 1);
|
||||
|
||||
// loggo aree di memoria avviate...
|
||||
lgInfo($"Avviata area di memoria Var: {MemVarSize} vars");
|
||||
lgInfo($"Avviata area di memoria Param: {ParamSize} params");
|
||||
|
||||
// fix enable prgName
|
||||
enablePrgName = fIni.ReadBoolean("CNC", "GETPRGNAME", true);
|
||||
|
||||
// effettuo lettura della conf sigLUT... cercando 1:1 i bit...
|
||||
#if false
|
||||
string currBit = "";
|
||||
string memArea = "";
|
||||
for (int i = 0; i < 8; i++)
|
||||
@@ -57,7 +83,10 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
{
|
||||
signLUT.Add(currBit, memArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// 2025.02.25 da verificare assegnazione DA CONF
|
||||
signLUT = new Dictionary<string, string>(IOBConfFull.DeviceConf.SignalLUT);
|
||||
|
||||
// recupero sysType del controllo, sennò default M700L...
|
||||
string sEZNC_SYS = getOptPar("EZNC_SYS");
|
||||
@@ -85,19 +114,26 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
}
|
||||
|
||||
// leggo conf x ricerca valori memoria da tracciare in log di continuo...
|
||||
mem2trace = fIni.ReadString("OPTPAR", "MEM_2_TRACE", "");
|
||||
#if false
|
||||
mem2trace = fIni.ReadString("OPTPAR", "MEM_2_TRACE", "");
|
||||
#endif
|
||||
mem2trace = IOBConfFull.DeviceConf.MemoryConf.Mem2Trace;
|
||||
|
||||
// è little endian (NON serve conversione)
|
||||
hasBigEndian = false;
|
||||
lgInfoStartup($"Start init Adapter MITSUBISHI | IP {IOBConf.cncIpAddr}:{IOBConf.cncPort} per IOB {IOBConf.codIOB}");
|
||||
lgInfoStartup($"Start init Adapter MITSUBISHI | IP {IOBConfFull.DeviceConf.ConnectConf.IpAddr}:{IOBConfFull.DeviceConf.ConnectConf.Port} per IOB {IOBConfFull.GenConf.CodIOB}");
|
||||
|
||||
// Creo oggetto connessione NC
|
||||
parentForm.commPlcActive = true;
|
||||
|
||||
// init oggetto
|
||||
oEZNcAutCom = new EZNCAUTLib.DispEZNcCommunication();
|
||||
int.TryParse(IOBConfFull.DeviceConf.ConnectConf.Port, out ezPort);
|
||||
ipAddr = IOBConfFull.DeviceConf.ConnectConf.IpAddr;
|
||||
#if false
|
||||
int.TryParse(IOBConf.cncPort, out ezPort);
|
||||
ipAddr = IOBConf.cncIpAddr;
|
||||
ipAddr = IOBConf.cncIpAddr;
|
||||
#endif
|
||||
|
||||
parentForm.commPlcActive = false;
|
||||
|
||||
@@ -111,7 +147,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
{
|
||||
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con
|
||||
// indicazione area)
|
||||
if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
|
||||
if (!string.IsNullOrEmpty(getOptPar("PZCOUNT_MODE")))
|
||||
{
|
||||
if (getOptPar("PZCOUNT_MODE").StartsWith("STD"))
|
||||
{
|
||||
@@ -394,7 +430,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
|
||||
case taskType.stopSetup:
|
||||
// reset contapezzi fine setup SE ESPLICITAMENTE IMPOSTATO
|
||||
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE")
|
||||
if (IOBConfFull.OptParConf.Count > 0 && getOptPar("ENABLE_PZ_RESET_stopSetup") == "TRUE")
|
||||
{
|
||||
taskOk = resetContapezziPLC();
|
||||
}
|
||||
@@ -568,7 +604,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
}
|
||||
if (utils.CRB("recTime"))
|
||||
{
|
||||
TimingData.addResult(cIobConf.codIOB, string.Format("SYS-INFO"), sw.ElapsedTicks);
|
||||
TimingData.addResult(IOBConfFull.GenConf.CodIOB, string.Format("SYS-INFO"), sw.ElapsedTicks);
|
||||
}
|
||||
return outVal;
|
||||
}
|
||||
@@ -591,7 +627,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
// lettura parametri per procedere
|
||||
ReadMitsubParams();
|
||||
// controllo di AVERE parametri opzionali x conteggi vari
|
||||
if (cIobConf.optPar.Count > 0)
|
||||
if (IOBConfFull.OptParConf.Count > 0)
|
||||
{
|
||||
// contapezzi ATTUALE
|
||||
string memAddr = getOptPar("PZCOUNT_MODE");
|
||||
@@ -648,7 +684,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
ReadMitsubParams();
|
||||
|
||||
// controllo di AVERE parametri opzionali x conteggi vari
|
||||
if (cIobConf.optPar.Count > 0)
|
||||
if (IOBConfFull.OptParConf.Count > 0)
|
||||
{
|
||||
// gestione con ricerca in memoria Write / optPar...
|
||||
if (string.IsNullOrEmpty(memAddrPzReq))
|
||||
@@ -753,7 +789,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
{
|
||||
bool answ = false;
|
||||
// ...SE abilitato da conf IOB
|
||||
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_RESET") == "TRUE")
|
||||
if (getOptPar("ENABLE_PZ_RESET") == "TRUE")
|
||||
{
|
||||
// scrivo valore 0 x il contapezzi
|
||||
try
|
||||
@@ -793,7 +829,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
bool answ = false;
|
||||
string memAddr = memAddrArt;
|
||||
lgTrace($"INIT setNumArt | memAddr: {memAddr}");
|
||||
if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(memAddr))
|
||||
if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrEmpty(memAddr))
|
||||
{
|
||||
// scrivo valore richiesto in area configurata
|
||||
try
|
||||
@@ -818,7 +854,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
// verifico quale modalità sia richiesta
|
||||
string memAddr = memAddrCom;
|
||||
lgTrace($"INIT setNumCom | memAddr: {memAddr}");
|
||||
if (cIobConf.optPar.Count > 0 && !string.IsNullOrEmpty(memAddr))
|
||||
if (IOBConfFull.OptParConf.Count > 0 && !string.IsNullOrEmpty(memAddr))
|
||||
{
|
||||
lgTrace($"setNumCom | memAddr: {memAddr} | valReq: {valReq}");
|
||||
// scrivo valore richiesto in area configurata
|
||||
@@ -843,7 +879,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
{
|
||||
bool answ = false;
|
||||
// ...SE abilitato da conf IOB
|
||||
if (cIobConf.optPar.Count > 0 && getOptPar("ENABLE_PZ_REQ") == "TRUE")
|
||||
if (IOBConfFull.OptParConf.Count > 0 && getOptPar("ENABLE_PZ_REQ") == "TRUE")
|
||||
{
|
||||
// scrivo valore 0 x il contapezzi
|
||||
try
|
||||
@@ -880,7 +916,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
// ora PING!!!
|
||||
Ping pingSender = new Ping();
|
||||
IPAddress address = IPAddress.Loopback;
|
||||
IPAddress.TryParse(cIobConf.cncIpAddr, out address);
|
||||
IPAddress.TryParse(IOBConfFull.DeviceConf.ConnectConf.PingIpAddr, out address);
|
||||
PingReply reply;
|
||||
try
|
||||
{
|
||||
@@ -891,7 +927,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
}
|
||||
else
|
||||
{
|
||||
reply = pingSender.Send(cIobConf.cncIpAddr, 100);
|
||||
reply = pingSender.Send(IOBConfFull.DeviceConf.ConnectConf.IpAddr, 100);
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -944,7 +980,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
connectionOk = false;
|
||||
if (verboseLog || periodicLog)
|
||||
{
|
||||
lgInfo(string.Format("Attenzione: controllo PING fallito per IP {0} - {1}", cIobConf.cncPingAddr, reply.Status));
|
||||
lgInfo($"Attenzione: controllo PING fallito per IP {IOBConfFull.DeviceConf.ConnectConf.PingIpAddr} - {reply.Status}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1840,7 +1876,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
// recording tempi
|
||||
if (utils.CRB("recTime"))
|
||||
{
|
||||
TimingData.addResult(cIobConf.codIOB, $"Sign{SignSize}-R", sw.ElapsedTicks);
|
||||
TimingData.addResult(IOBConfFull.GenConf.CodIOB, $"Sign{SignSize}-R", sw.ElapsedTicks);
|
||||
}
|
||||
sw.Stop();
|
||||
}
|
||||
@@ -1868,7 +1904,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
int iRet = oEZNcAutCom.Parameter_GetData3(0, ParamStart, ParamSize, lAxis, out parValue);
|
||||
if (utils.CRB("recTime"))
|
||||
{
|
||||
TimingData.addResult(cIobConf.codIOB, $"R{ParamSize}-PAR", sw.ElapsedTicks);
|
||||
TimingData.addResult(IOBConfFull.GenConf.CodIOB, $"R{ParamSize}-PAR", sw.ElapsedTicks);
|
||||
}
|
||||
// converto in array di string...
|
||||
string[] rawData = (string[])parValue;
|
||||
@@ -1910,7 +1946,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
}
|
||||
if (utils.CRB("recTime"))
|
||||
{
|
||||
TimingData.addResult(cIobConf.codIOB, $"R{MemVarSize}-VAR", sw.ElapsedTicks);
|
||||
TimingData.addResult(IOBConfFull.GenConf.CodIOB, $"R{MemVarSize}-VAR", sw.ElapsedTicks);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2013,7 +2049,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
lgTrace($"VAR | {memName} Write 02 | memAddr: {memAddr} | valReq: {valReq}");
|
||||
if (utils.CRB("recTime"))
|
||||
{
|
||||
TimingData.addResult(cIobConf.codIOB, "VAR-W", sw.ElapsedTicks);
|
||||
TimingData.addResult(IOBConfFull.GenConf.CodIOB, "VAR-W", sw.ElapsedTicks);
|
||||
}
|
||||
answ = iRet == 0;
|
||||
// se successo --> rileggo!
|
||||
@@ -2042,7 +2078,7 @@ namespace IOB_WIN_MITSUBISHI.Iob
|
||||
lgTrace($"PAR | {memName} Write 02 | memAddr: {memAddr} | valReq: {valReq}");
|
||||
if (utils.CRB("recTime"))
|
||||
{
|
||||
TimingData.addResult(cIobConf.codIOB, "PAR-W", sw.ElapsedTicks);
|
||||
TimingData.addResult(IOBConfFull.GenConf.CodIOB, "PAR-W", sw.ElapsedTicks);
|
||||
}
|
||||
answ = iRet == 0;
|
||||
// se successo --> rileggo!
|
||||
|
||||
@@ -29,19 +29,19 @@ namespace IOB_WIN_SHELLY
|
||||
/// </summary>
|
||||
protected override void loadIobType()
|
||||
{
|
||||
if (IOBConf != null)
|
||||
if (IOBConfFull != null)
|
||||
{
|
||||
switch (tipoScelto)
|
||||
{
|
||||
case tipoAdapter.PingWatchdog:
|
||||
iobObj = new IOB_WIN_FORM.Iob.PingWatchDog(this, IOBConf, IOBConfFull);
|
||||
iobObj = new IOB_WIN_FORM.Iob.PingWatchDog(this, IOBConfFull);
|
||||
btnStart.Enabled = true;
|
||||
break;
|
||||
|
||||
case tipoAdapter.SIMULA:
|
||||
case tipoAdapter.ND:
|
||||
default:
|
||||
iobObj = new IOB_WIN_FORM.Iob.Simula(this, IOBConf, IOBConfFull);
|
||||
iobObj = new IOB_WIN_FORM.Iob.Simula(this, IOBConfFull);
|
||||
btnStart.Enabled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,19 @@ CMD_FORCLE_SPLIT_ODL=/IOB/forceSplitOdlFull/
|
||||
CMD_IDLE_TIME=/IOB/getIdlePeriod/
|
||||
|
||||
[MEMORY]
|
||||
; Green Y62=10098 | Red: Y60=10096 | Yellow: Y61=10097 | Blue Y63=10099 | Emerg: ??? (negata???)|
|
||||
;BIT0=CONN
|
||||
BIT1=10098
|
||||
;BIT2=PZCOUNT.PAR.8002
|
||||
BIT3=10096
|
||||
BIT4=10097
|
||||
;BIT5=!X8.4
|
||||
AREAV_START=500
|
||||
AREAV_SIZE=3
|
||||
PAR_START=8001
|
||||
PAR_SIZE=3
|
||||
SIGN_START=10096
|
||||
SIGN_SIZE=4
|
||||
|
||||
[BLINK]
|
||||
MAX_COUNTER_BLINK = 15
|
||||
@@ -73,6 +86,8 @@ EnabelPodlManFull=true
|
||||
CodGruppoIob=STEAMWARE-SIM-FASE-01
|
||||
; invio flux alla lettura file
|
||||
sendFluxOnRead=true
|
||||
; bit da scrivere come trace ad ogni check
|
||||
MEM_2_TRACE=|BIT3|BIT4|BIT5|
|
||||
|
||||
[BRANCH]
|
||||
NAME=master
|
||||
|
||||
Reference in New Issue
Block a user