diff --git a/MTC_Sim/.vs/MTC_Sim/v14/.suo b/MTC_Sim/.vs/MTC_Sim/v14/.suo index f2a4563..41624d1 100644 Binary files a/MTC_Sim/.vs/MTC_Sim/v14/.suo and b/MTC_Sim/.vs/MTC_Sim/v14/.suo differ diff --git a/MTC_Sim/CMSCncLib/CNC/CNC.FANUC/CNC.FANUC.vb b/MTC_Sim/CMSCncLib/CNC/CNC.FANUC/CNC.FANUC.vb index 021bef6..0c854b1 100644 --- a/MTC_Sim/CMSCncLib/CNC/CNC.FANUC/CNC.FANUC.vb +++ b/MTC_Sim/CMSCncLib/CNC/CNC.FANUC/CNC.FANUC.vb @@ -729,6 +729,36 @@ Namespace CNC End Function + Public Function getPathGCode() As Focas1.ODBGCD + ' RIFERIMENTO: + ' C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\CMS_orig\A02B-0207-K737_04.20\Document\SpecE\Misc\cnc_rdgcode.htm + + Dim nPathIdx As Integer + Dim nNumAxisRead As Integer + Dim nReturn As Integer + + Dim actGCode As Focas1.ODBGCD + ' inizializzo + actGCode = New Focas1.ODBGCD + + 'leggo il numero del processo attivo + nPathIdx = GetActivePath() + 'leggo num max assi dal cn + nNumAxisRead = Focas1.MAX_AXIS + + If Is30Series Then + + ' leggo tutto!!! 0-27 (28 elementi) + nReturn = Focas1.cnc_rdgcode(nLibHandle(nPathIdx), -1, 1, 28, actGCode) + + If F_CheckRetError_Cnc(nReturn, "cnc_rdgcode RefreshPathGCode CNC.FANUC.CMS_CncLib") Then + Throw New CmsNcException("ERR cnc_rdgcode RefreshPathGCode CNC.FANUC.CMS_CncLib") + End If + End If + + Return actGCode + + End Function Public Function getSpindleSpeed() As Focas1.ODBSPEED ' RIFERIMENTO: diff --git a/MTC_Sim/MTC_Sim/AdapterFanuc.cs b/MTC_Sim/MTC_Sim/AdapterFanuc.cs index 1d491bc..8c2b202 100644 --- a/MTC_Sim/MTC_Sim/AdapterFanuc.cs +++ b/MTC_Sim/MTC_Sim/AdapterFanuc.cs @@ -652,8 +652,47 @@ namespace MTC_Sim { base.getPath(); - // recupero dati + // recupero dati feedrate + DateTime inizio = DateTime.Now; FeedRate = FANUC_ref.getGlobalFeedrate().data; + if (utils.CRB("recTime")) TimingData.addResult("R{0}-FEEDRATE", DateTime.Now.Subtract(inizio).Ticks); + + + + // recupero vettore generale G MODE + inizio = DateTime.Now; + CMSCncLib.Focas1.ODBGCD vettGCodes = FANUC_ref.getPathGCode(); + if (utils.CRB("recTime")) TimingData.addResult("R{0}-GCodesArray", DateTime.Now.Subtract(inizio).Ticks); + + string GCodAttivi = ""; + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd0.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd1.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd2.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd3.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd4.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd5.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd6.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd7.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd8.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd9.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd10.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd11.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd12.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd13.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd14.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd15.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd16.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd17.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd18.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd19.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd20.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd21.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd22.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd23.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd24.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd25.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd26.code); + GCodAttivi += string.Format("# {0} #", vettGCodes.gcd27.code); // FARE!! per ora solo 1 path... int numPath = 1; @@ -661,6 +700,8 @@ namespace MTC_Sim for (int i = 0; i < numPath; i++) { vettPath[i].mPathFeed.Value = FeedRate; + vettPath[i].mPathCodG_Act.Value = GCodAttivi; + //vettPath[i].mPathFeedOver.Value = PtData.PathFeedrateOver; //vettPath[i].mPathRapidOver.Value = PtData.PathRapidOver; //vettPath[i].mPathPosActX.Value = PtData.PathPosAct.x; @@ -669,11 +710,8 @@ namespace MTC_Sim //vettPath[i].mPathPosActI.Value = PtData.PathPosAct.i; //vettPath[i].mPathPosActJ.Value = PtData.PathPosAct.j; //vettPath[i].mPathPosActK.Value = PtData.PathPosAct.k; - //vettPath[i].mPathType.Value = PtData.PathType; //vettPath[i].mPathPartId.Value = PtData.PartId; //vettPath[i].mPathPartCount.Value = PtData.pzTot; - //vettPath[i].mPathRunMode.Value = PtData.RunMode; - //vettPath[i].mPathExeMode.Value = PtData.ExeMode; //vettPath[i].mPathCurrProg.Value = PtData.ProgramName; //vettPath[i].mPathCurrProgRowNum.Value = PtData.ProgrRow; //vettPath[i].mPathActiveAxes.Value = PtData.ActiveAxes; diff --git a/MTC_Sim/MTC_Sim/Appunti.txt b/MTC_Sim/MTC_Sim/Appunti.txt index bdee10d..2a5b242 100644 --- a/MTC_Sim/MTC_Sim/Appunti.txt +++ b/MTC_Sim/MTC_Sim/Appunti.txt @@ -16,6 +16,7 @@ OK 10) riallineamento simulatore generico OK 13) completare gestione BIT di semaforo OK 14) completare gestione strobe (x i bit "non qualificati") OK 15) decodifica corretta livello allarme (WARNING/FAULT) + 16) lettura codici G del path con cnc_rdgcode 99) completamento funzioni con librerie fanuc native