Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -10,19 +10,6 @@ namespace MTC_Adapter
|
||||
{
|
||||
public class AdapterFanuc : AdapterGeneric
|
||||
{
|
||||
/// <summary>
|
||||
/// vettore valori in file interscambio
|
||||
/// </summary>
|
||||
public Dictionary<string, string> generalStatus;
|
||||
/// <summary>
|
||||
/// Contenuto valori maintenance data da PLC
|
||||
/// </summary>
|
||||
public otherData[] maintData;
|
||||
/// <summary>
|
||||
/// Contenuto valori status data da PLC
|
||||
/// </summary>
|
||||
public otherData[] statusData;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto MAIN x connessione FANUC
|
||||
/// </summary>
|
||||
@@ -659,7 +646,7 @@ namespace MTC_Adapter
|
||||
}
|
||||
else
|
||||
{
|
||||
Buffer.BlockCopy(MemBlock, 0, AlarmFlags, 0, AlarmFlags.Length);
|
||||
Buffer.BlockCopy(MemBlock, 0, AlarmFlags, i, MemBlock.Length);
|
||||
}
|
||||
|
||||
// segnalo allarme letto! memorizzo allarme nel vettore ack....
|
||||
@@ -890,6 +877,23 @@ namespace MTC_Adapter
|
||||
// verifica se debba salvare e mostrare dati
|
||||
checkSavePersDataLayer();
|
||||
}
|
||||
/// <summary>
|
||||
/// Gestione lettura dati analogici
|
||||
/// </summary>
|
||||
private void getAnalogDataFromPlc()
|
||||
{
|
||||
// recupero i dati di manutenzione dall'area di memoria IN BLOCCO
|
||||
int memIndex = 15000;
|
||||
byte[] tabDatiAnalogByte = new byte[4 * analogData.Length];
|
||||
uint[] tabDatiAnalog = new uint[analogData.Length];
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref tabDatiAnalogByte);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-DatiAnalog", tabDatiAnalogByte.Length*4), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// copio byte --> word!
|
||||
Buffer.BlockCopy(tabDatiAnalogByte, 0, tabDatiAnalog, 0, tabDatiAnalogByte.Length);
|
||||
// decodifico aree memoria secondo tab configurazione
|
||||
processAnalogData(tabDatiAnalog, analogData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gestione lettura dati status da PLC
|
||||
@@ -975,7 +979,8 @@ namespace MTC_Adapter
|
||||
|
||||
// gestisco lettura dati manutenzione da PLC...
|
||||
getMtzDataFromPlc();
|
||||
|
||||
// gestisco lettura dati analogici da PLC...
|
||||
getAnalogDataFromPlc();
|
||||
// gestisco lettura dati status da PLC...
|
||||
getStatusDataFromPlc();
|
||||
}
|
||||
@@ -985,75 +990,8 @@ namespace MTC_Adapter
|
||||
protected override void loadOtherFile()
|
||||
{
|
||||
base.loadOtherFile();
|
||||
loadMaintData();
|
||||
loadStatusData();
|
||||
}
|
||||
/// <summary>
|
||||
/// Lettura file gestione dati manutenzione da PLC
|
||||
/// </summary>
|
||||
private void loadMaintData()
|
||||
{
|
||||
// carico dati x Maintenance
|
||||
if (utils.CRB("verbose")) lg.Info("Inizio caricamento vettore variabili manutenzione gestite");
|
||||
int totRighe = 0;
|
||||
string fileName = string.Format(@"{0}\{1}", utils.confDir, utils.CRS("CounterListFilePath"));
|
||||
string linea;
|
||||
totRighe = File.ReadLines(fileName).Count();
|
||||
// creo un vettore della dimensione corretta... conta anche commenti tanto poi riduco...
|
||||
maintData = new otherData[File.ReadLines(fileName).Count()];
|
||||
// carica da file...
|
||||
System.IO.StreamReader file = new System.IO.StreamReader(fileName);
|
||||
// leggo 1 linea alla volta...
|
||||
int numRiga = 0;
|
||||
while ((linea = file.ReadLine()) != null)
|
||||
{
|
||||
// SE non è un commento...
|
||||
if (linea.Substring(0, 1) != "#")
|
||||
{
|
||||
//elencoAllarmi[rumRiga] = decodeAlarmLine(linea, ':');
|
||||
maintData[numRiga] = decodeOtherData(linea, utils.CRC("testCharSep"), "R", 14000, 4);
|
||||
numRiga++;
|
||||
}
|
||||
}
|
||||
// chiudo file
|
||||
file.Close();
|
||||
// ora trimmo vettore al solo numero VERO dei valori caricati...
|
||||
Array.Resize<otherData>(ref maintData, numRiga);
|
||||
|
||||
if (utils.CRB("verbose")) lg.Info(string.Format("Fine caricamento vettore di {0} variabili manutenzione gestite", numRiga));
|
||||
}
|
||||
/// <summary>
|
||||
/// Lettura file gestione dati status da PLC
|
||||
/// </summary>
|
||||
private void loadStatusData()
|
||||
{
|
||||
// carico dati x Maintenance
|
||||
if (utils.CRB("verbose")) lg.Info("Inizio caricamento vettore variabili status gestite");
|
||||
int totRighe = 0;
|
||||
string fileName = string.Format(@"{0}\{1}", utils.confDir, utils.CRS("StatusListFilePath"));
|
||||
string linea;
|
||||
totRighe = File.ReadLines(fileName).Count();
|
||||
// creo un vettore della dimensione corretta... conta anche commenti tanto poi riduco...
|
||||
statusData = new otherData[File.ReadLines(fileName).Count()];
|
||||
// carica da file...
|
||||
StreamReader file = new StreamReader(fileName);
|
||||
// leggo 1 linea alla volta...
|
||||
int numRiga = 0;
|
||||
while ((linea = file.ReadLine()) != null)
|
||||
{
|
||||
// SE non è un commento...
|
||||
if (linea.Substring(0, 1) != "#")
|
||||
{
|
||||
statusData[numRiga] = decodeBitData(linea, utils.CRC("testCharSep"), "R", 14512, 1, numRiga);
|
||||
numRiga++;
|
||||
}
|
||||
}
|
||||
// chiudo file
|
||||
file.Close();
|
||||
// ora trimmo vettore al solo numero VERO dei valori caricati...
|
||||
Array.Resize<otherData>(ref statusData, numRiga);
|
||||
|
||||
if (utils.CRB("verbose")) lg.Info(string.Format("Fine caricamento vettore di {0} variabili status gestite", numRiga));
|
||||
loadMaintData("R", 14000, 4);
|
||||
loadStatusData("R", 14512, 1);
|
||||
}
|
||||
/// <summary>
|
||||
/// Processing allarmi CNC
|
||||
@@ -1124,8 +1062,6 @@ namespace MTC_Adapter
|
||||
/// </summary>
|
||||
public override void getUnOp()
|
||||
{
|
||||
base.getUnOp();
|
||||
|
||||
// leggo in blocco tutte le speed da memoria...
|
||||
int memIndex = 3140;
|
||||
// buffer memoria 60 byte... speed (16bit 2 * 20) + load (8bit 1 * 20) visto che sono 20 teste max
|
||||
@@ -1134,36 +1070,8 @@ namespace MTC_Adapter
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref unOpSpeedMem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-SPEED_UNOP", unOpSpeedMem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// NON VA: RICHIEDE OPZIONE... The extended driver/library function is necessary.
|
||||
#if false
|
||||
// recupero vettore load spindle...
|
||||
inizio = DateTime.Now;
|
||||
CMSCncLib.Focas1.ODBSPN spindleVect = FANUC_ref.getSpindleLoad();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-SpindleLoad", DateTime.Now.Subtract(inizio).Ticks);
|
||||
#endif
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
int numUnOp = currAdpConf.nUnOp;
|
||||
// cicl su path x leggere le velocità dell'UnOp
|
||||
for (int i = 0; i < numUnOp; i++)
|
||||
{
|
||||
// leggo valore Codice
|
||||
SpeedRate = BitConverter.ToUInt16(unOpSpeedMem, 2 * i);
|
||||
|
||||
// leggo 41° byte = indice 40 + 2*i x le var del carico UnOp
|
||||
UnOpLoad = unOpSpeedMem[40 + i];
|
||||
|
||||
//vettUnOp[i].mUnOpNumCU.Value = uoData.UnOpNumCU;
|
||||
//vettUnOp[i].mUnOpStatus.Value = uoData.UnOpStatus;
|
||||
//vettUnOp[i].mUnOpAccTime.Value = uoData.UnOpAccTime;
|
||||
|
||||
sb.AppendLine(string.Format("SpeedRate UnOp_{0}: {1} rpm", i + 1, SpeedRate));
|
||||
sb.AppendLine(string.Format("Load UnOp_{0}: {1}", i + 1, UnOpLoad));
|
||||
}
|
||||
|
||||
|
||||
parentForm.dataMonitor_1 += sb.ToString();
|
||||
|
||||
procUnOp(unOpSpeedMem);
|
||||
}
|
||||
/// <summary>
|
||||
/// Procedura di processing lettura memoria x DatiUt - Step 4
|
||||
|
||||
@@ -742,6 +742,10 @@ namespace MTC_Adapter
|
||||
/// </summary>
|
||||
public double[] istDistMovAssi;
|
||||
/// <summary>
|
||||
/// Vettore ISTANTANEO dei contatori del LOAD degli assi
|
||||
/// </summary>
|
||||
public double[] istLoadAssi;
|
||||
/// <summary>
|
||||
/// Vettore ISTANTANEO dei contatori del tempo cumulato degli assi
|
||||
/// </summary>
|
||||
public double[] istAccTimeAssi;
|
||||
@@ -786,6 +790,23 @@ namespace MTC_Adapter
|
||||
/// </summary>
|
||||
public uint[] istProtMag;
|
||||
|
||||
/// <summary>
|
||||
/// vettore valori in file interscambio
|
||||
/// </summary>
|
||||
public Dictionary<string, string> generalStatus;
|
||||
/// <summary>
|
||||
/// Contenuto valori contatori manutenzione da PLC
|
||||
/// </summary>
|
||||
public otherData[] maintData;
|
||||
/// <summary>
|
||||
/// Contenuto valori variabili analogiche da PLC
|
||||
/// </summary>
|
||||
public otherData[] analogData;
|
||||
/// <summary>
|
||||
/// Contenuto valori status data da PLC
|
||||
/// </summary>
|
||||
public otherData[] statusData;
|
||||
|
||||
/// <summary>
|
||||
/// data-ora ultimo controllo movimento assi
|
||||
/// </summary>
|
||||
@@ -1336,6 +1357,114 @@ namespace MTC_Adapter
|
||||
protected virtual void loadOtherFile()
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Lettura file gestione dati manutenzione da PLC
|
||||
/// </summary>
|
||||
/// <param name="memPre"></param>
|
||||
/// <param name="baseAddr"></param>
|
||||
/// <param name="memSize"></param>
|
||||
public void loadMaintData(string memPre, int baseAddr, int memSize)
|
||||
{
|
||||
// carico dati x Maintenance
|
||||
if (utils.CRB("verbose")) lg.Info("Inizio caricamento vettore variabili manutenzione gestite");
|
||||
int totRighe = 0;
|
||||
string fileName = string.Format(@"{0}\{1}", utils.confDir, utils.CRS("CounterListFilePath"));
|
||||
string linea;
|
||||
totRighe = File.ReadLines(fileName).Count();
|
||||
// creo un vettore della dimensione corretta... conta anche commenti tanto poi riduco...
|
||||
maintData = new otherData[File.ReadLines(fileName).Count()];
|
||||
// carica da file...
|
||||
StreamReader file = new StreamReader(fileName);
|
||||
// leggo 1 linea alla volta...
|
||||
int numRiga = 0;
|
||||
while ((linea = file.ReadLine()) != null)
|
||||
{
|
||||
// SE non è un commento...
|
||||
if (linea.Substring(0, 1) != "#")
|
||||
{
|
||||
maintData[numRiga] = decodeOtherData(linea, utils.CRC("testCharSep"), memPre, baseAddr, memSize);
|
||||
numRiga++;
|
||||
}
|
||||
}
|
||||
// chiudo file
|
||||
file.Close();
|
||||
// ora trimmo vettore al solo numero VERO dei valori caricati...
|
||||
Array.Resize<otherData>(ref maintData, numRiga);
|
||||
|
||||
if (utils.CRB("verbose")) lg.Info(string.Format("Fine caricamento vettore di {0} variabili manutenzione gestite", numRiga));
|
||||
}
|
||||
/// <summary>
|
||||
/// Lettura file gestione dati analogici da PLC
|
||||
/// </summary>
|
||||
/// <param name="memPre"></param>
|
||||
/// <param name="baseAddr"></param>
|
||||
/// <param name="memSize"></param>
|
||||
public void loadAnalogData(string memPre, int baseAddr, int memSize)
|
||||
{
|
||||
// carico dati x Maintenance
|
||||
if (utils.CRB("verbose")) lg.Info("Inizio caricamento vettore variabili analogiche gestite");
|
||||
int totRighe = 0;
|
||||
string fileName = string.Format(@"{0}\{1}", utils.confDir, utils.CRS("AnalogDataFilePath"));
|
||||
string linea;
|
||||
totRighe = File.ReadLines(fileName).Count();
|
||||
// creo un vettore della dimensione corretta... conta anche commenti tanto poi riduco...
|
||||
analogData = new otherData[File.ReadLines(fileName).Count()];
|
||||
// carica da file...
|
||||
StreamReader file = new StreamReader(fileName);
|
||||
// leggo 1 linea alla volta...
|
||||
int numRiga = 0;
|
||||
while ((linea = file.ReadLine()) != null)
|
||||
{
|
||||
// SE non è un commento...
|
||||
if (linea.Substring(0, 1) != "#")
|
||||
{
|
||||
analogData[numRiga] = decodeOtherData(linea, utils.CRC("testCharSep"), memPre, baseAddr, memSize);
|
||||
numRiga++;
|
||||
}
|
||||
}
|
||||
// chiudo file
|
||||
file.Close();
|
||||
// ora trimmo vettore al solo numero VERO dei valori caricati...
|
||||
Array.Resize<otherData>(ref analogData, numRiga);
|
||||
|
||||
if (utils.CRB("verbose")) lg.Info(string.Format("Fine caricamento vettore di {0} variabili analogiche gestite", numRiga));
|
||||
}
|
||||
/// <summary>
|
||||
/// Lettura file gestione dati status da PLC
|
||||
/// </summary>
|
||||
/// <param name="memPre"></param>
|
||||
/// <param name="baseAddr"></param>
|
||||
/// <param name="memSize"></param>
|
||||
public void loadStatusData(string memPre, int baseAddr, int memSize)
|
||||
{
|
||||
// carico dati x Maintenance
|
||||
if (utils.CRB("verbose")) lg.Info("Inizio caricamento vettore variabili status gestite");
|
||||
int totRighe = 0;
|
||||
string fileName = string.Format(@"{0}\{1}", utils.confDir, utils.CRS("StatusListFilePath"));
|
||||
string linea;
|
||||
totRighe = File.ReadLines(fileName).Count();
|
||||
// creo un vettore della dimensione corretta... conta anche commenti tanto poi riduco...
|
||||
statusData = new otherData[File.ReadLines(fileName).Count()];
|
||||
// carica da file...
|
||||
StreamReader file = new StreamReader(fileName);
|
||||
// leggo 1 linea alla volta...
|
||||
int numRiga = 0;
|
||||
while ((linea = file.ReadLine()) != null)
|
||||
{
|
||||
// SE non è un commento...
|
||||
if (linea.Substring(0, 1) != "#")
|
||||
{
|
||||
statusData[numRiga] = decodeBitData(linea, utils.CRC("testCharSep"), memPre, baseAddr, memSize, numRiga);
|
||||
numRiga++;
|
||||
}
|
||||
}
|
||||
// chiudo file
|
||||
file.Close();
|
||||
// ora trimmo vettore al solo numero VERO dei valori caricati...
|
||||
Array.Resize<otherData>(ref statusData, numRiga);
|
||||
|
||||
if (utils.CRB("verbose")) lg.Info(string.Format("Fine caricamento vettore di {0} variabili status gestite", numRiga));
|
||||
}
|
||||
/// <summary>
|
||||
/// caricamento allarmi da file
|
||||
@@ -1486,47 +1615,54 @@ namespace MTC_Adapter
|
||||
|
||||
public void loadPersData()
|
||||
{
|
||||
// nuova lettura valori da file persistenza...
|
||||
contOreMaccOn = getStoredValDouble("ACC_TIME");
|
||||
contOreMaccLav = getStoredValDouble("ACC_TIME_WORK");
|
||||
contSlittaTast = getStoredValDouble("SlittaTastatore_Count");
|
||||
|
||||
for (int i = 0; i < currAdpConf.nUnOp; i++)
|
||||
try
|
||||
{
|
||||
contGiriElettrom[i] = getStoredValUInt(string.Format("UnOp_{0:00}_AccTime", i + 1));
|
||||
currNumCambiUt[i] = getStoredValUInt(string.Format("UnOp_{0:00}_NumCU", i + 1));
|
||||
// nuova lettura valori da file persistenza...
|
||||
contOreMaccOn = getStoredValDouble("ACC_TIME");
|
||||
contOreMaccLav = getStoredValDouble("ACC_TIME_WORK");
|
||||
contSlittaTast = getStoredValDouble("SlittaTastatore_Count");
|
||||
|
||||
for (int i = 0; i < currAdpConf.nUnOp; i++)
|
||||
{
|
||||
contGiriElettrom[i] = getStoredValUInt(string.Format("UnOp_{0:00}_AccTime", i + 1));
|
||||
currNumCambiUt[i] = getStoredValUInt(string.Format("UnOp_{0:00}_NumCU", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nAxis; i++)
|
||||
{
|
||||
contDistMovAssi[i] = getStoredValUInt(string.Format("Axis_{0:00}_DistDone", i + 1));
|
||||
contNumInvAssi[i] = getStoredValUInt(string.Format("Axis_{0:00}_InvDDone", i + 1));
|
||||
contAccTimeAssi[i] = getStoredValDouble(string.Format("Axis_{0:00}_AccTime", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nVacuumPump; i++)
|
||||
{
|
||||
currVacPumpWrkTime[i] = getStoredValUInt(string.Format("VacPump_{0:00}_WrkTime", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nVacuumAct; i++)
|
||||
{
|
||||
currVacActCount[i] = getStoredValUInt(string.Format("VacAct_{0:00}_Count", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nLubro; i++)
|
||||
{
|
||||
currLubroCount[i] = getStoredValUInt(string.Format("Lubro_{0:00}_Count", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nSlittaMag; i++)
|
||||
{
|
||||
currSlittaMag[i] = getStoredValUInt(string.Format("SlittaMagazzino_{0:00}_Count", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nProtMag; i++)
|
||||
{
|
||||
currProtMag[i] = getStoredValUInt(string.Format("ProtMagazzino_{0:00}_Count", i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nAxis; i++)
|
||||
catch (Exception exc)
|
||||
{
|
||||
contDistMovAssi[i] = getStoredValUInt(string.Format("Axis_{0:00}_DistDone", i + 1));
|
||||
contNumInvAssi[i] = getStoredValUInt(string.Format("Axis_{0:00}_InvDDone", i + 1));
|
||||
contAccTimeAssi[i] = getStoredValDouble(string.Format("Axis_{0:00}_AccTime", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nVacuumPump; i++)
|
||||
{
|
||||
currVacPumpWrkTime[i] = getStoredValUInt(string.Format("VacPump_{0:00}_WrkTime", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nVacuumAct; i++)
|
||||
{
|
||||
currVacActCount[i] = getStoredValUInt(string.Format("VacAct_{0:00}_Count", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nLubro; i++)
|
||||
{
|
||||
currLubroCount[i] = getStoredValUInt(string.Format("Lubro_{0:00}_Count", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nSlittaMag; i++)
|
||||
{
|
||||
currSlittaMag[i] = getStoredValUInt(string.Format("SlittaMagazzino_{0:00}_Count", i + 1));
|
||||
}
|
||||
|
||||
for (int i = 0; i < currAdpConf.nProtMag; i++)
|
||||
{
|
||||
currProtMag[i] = getStoredValUInt(string.Format("ProtMagazzino_{0:00}_Count", i + 1));
|
||||
lg.Error(string.Format("Eccezione in decodifica valori PersLayer: {0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1583,6 +1719,7 @@ namespace MTC_Adapter
|
||||
// imposto num assi e leggo valori salvati...
|
||||
contDistMovAssi = new double[currAdpConf.nAxis];
|
||||
istDistMovAssi = new double[currAdpConf.nAxis];
|
||||
istLoadAssi = new double[currAdpConf.nAxis];
|
||||
contNumInvAssi = new uint[currAdpConf.nAxis];
|
||||
istAccTimeAssi = new double[currAdpConf.nAxis];
|
||||
contAccTimeAssi = new double[currAdpConf.nAxis];
|
||||
@@ -2005,13 +2142,34 @@ namespace MTC_Adapter
|
||||
/// </summary>
|
||||
public virtual void getUnOp()
|
||||
{
|
||||
// cicl su UnOp
|
||||
for (int i = 0; i < currAdpConf.nUnOp; i++)
|
||||
}
|
||||
/// <summary>
|
||||
/// Processing dati UnOp
|
||||
/// </summary>
|
||||
/// <param name="unOpSpeedMem"></param>
|
||||
public void procUnOp(byte[] unOpSpeedMem)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
int numUnOp = currAdpConf.nUnOp;
|
||||
// cicl su path x leggere le velocità dell'UnOp
|
||||
for (int i = 0; i < numUnOp; i++)
|
||||
{
|
||||
// leggo valore Codice
|
||||
SpeedRate = BitConverter.ToUInt16(unOpSpeedMem, 2 * i);
|
||||
|
||||
// leggo 41° byte = indice 40 + 2*i x le var del carico UnOp
|
||||
UnOpLoad = unOpSpeedMem[40 + i];
|
||||
|
||||
vettUnOp[i].mUnOpSpeed.Value = SpeedRate;
|
||||
vettUnOp[i].mUnOpSpeedOverr.Value = SpeedRateOver;
|
||||
vettUnOp[i].mUnOpLoad.Value = UnOpLoad;
|
||||
vettUnOp[i].mUnOpSpeedOverr.Value = SpeedRateOver;
|
||||
|
||||
sb.AppendLine(string.Format("UnOp_{0}: SpeedRate {1} rpm | Load {2}", i + 1, SpeedRate, UnOpLoad));
|
||||
}
|
||||
|
||||
|
||||
parentForm.dataMonitor_2 += sb.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// recupero dati ASSI
|
||||
@@ -2333,6 +2491,39 @@ namespace MTC_Adapter
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Processa la tabella di memoria dei dati analogici
|
||||
/// </summary>
|
||||
/// <param name="tabDatiAnag"></param>
|
||||
/// <param name="analogData"></param>
|
||||
public void processAnalogData(uint[] tabDatiAnag, otherData[] analogData)
|
||||
{
|
||||
// uno ad uno vado a inserirli nella mappa dei dati dell'adapter...
|
||||
int numero = 0;
|
||||
uint valRead = 0;
|
||||
for (int i = 0; i < analogData.Length; i++)
|
||||
{
|
||||
numero = 0;
|
||||
valRead = 0;
|
||||
// decodifico...
|
||||
if (analogData[i].varName.StartsWith("Axis_"))
|
||||
{
|
||||
if (analogData[i].varName.EndsWith("_Load"))
|
||||
{
|
||||
try
|
||||
{
|
||||
numero = Convert.ToInt32(analogData[i].varName.Replace("Axis_", "").Replace("_Load", ""));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (numero > 0)
|
||||
{
|
||||
istLoadAssi[numero - 1] = tabDatiAnag[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// processa dataLayer e se necessario salva/mostra
|
||||
/// </summary>
|
||||
public void checkSavePersDataLayer()
|
||||
@@ -3329,8 +3520,10 @@ namespace MTC_Adapter
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Error(string.Format("Eccezione in getStoredVal: {0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -3345,8 +3538,10 @@ namespace MTC_Adapter
|
||||
{
|
||||
answ = Convert.ToUInt32(getStoredVal(keyVal));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Error(string.Format("Eccezione in getStoredValUInt: {0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -3377,8 +3572,10 @@ namespace MTC_Adapter
|
||||
{
|
||||
answ = Convert.ToDouble(getStoredVal(keyVal));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Error(string.Format("Eccezione in getStoredValDouble: {0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,18 +10,6 @@ namespace MTC_Adapter
|
||||
{
|
||||
public class AdapterOsai : AdapterGeneric
|
||||
{
|
||||
/// <summary>
|
||||
/// vettore valori in file interscambio
|
||||
/// </summary>
|
||||
public Dictionary<string, string> generalStatus;
|
||||
/// <summary>
|
||||
/// Contenuto valori maintenance data da PLC
|
||||
/// </summary>
|
||||
public otherData[] maintData;
|
||||
/// <summary>
|
||||
/// Contenuto valori status data da PLC
|
||||
/// </summary>
|
||||
public otherData[] statusData;
|
||||
/// <summary>
|
||||
/// Oggetto MAIN x connessione OSAI
|
||||
/// </summary>
|
||||
@@ -167,7 +155,8 @@ namespace MTC_Adapter
|
||||
/// <summary>
|
||||
/// Vettore degli allarmi CNC attivi
|
||||
/// </summary>
|
||||
public CMSCncLib.OPENcontrol.MSGERROR allarmiCNC;
|
||||
//public CMSCncLib.OPENcontrol.MSGERROR allarmiCNC;
|
||||
public Dictionary<string, string> allarmiCNC =new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// estende l'init della classe base...
|
||||
/// </summary>
|
||||
@@ -1110,6 +1099,20 @@ namespace MTC_Adapter
|
||||
// verifica se debba salvare e mostrare dati
|
||||
checkSavePersDataLayer();
|
||||
}
|
||||
/// <summary>
|
||||
/// Gestione lettura dati analogici
|
||||
/// </summary>
|
||||
private void getAnalogDataFromPlc()
|
||||
{
|
||||
// recupero i dati di manutenzione dall'area di memoria IN BLOCCO
|
||||
int memIndex = 19434;
|
||||
uint[] tabDatiAnalog = new uint[analogData.Length];
|
||||
inizio = DateTime.Now;
|
||||
OsaiMemRW_DWord(R, OSAI.MemTypeWord.MW_CODE, memIndex, ref tabDatiAnalog);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-DatiAnalog", tabDatiAnalog.Length * 4), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// decodifico aree memoria secondo tab configurazione
|
||||
processAnalogData(tabDatiAnalog, analogData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gestione lettura dati status da PLC
|
||||
@@ -1181,13 +1184,32 @@ namespace MTC_Adapter
|
||||
// se ho allarmi li accodo...
|
||||
if (allNcData.lastncerror != 0)
|
||||
{
|
||||
sb1.AppendLine(string.Format("Allarmi CNC: {0}", allNcData.lastncerror));
|
||||
|
||||
inizio = DateTime.Now;
|
||||
OSAI_ref.O_ReadCurrentErrorMsg(ref allarmiCNC);
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-CNC-ERROR-MSG", DateTime.Now.Subtract(inizio).Ticks);
|
||||
checkCNCAlarms();
|
||||
if (utils.CRI("loglevel") > 5)
|
||||
{
|
||||
lg.Info(string.Format("Allarmi CNC: {0} ", allNcData.lastncerror));
|
||||
}
|
||||
string alarmText = string.Format("CNC Alarm - Cod: {0}", allNcData.lastncerror);
|
||||
|
||||
allarmiCNC.Add(allNcData.lastncerror.ToString(), alarmText);
|
||||
// 2017.05.09 gestione allarmi commentata
|
||||
#if false
|
||||
mAlarmCNC.Add(MTConnect.Condition.Level.FAULT, alarmText, allNcData.lastncerror.ToString(), "", "");
|
||||
// mostro in form!
|
||||
sb1.AppendLine(alarmText);
|
||||
parentForm.dataMonitor_1 += sb1.ToString();
|
||||
#endif
|
||||
|
||||
// 2017.05.09 gestione allarmi commentata
|
||||
#if false
|
||||
// il codice è corretto (manca prima aprte codice + traduzione), se cerco di trovare oggett completo NON c'è, verificare con Andrea...
|
||||
sb1.AppendLine(string.Format("Allarmi CNC: {0}", allNcData.lastncerror));
|
||||
|
||||
inizio = DateTime.Now;
|
||||
OSAI_ref.O_ReadCurrentErrorMsg(ref allarmiCNC);
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-CNC-ERROR-MSG", DateTime.Now.Subtract(inizio).Ticks);
|
||||
checkCNCAlarms();
|
||||
#endif
|
||||
#if false
|
||||
// provo altri metodi...
|
||||
CMSCncLib.OPENcontrol.MSGEMERGENCY emergCNC = new CMSCncLib.OPENcontrol.MSGEMERGENCY();
|
||||
@@ -1198,11 +1220,14 @@ namespace MTC_Adapter
|
||||
}
|
||||
else
|
||||
{
|
||||
allarmiCNC = new CMSCncLib.OPENcontrol.MSGERROR();
|
||||
allarmiCNC.Clear();
|
||||
allarmiCNC = new Dictionary<string, string>();
|
||||
// 2017.05.09 gestione allarmi commentata
|
||||
//allarmiCNC = new CMSCncLib.OPENcontrol.MSGERROR();
|
||||
}
|
||||
|
||||
// accodo dati base!
|
||||
parentForm.dataMonitor_1 = sb1.ToString();
|
||||
parentForm.dataMonitor_1 += sb1.ToString();
|
||||
// accodo dati UT...
|
||||
for (int i = 0; i < currAdpConf.nUnOp; i++)
|
||||
{
|
||||
@@ -1212,7 +1237,8 @@ namespace MTC_Adapter
|
||||
|
||||
// gestisco lettura dati manutenzione da PLC...
|
||||
getMtzDataFromPlc();
|
||||
|
||||
// gestisco lettura dati analogici da PLC...
|
||||
getAnalogDataFromPlc();
|
||||
// gestisco lettura dati status da PLC...
|
||||
getStatusDataFromPlc();
|
||||
}
|
||||
@@ -1246,75 +1272,11 @@ namespace MTC_Adapter
|
||||
protected override void loadOtherFile()
|
||||
{
|
||||
base.loadOtherFile();
|
||||
loadMaintData();
|
||||
loadStatusData();
|
||||
}
|
||||
/// <summary>
|
||||
/// Lettura file gestione dati manutenzione da PLC
|
||||
/// </summary>
|
||||
private void loadMaintData()
|
||||
{
|
||||
// carico dati x Maintenance
|
||||
if (utils.CRB("verbose")) lg.Info("Inizio caricamento vettore variabili manutenzione gestite");
|
||||
int totRighe = 0;
|
||||
string fileName = string.Format(@"{0}\{1}", utils.confDir, utils.CRS("CounterListFilePath"));
|
||||
string linea;
|
||||
totRighe = File.ReadLines(fileName).Count();
|
||||
// creo un vettore della dimensione corretta... conta anche commenti tanto poi riduco...
|
||||
maintData = new otherData[File.ReadLines(fileName).Count()];
|
||||
// carica da file...
|
||||
System.IO.StreamReader file = new System.IO.StreamReader(fileName);
|
||||
// leggo 1 linea alla volta...
|
||||
int numRiga = 0;
|
||||
while ((linea = file.ReadLine()) != null)
|
||||
{
|
||||
// SE non è un commento...
|
||||
if (linea.Substring(0, 1) != "#")
|
||||
{
|
||||
//elencoAllarmi[rumRiga] = decodeAlarmLine(linea, ':');
|
||||
maintData[numRiga] = decodeOtherData(linea, utils.CRC("testCharSep"), "MW", 19166, 2);
|
||||
numRiga++;
|
||||
}
|
||||
}
|
||||
// chiudo file
|
||||
file.Close();
|
||||
// ora trimmo vettore al solo numero VERO dei valori caricati...
|
||||
Array.Resize<otherData>(ref maintData, numRiga);
|
||||
|
||||
if (utils.CRB("verbose")) lg.Info(string.Format("Fine caricamento vettore di {0} variabili manutenzione gestite", numRiga));
|
||||
}
|
||||
/// <summary>
|
||||
/// Lettura file gestione dati status da PLC
|
||||
/// </summary>
|
||||
private void loadStatusData()
|
||||
{
|
||||
// carico dati x Maintenance
|
||||
if (utils.CRB("verbose")) lg.Info("Inizio caricamento vettore variabili status gestite");
|
||||
int totRighe = 0;
|
||||
string fileName = string.Format(@"{0}\{1}", utils.confDir, utils.CRS("StatusListFilePath"));
|
||||
string linea;
|
||||
totRighe = File.ReadLines(fileName).Count();
|
||||
// creo un vettore della dimensione corretta... conta anche commenti tanto poi riduco...
|
||||
statusData = new otherData[File.ReadLines(fileName).Count()];
|
||||
// carica da file...
|
||||
StreamReader file = new StreamReader(fileName);
|
||||
// leggo 1 linea alla volta...
|
||||
int numRiga = 0;
|
||||
while ((linea = file.ReadLine()) != null)
|
||||
{
|
||||
// SE non è un commento...
|
||||
if (linea.Substring(0, 1) != "#")
|
||||
{
|
||||
statusData[numRiga] = decodeBitData(linea, utils.CRC("testCharSep"), "ML", 19426, 2, numRiga);
|
||||
numRiga++;
|
||||
}
|
||||
}
|
||||
// chiudo file
|
||||
file.Close();
|
||||
// ora trimmo vettore al solo numero VERO dei valori caricati...
|
||||
Array.Resize<otherData>(ref statusData, numRiga);
|
||||
|
||||
if (utils.CRB("verbose")) lg.Info(string.Format("Fine caricamento vettore di {0} variabili status gestite", numRiga));
|
||||
//loadMaintData("MW", 19166, 2);
|
||||
loadMaintData("GL", 500, 1);
|
||||
loadStatusData("M", 19426, 1);
|
||||
//loadAnalogData("ML", 19434, 2);
|
||||
loadAnalogData("ML", 9717, 1);
|
||||
}
|
||||
/// <summary>
|
||||
/// Processing allarmi CNC
|
||||
@@ -1336,6 +1298,39 @@ namespace MTC_Adapter
|
||||
sendAlarmIfPresent(allarmiCNC);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Invia singolo allarme CNC se presente (da dictionary)
|
||||
/// </summary>
|
||||
/// <param name="allarmi"></param>
|
||||
protected void sendAlarmIfPresent(Dictionary<string, string> allarmi)
|
||||
{
|
||||
// controllo valore...
|
||||
if (allarmi != null && allarmi.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (KeyValuePair<string, string> item in allarmi)
|
||||
{
|
||||
string alarmText = string.Format("{0} - {1}", item.Key, item.Value);
|
||||
if (utils.CRI("loglevel") > 5)
|
||||
{
|
||||
lg.Info(string.Format("Allarme CNC: {0}", alarmText));
|
||||
}
|
||||
mAlarmCNC.Add(MTConnect.Condition.Level.FAULT, alarmText, item.Key, "", "");
|
||||
// mostro in form!
|
||||
sb.AppendLine(alarmText);
|
||||
}
|
||||
parentForm.dataMonitor_1 += sb.ToString();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Error(string.Format("{0}", exc));
|
||||
}
|
||||
}
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Invia singolo allarme CNC se presente
|
||||
/// </summary>
|
||||
@@ -1363,48 +1358,25 @@ namespace MTC_Adapter
|
||||
lg.Error(string.Format("{0}", exc));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// Recupero dati x UnOp
|
||||
/// </summary>
|
||||
public override void getUnOp()
|
||||
{
|
||||
base.getUnOp();
|
||||
// !!!FARE!!! NON HO trovato nulla, verificare con Andrea...
|
||||
#if false
|
||||
|
||||
// leggo in blocco tutte le speed da memoria...
|
||||
int memIndex = 3140;
|
||||
int memIndex = 2950;
|
||||
// buffer memoria 60 byte... speed (16bit 2 * 20) + load (8bit 1 * 20) visto che sono 20 teste max
|
||||
byte[] unOpSpeedMem = new byte[60];
|
||||
|
||||
ushort[] unOpSpeedMemW = new ushort[30];
|
||||
inizio = DateTime.Now;
|
||||
OsaiMemRW(R, FANUC.MemType.D, memIndex, ref unOpSpeedMem);
|
||||
OsaiMemRW_Word(R, OSAI.MemTypeWord.MW_CODE, memIndex, ref unOpSpeedMemW);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-SPEED_UNOP", unOpSpeedMem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
int numUnOp = currAdpConf.nUnOp;
|
||||
// cicl su path x leggere le velocità dell'UnOp
|
||||
for (int i = 0; i < numUnOp; i++)
|
||||
{
|
||||
// leggo valore Codice
|
||||
SpeedRate = BitConverter.ToUInt16(unOpSpeedMem, 2 * i);
|
||||
|
||||
// leggo 41° byte = indice 40 + 2*i x le var del carico UnOp
|
||||
UnOpLoad = unOpSpeedMem[40 + i];
|
||||
|
||||
//vettUnOp[i].mUnOpNumCU.Value = uoData.UnOpNumCU;
|
||||
//vettUnOp[i].mUnOpStatus.Value = uoData.UnOpStatus;
|
||||
//vettUnOp[i].mUnOpAccTime.Value = uoData.UnOpAccTime;
|
||||
|
||||
sb.AppendLine(string.Format("SpeedRate UnOp_{0}: {1} rpm", i + 1, SpeedRate));
|
||||
sb.AppendLine(string.Format("Load UnOp_{0}: {1}", i + 1, UnOpLoad));
|
||||
}
|
||||
|
||||
|
||||
parentForm.dataMonitor += sb.ToString();
|
||||
#endif
|
||||
// travaso in modalità byte...
|
||||
Buffer.BlockCopy(unOpSpeedMemW, 0, unOpSpeedMem, 0, unOpSpeedMem.Length);
|
||||
procUnOp(unOpSpeedMem);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1512,19 +1484,7 @@ namespace MTC_Adapter
|
||||
}
|
||||
}
|
||||
|
||||
// NON ci sono nella documentazione GCode OneShot, verificare con Andrea...
|
||||
#if false
|
||||
inizio = DateTime.Now;
|
||||
vettGCodes = OSAI_ref.getPathGCode1Shot();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-GCodOneShot", DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (vettGCodes.gcd0.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd0.code);
|
||||
if (vettGCodes.gcd1.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd1.code);
|
||||
if (vettGCodes.gcd2.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd2.code);
|
||||
if (vettGCodes.gcd3.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd3.code);
|
||||
|
||||
#endif
|
||||
|
||||
// NON ci sono nella documentazione metodi x recuperare posizione PuntaUtensile, verificare con Andrea...
|
||||
// NON ci sono nella documentazione metodi x recuperare posizione PuntaUtensile, in attesa news da OSAI/Andrea...
|
||||
#if false
|
||||
|
||||
inizio = DateTime.Now;
|
||||
@@ -1585,13 +1545,6 @@ namespace MTC_Adapter
|
||||
OSAI_ref.getAllAxisPos(2, ref posAssi);
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-AXIS_POS", DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// NON c'è LOAD assi... verificare con Andrea
|
||||
#if false
|
||||
inizio = DateTime.Now;
|
||||
CMSCncLib.Focas1.ODBSVLOAD loadAssi = OSAI_ref.getAllAxisLoad();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-AXIS_LOAD", DateTime.Now.Subtract(inizio).Ticks);
|
||||
#endif
|
||||
|
||||
// nuova posizione (per calcoli)
|
||||
double newPos = 0;
|
||||
double newPosTgt = 0;
|
||||
@@ -1610,11 +1563,9 @@ namespace MTC_Adapter
|
||||
axName = Convert.ToChar(posAssiTgt[i].AxisName);
|
||||
newPos = posAssi[i].position;
|
||||
newPosTgt = posAssiTgt[i].position;
|
||||
// popolo valori... tranne LOAD
|
||||
#if false
|
||||
vettAxis[i].mAxLoad.Value = (double)(valLoad.data) / Math.Pow(10, valLoad.dec);
|
||||
newPos = (double)(valPos.abs.data) / Math.Pow(10, valPos.abs.dec);
|
||||
#endif
|
||||
|
||||
// popolo valori... LOAD gestito da vettore letto con area memoria AnalogData.map
|
||||
vettAxis[i].mAxLoad.Value = istLoadAssi[i];
|
||||
|
||||
vettAxis[i].mAxPosAct.Value = newPos;
|
||||
vettAxis[i].mAxPosTgt.Value = newPosTgt;
|
||||
@@ -1651,19 +1602,14 @@ namespace MTC_Adapter
|
||||
|
||||
if (utils.CRB("verbose"))
|
||||
{
|
||||
sb.AppendLine(string.Format("Asse {0}: PosAct:{1:N3}, Prg:{2:N3} | {3}", axName, newPos, newPosTgt, direzione));
|
||||
sb.AppendLine(string.Format("Asse {0}: PosAct:{1:N3} | Prg:{2:N3} | Load:{3:N1} | {4}", axName, newPos, newPosTgt, istLoadAssi[i], direzione));
|
||||
}
|
||||
|
||||
// salvo valori vettore prec...
|
||||
prevPosAxis[i] = newPos;
|
||||
prevDirAxis[i] = newDir;
|
||||
|
||||
//vettAxis[i].mAxMainProc.Value = AxData.AxisMainProc;
|
||||
//vettAxis[i].mAxIsMaster.Value = AxData.AxisIsMaster;
|
||||
//vettAxis[i].mAxMastId.Value = AxData.AxisMastId;
|
||||
|
||||
vettAxis[i].mAxFeedOver.Value = FeedRateOver;
|
||||
//vettAxis[i].mAxAccelAct.Value = AxData.AxisAccel;
|
||||
//vettAxis[i].mAxBattery.Value = AxData.AxisBattery;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -1275,7 +1275,6 @@ namespace MTC_Adapter
|
||||
}
|
||||
else
|
||||
{
|
||||
mAlarmCNC.Add(MTConnect.Condition.Level.FAULT, allarme.alm_msg, codAllarme, "", "");
|
||||
vettAxis[allarme.axis - 1].mAxAlarmCNC.Add(MTConnect.Condition.Level.FAULT, allarme.alm_msg, codAllarme, "", "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
<!-- For more information on using app.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<appSettings>
|
||||
<add key="loglevel" value="5" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
|
||||
<!--<add key="loglevel" value="5" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
|
||||
<add key="mode" value="prod" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
|
||||
<add key="autoLoadConf" value="true" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
|
||||
<add key="defaultConfFile" value="Adapter_ItemList.xml" xdt:Transform="Replace" xdt:Locator="Match(key)"/>-->
|
||||
<add key="autoLoadConf" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
|
||||
<add key="defaultConfFile" value="Adapter_ItemList.xml" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
|
||||
</appSettings>
|
||||
</configuration>
|
||||
@@ -25,14 +25,14 @@
|
||||
ipPLC = "192.168.139.100"-->
|
||||
<!--<add key="ipPLC" value="192.168.139.100" />-->
|
||||
<!--<add key="ipPLC" value="192.168.139.1" />-->
|
||||
<!--Sviluppo Steamware
|
||||
<!--<add key="ipPLC" value="192.168.157.2"/>-->
|
||||
<!--Sviluppo Steamware
|
||||
IP ETH: 10.74.82.110/255.255.255.0
|
||||
ipPLC = "10.74.82.110"-->
|
||||
<add key="ipPLC" value="192.168.157.2"/>
|
||||
<!--PRODUZIONE
|
||||
IP ETH: 192.168.139.201/255.255.255.0
|
||||
ipPLC = "192.168.139.1"-->
|
||||
<!--<add key ="ipPLC" value="192.168.139.1" />-->
|
||||
<add key="ipPLC" value="192.168.157.2"/>
|
||||
<!--OSAI DEV-->
|
||||
<!--<add key ="ipPLC" value="192.168.157.2" />-->
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<add key="windowCanMax" value="true"/>
|
||||
<add key="trayClose" value="true"/>
|
||||
<add key="autoSaveSec" value="60"/>
|
||||
<add key="waitRecMSec" value="10000"/>
|
||||
<add key="waitRecMSec" value="5000"/>
|
||||
<add key="testCharSep" value="|"/>
|
||||
<add key="fattdecimale" value="1000"/>
|
||||
<add key="fattConvDistAssi" value="1000"/>
|
||||
@@ -64,6 +64,7 @@
|
||||
<add key="maxNumDD" value="30"/>
|
||||
<add key="defaultEsaFile" value="EsaKvara.ini"/>
|
||||
<add key="CounterListFilePath" value="CounterList.map"/>
|
||||
<add key="AnalogDataFilePath" value="AnalogData.map"/>
|
||||
<add key="StatusListFilePath" value="StatusList.map"/>
|
||||
<add key="SubModeListFilePath" value="SubModeList.map"/>
|
||||
<!--conf gestione "semplificata" accesso a tutta la memoria ogni volta-->
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Commenti con cancelletto, struttura un variabile per riga, tipo chiave|valore (occhio che il separatore è configurato da .cofig come "testCharSep"); spazi e tabulazioni dovrei trimmarli in acquisizione (qui inseriti per comodità di lettura)
|
||||
001|Axis_01_Load |NUM
|
||||
002|Axis_02_Load |NUM
|
||||
003|Axis_03_Load |NUM
|
||||
004|Axis_04_Load |NUM
|
||||
005|Axis_05_Load |NUM
|
||||
006|Axis_06_Load |NUM
|
||||
Binary file not shown.
@@ -51,7 +51,7 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\MTCA.ico</ApplicationIcon>
|
||||
@@ -163,6 +163,21 @@
|
||||
<EmbeddedResource Include="SetupAdapter.resx">
|
||||
<DependentUpon>SetupAdapter.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="DATA\CONF\AnalogData.map">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="DATA\DAT\PersistData.dat">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Resources\CMS\AnalogDataSIEMENS.map">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Resources\CMS\AnalogDataFANUC.map">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Resources\CMS\AnalogDataOSAI.map">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Resources\CMS\Appunti CMS OSAI.txt" />
|
||||
<None Include="Resources\CMS\OSAI.xml">
|
||||
<SubType>Designer</SubType>
|
||||
@@ -273,9 +288,6 @@
|
||||
<DependentUpon>App.config</DependentUpon>
|
||||
<IsTransformFile>True</IsTransformFile>
|
||||
</None>
|
||||
<None Include="DATA\DAT\PersistData.dat">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Resources\SCM\app.msg" />
|
||||
<None Include="Resources\SCM\convertScmAlarm.ps1" />
|
||||
<Content Include="Resources\SCM\EsaKvara_SIM.ini" />
|
||||
|
||||
+371
-548
File diff suppressed because it is too large
Load Diff
@@ -124,6 +124,7 @@ namespace MTC_Adapter
|
||||
lastStartTry = DateTime.Now;
|
||||
|
||||
// fix icon!
|
||||
notifyIcon1.Text = string.Format("MTC Adapter | {0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
|
||||
Icon = Icon.ExtractAssociatedIcon(defIconFilePath);
|
||||
notifyIcon1.Icon = Icon.ExtractAssociatedIcon(defIconFilePath);
|
||||
|
||||
|
||||
@@ -138,24 +138,6 @@
|
||||
<metadata name="K.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="X.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Y.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Z.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="I.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="J.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="K.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>104, 17</value>
|
||||
</metadata>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# Commenti con cancelletto, struttura un variabile per riga, tipo chiave|valore (occhio che il separatore è configurato da .cofig come "testCharSep"); spazi e tabulazioni dovrei trimmarli in acquisizione (qui inseriti per comodità di lettura)
|
||||
@@ -0,0 +1,7 @@
|
||||
# Commenti con cancelletto, struttura un variabile per riga, tipo chiave|valore (occhio che il separatore è configurato da .cofig come "testCharSep"); spazi e tabulazioni dovrei trimmarli in acquisizione (qui inseriti per comodità di lettura)
|
||||
001|Axis_01_Load |NUM
|
||||
002|Axis_02_Load |NUM
|
||||
003|Axis_03_Load |NUM
|
||||
004|Axis_04_Load |NUM
|
||||
005|Axis_05_Load |NUM
|
||||
006|Axis_06_Load |NUM
|
||||
@@ -0,0 +1 @@
|
||||
# Commenti con cancelletto, struttura un variabile per riga, tipo chiave|valore (occhio che il separatore è configurato da .cofig come "testCharSep"); spazi e tabulazioni dovrei trimmarli in acquisizione (qui inseriti per comodità di lettura)
|
||||
@@ -30,6 +30,7 @@ del %2"Resources\MTCA.ico"
|
||||
del %2"DATA\CONF\Adapter_ItemList.xml"
|
||||
del %2"DATA\CONF\AlarmList.map"
|
||||
del %2"DATA\CONF\AlarmListCNC.map"
|
||||
del %2"DATA\CONF\AnalogData.map"
|
||||
del %2"DATA\CONF\CounterList.map"
|
||||
del %2"DATA\CONF\StatusList.map"
|
||||
REM del /F /Q %2"DATA\CONF\*.*"
|
||||
@@ -65,6 +66,7 @@ goto END
|
||||
:FANUC
|
||||
copy %2"Resources\CMS\FANUC.xml" %2"DATA\CONF\Adapter_ItemList.xml"
|
||||
copy %2"Resources\CMS\AlarmListFANUC.map" %2"DATA\CONF\AlarmList.map"
|
||||
copy %2"Resources\CMS\AnalogDataFANUC.map" %2"DATA\CONF\AnalogData.map"
|
||||
copy %2"Resources\CMS\CounterListFANUC.map" %2"DATA\CONF\CounterList.map"
|
||||
copy %2"Resources\CMS\StatusListFANUC.map" %2"DATA\CONF\StatusList.map"
|
||||
goto END
|
||||
@@ -72,6 +74,7 @@ goto END
|
||||
:SIEMENS
|
||||
copy %2"Resources\CMS\SIEMENS.xml" %2"DATA\CONF\Adapter_ItemList.xml"
|
||||
copy %2"Resources\CMS\AlarmListSIEMENS.map" %2"DATA\CONF\AlarmList.map"
|
||||
copy %2"Resources\CMS\AnalogDataSIEMENS.map" %2"DATA\CONF\AnalogData.map"
|
||||
copy %2"Resources\CMS\CounterListSIEMENS.map" %2"DATA\CONF\CounterList.map"
|
||||
copy %2"Resources\CMS\StatusListSIEMENS.map" %2"DATA\CONF\StatusList.map"
|
||||
goto END
|
||||
@@ -79,6 +82,7 @@ goto END
|
||||
:OSAI
|
||||
copy %2"Resources\CMS\OSAI.xml" %2"DATA\CONF\Adapter_ItemList.xml"
|
||||
copy %2"Resources\CMS\AlarmListOSAI.map" %2"DATA\CONF\AlarmList.map"
|
||||
copy %2"Resources\CMS\AnalogDataOSAI.map" %2"DATA\CONF\AnalogData.map"
|
||||
copy %2"Resources\CMS\CounterListOSAI.map" %2"DATA\CONF\CounterList.map"
|
||||
copy %2"Resources\CMS\StatusListOSAI.map" %2"DATA\CONF\StatusList.map"
|
||||
goto END
|
||||
|
||||
Reference in New Issue
Block a user