From 9f4bdc64975405a67c08ff595e25cf109bc1cfb7 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 17 May 2016 16:42:42 +0200 Subject: [PATCH] aggiunta decodifica allarmi FAULT/WARNING... --- MTC_Sim/.vs/MTC_Sim/v14/.suo | Bin 288768 -> 288768 bytes MTC_Sim/CMSCncLib/CNC/CNC.FANUC/CNC.FANUC.vb | 62 ++++++++++++++++++- MTC_Sim/MTC_Sim/AdapterGeneric.cs | 16 ++++- MTC_Sim/MTC_Sim/Appunti.txt | 7 +-- 4 files changed, 77 insertions(+), 8 deletions(-) diff --git a/MTC_Sim/.vs/MTC_Sim/v14/.suo b/MTC_Sim/.vs/MTC_Sim/v14/.suo index 05f0bb167b4e580893100d41b2ff633e285d4bd8..1d00eafea8d05d59f6a891986a0878c7b303f070 100644 GIT binary patch delta 1865 zcmcgsYiv|S6u#%oY`42~x9kFKsUoC6X{)xh5Z;g5*(7Xq|JAVd}d ziV;ZRwtFHPs106;fmpJ1heuMEs%S9Mf|wX%NHtgy2&qjG6l^_rfoP0>{Nv<)nR8~o z^O$pHZm``GZ1>cT&eooc{+i}v*~aMY>+7?YfsxA?#mKaDG&+Vnb8`JIIEVpTN6GrJ z1>p@S06sNp#CF(g+!ZfNw(T=k$WqXaGjdLfm+g8PQyC@fFpp=85>By|f~}&bJDq*R zowLPTK`j_#o!exDnZ_yS2#;dnG~*28ETh->+4-#TjWZ!U%vCxFUI^EuiBw!EjIG|S z@TPIsyB+q0Yo?yVr(Mi;GZGmd%aVP2AJ0Z%QkjeeJC@XLY|b3`NU2ROjS1l!`Fq_k z(m0SY6!MMw;wo6ga*DSe&4zPCS zFbuaZ!>C?Z9B-9(_LGI4@;2jR%nkP}3!*KZo#uqMEPvpHtZ>a*VF%W#FD5u3pZPPN z*i`Q*vTPhfctJ9>@E^McHtxd4ow##PWDj(ftIj)+3XvNS1QqOqAcn5PPS<|+&tD8p zl>IfFv{~v!OAOlsTBWv8TTAbD;vgE>3C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uY6a?Dhz+s<@gx%yfFcfUViI5=5zhep z-5F2Tp1DB1^RSyH?D(Xtb)bRbI&ivLhsPZ&XUE4GDOR+P${)oK9*Fx^8fJmx_gS^a zBXiYM<;Y$)EeOsSN;m}t+M zZNR@5T!CNxvmDt_iRJP44CFgC$oc=T;Gvnm7EAqZ>=)Y+>D4>1T)v-g_}K5QoRW2LO@!X6NX zh$5_TN=<60lm%qqBA#Z{@f{Y)qR(+CjjpZ3YFYgQin-zta-*f^h&&R-rq~CHqQT>= zM%GMVH&AymmQuwKa=HEnei~0YLMOGwFt;W&KhOoH+VEw6tIMu9DJ-Pp4vk*-q=7Z!x)L2 z-HjF1%s$Y_&_}~pFizUPWH%UvC($XLN7=aJFK!MMTx9BMBkUB2%Pd(8GTzPA?W|^* zGINNHLMP|-Mtwbxv;L}dH6hf*xeHv@r+auul6kr$0OCAbG?2|bbIG%j`KWQ6?WNHx zEK^J|PWmdY_v<_Yokct%BVMjE;pLn*ZQ{q|u@b(Oi4x8&A?a0I7ppml7dXnuX0C(O I%X!50CuI!imjD0& diff --git a/MTC_Sim/CMSCncLib/CNC/CNC.FANUC/CNC.FANUC.vb b/MTC_Sim/CMSCncLib/CNC/CNC.FANUC/CNC.FANUC.vb index 859f18b..ee05cdf 100644 --- a/MTC_Sim/CMSCncLib/CNC/CNC.FANUC/CNC.FANUC.vb +++ b/MTC_Sim/CMSCncLib/CNC/CNC.FANUC/CNC.FANUC.vb @@ -617,7 +617,6 @@ Namespace CNC Dim nPathIdx As Integer Dim nNumAxisRead As Integer Dim nReturn As Integer - Dim szAssi() As String = {String.Empty} Dim posizAssi As Focas1.ODBPOS @@ -639,6 +638,66 @@ Namespace CNC Return posizAssi End Function + Public Function getAllAxisLoad() As Focas1.ODBSVLOAD + ' RIFERIMENTO: + ' C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\CMS_orig\A02B-0207-K737_04.20\Document\SpecE\Position\cnc_rdsvmeter.htm + + Dim nPathIdx As Integer + Dim nNumAxisRead As Integer + Dim nReturn As Integer + + Dim caricoAssi As Focas1.ODBSVLOAD + + 'leggo il numero del processo attivo + nPathIdx = GetActivePath() + 'leggo num max assi dal cn + nNumAxisRead = Focas1.MAX_AXIS + + If Is30Series Then + + ' leggo tutto!!! + nReturn = Focas1.cnc_rdsvmeter(nLibHandle(nPathIdx), nNumAxisRead, caricoAssi) + + If F_CheckRetError_Cnc(nReturn, "cnc_rdsvmeter RefreshAxisMeter CNC.FANUC.CMS_CncLib") Then + Throw New CmsNcException("ERR cnc_rdsvmeter RefreshAxisMeter CNC.FANUC.CMS_CncLib") + End If + End If + + Return caricoAssi + + End Function + + Public Function getAllDynData() As Focas1.ODBDY2_1 + ' RIFERIMENTO: + ' C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\CMS_orig\A02B-0207-K737_04.20\Document\SpecE\Position\cnc_rddynamic2.htm + + Dim nPathIdx As Integer + Dim nNumAxisRead As Integer + Dim nReturn As Integer + + Dim allData As Focas1.ODBDY2_1 + ' inizializzo + allData = New Focas1.ODBDY2_1 + + 'leggo il numero del processo attivo + nPathIdx = GetActivePath() + 'leggo num max assi dal cn + nNumAxisRead = Focas1.MAX_AXIS + + If Is30Series Then + + ' leggo tutto!!! + nReturn = Focas1.cnc_rddynamic2(nLibHandle(nPathIdx), 1, 28 + 4 * (4 * 1), allData) + + If F_CheckRetError_Cnc(nReturn, "cnc_rddynamic2 RefreshAllData CNC.FANUC.CMS_CncLib") Then + Throw New CmsNcException("ERR cnc_rddynamic2 RefreshAllData CNC.FANUC.CMS_CncLib") + End If + End If + + Return allData + + End Function + Public Function getSpindleSpeed() As Focas1.ODBSPEED ' RIFERIMENTO: @@ -647,7 +706,6 @@ Namespace CNC Dim nPathIdx As Integer Dim nNumAxisRead As Integer Dim nReturn As Integer - Dim szAssi() As String = {String.Empty} Dim speedAssi As Focas1.ODBSPEED diff --git a/MTC_Sim/MTC_Sim/AdapterGeneric.cs b/MTC_Sim/MTC_Sim/AdapterGeneric.cs index 0ccfa94..1b67c57 100644 --- a/MTC_Sim/MTC_Sim/AdapterGeneric.cs +++ b/MTC_Sim/MTC_Sim/AdapterGeneric.cs @@ -1275,15 +1275,27 @@ namespace MTC_Sim { // recupero allarme da oggetto in memoria... currAllarm = elencoAllarmi[i * 32 + j]; + // in base al tipo di allarme decodifico condizione... + Condition.Level livello = Condition.Level.NORMAL; + switch (currAllarm.livello) + { + case "WARNING": + livello = Condition.Level.WARNING; + break; + case "FAULT": + default: + livello = Condition.Level.FAULT; + break; + } // in base al gruppo decido dove assegnare come CONDITION... switch (currAllarm.gruppo) { case "PLC": - mAlarmPLC.Add(MTConnect.Condition.Level.FAULT, currAllarm.descrizione, currAllarm.codNum, "", ""); + mAlarmPLC.Add(livello, currAllarm.descrizione, currAllarm.codNum, "", ""); break; case "CNC": default: - mAlarmCNC.Add(MTConnect.Condition.Level.FAULT, currAllarm.descrizione, currAllarm.codNum, "", ""); + mAlarmCNC.Add(livello, currAllarm.descrizione, currAllarm.codNum, "", ""); break; } } diff --git a/MTC_Sim/MTC_Sim/Appunti.txt b/MTC_Sim/MTC_Sim/Appunti.txt index 1f2ae39..ff54345 100644 --- a/MTC_Sim/MTC_Sim/Appunti.txt +++ b/MTC_Sim/MTC_Sim/Appunti.txt @@ -5,17 +5,16 @@ OK 03) lo strobe allarmi va inizializzato all'avvio (carica TUTTI i bit...) OK 04) da strobe allarmi --> vettore allarmi OK 05) CodS 5 cifre OK 06) CodM/CodT 3 cifre - 07) lettura assi: vedere in progetto CMSConnect in OpPanel di FANUC la RefreshAxisNames() + 07) lettura assi: posizioni, velocità, ... - feedrate C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\CMS_orig\A02B-0207-K737_04.20\Document\SpecE\Position\cnc_actf.htm - - pos abs C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\CMS_orig\A02B-0207-K737_04.20\Document\SpecE\Position\cnc_absolute2.htm - ALL? C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\CMS_orig\A02B-0207-K737_04.20\Document\SpecE\Position\cnc_rdaxisdata.htm OK 08) lettura strobe e registrazione NUOVO flusso EVENT x START/STOP/RESET (1 solo con 3 strobe separati) --> gestire!!! OK 09) update gestione SUB MODE OK 10) riallineamento simulatore generico 11) spostare lettura spindle in mandrino/UnOp 12) completare letture assi - 13) completare gestione BIT di semaforo - 14) completare gestione strobe (x i bit "non qualificati") +OK 13) completare gestione BIT di semaforo +OK 14) completare gestione strobe (x i bit "non qualificati")