diff --git a/CncLib/CNC/CNC.FANUC/CNC.FANUC.vb b/CncLib/CNC/CNC.FANUC/CNC.FANUC.vb index 0b413320..a5b1c7de 100644 --- a/CncLib/CNC/CNC.FANUC/CNC.FANUC.vb +++ b/CncLib/CNC/CNC.FANUC/CNC.FANUC.vb @@ -1496,9 +1496,37 @@ Namespace CNC #Region "Funzioni specifiche IOT" + Public Function getSysInfo() As Focas1.ODBSYS + ' RIFERIMENTO: + '... + + Dim nPathIdx As Integer + Dim nReturn As Integer + + Dim sysInfo As Focas1.ODBSYS + + sysInfo = New Focas1.ODBSYS + + 'leggo il numero del processo attivo + nPathIdx = GetActivePath() + + If Is30Series Then + + ' leggo tutto!!! + nReturn = Focas1.cnc_sysinfo(nLibHandle(nPathIdx), sysInfo) + + If F_CheckRetError_Cnc(nReturn, "cnc_sysinfo CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_sysinfo CNC.FANUC.CncLib") + End If + End If + + Return sysInfo + + End Function + Public Function getPrgName() As Focas1.ODBEXEPRG ' RIFERIMENTO: - ' C:\Users\samuele\Documents\FOCAS A02B-0207-K737_04.20\Document\SpecE\Position\cnc_rdposition.htm + '... Dim nPathIdx As Integer Dim nReturn As Integer diff --git a/IOB-WIN/IobFanuc.cs b/IOB-WIN/IobFanuc.cs index e9e5e5fc..33695b73 100644 --- a/IOB-WIN/IobFanuc.cs +++ b/IOB-WIN/IobFanuc.cs @@ -248,10 +248,31 @@ namespace IOB_WIN } catch(Exception exc) { - lg.Error(exc, "Errore in readPrgName"); + lg.Error(exc, "Errore in getPrgName"); } return prgName; } - + + /// + /// Recupero programma in lavorazione + /// + /// + public override string getSysInfo() + { + // !!!FARE!!! deve leggere i singoli valori, metterli in vettore ad hoc e inviare + string outVal = ""; + CncLib.Focas1.ODBSYS answ = FANUC_ref.getSysInfo(); + try + { + string cnc_type = new string(answ.cnc_type); + string mt_type = new string(answ.mt_type); + outVal = string.Format("CNC: {0} | MT: {1}", cnc_type, mt_type); + } + catch (Exception exc) + { + lg.Error(exc, "Errore in getSysInfo"); + } + return outVal; + } } } diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs index 99b2514f..175b6629 100644 --- a/IOB-WIN/IobGeneric.cs +++ b/IOB-WIN/IobGeneric.cs @@ -126,9 +126,13 @@ namespace IOB_WIN /// public string lastUrl { get; set; } /// - /// ULtimo programma letto + /// Ultimo programma letto /// public string lastPrgName { get; set; } + /// + /// Ultimo sysinfo letto + /// + public string lastSysInfo { get; set; } /// /// Array dei contatori x segnali blinking @@ -373,6 +377,7 @@ namespace IOB_WIN } else if (ciclo == gatherCycle.LF) { + processSysInfo(); } else if (ciclo == gatherCycle.VLF) { @@ -433,7 +438,6 @@ namespace IOB_WIN } } - private void reportDataProc() { // update valori visualizzazione... @@ -1129,10 +1133,42 @@ namespace IOB_WIN { // salvo! lastPrgName = currPrgName; - displayOtherData(); + displayOtherData(currPrgName); if (verboseLog) lg.Info(string.Format("PrgName: {0}", currPrgName)); } } + /// + /// Processo lettura dati sysinfo + /// + private void processSysInfo() + { + string currSysInfo = ""; + if (!DemoIn) + { + currSysInfo = getSysInfo(); + } + else + { + currSysInfo = string.Format("SYS: {0:HHmm}", DateTime.Now); + } + // verifico SE sia cambiato il programma... + if (lastSysInfo != currSysInfo) + { + // salvo! + lastSysInfo = currSysInfo; + displayOtherData(currSysInfo); + if (verboseLog) lg.Info(string.Format("SysInfo: {0}", currSysInfo)); + } + } + /// + /// Restituisce info sistema + /// + /// + public virtual string getSysInfo() + { + return ""; + } + /// /// Restituisce programma in esecuzione /// @@ -1219,10 +1255,11 @@ namespace IOB_WIN /// /// Mostra cosa ha/avrebbe inviato /// - public void displayOtherData() + /// + public void displayOtherData(string newData) { // mostro update... - accodaOtherData(lastPrgName); + accodaOtherData(newData); } /// /// Accoda (visualizzando in cima allo stack) la nuova stringa di output per area OTHER DATA