diff --git a/MTC_Adapter/CMSCncLib/CNC/CNC.SIEMENS/CNC.SIEMENS.vb b/MTC_Adapter/CMSCncLib/CNC/CNC.SIEMENS/CNC.SIEMENS.vb index 18e293c..7b3e436 100644 --- a/MTC_Adapter/CMSCncLib/CNC/CNC.SIEMENS/CNC.SIEMENS.vb +++ b/MTC_Adapter/CMSCncLib/CNC/CNC.SIEMENS/CNC.SIEMENS.vb @@ -894,6 +894,21 @@ Namespace CNC #Region "Funzioni specifiche IOT" + ''' + ''' Struttura dati FeedSpeed + ''' + Public Structure FeedSpeedData + ''' + ''' Valore Feed + ''' + Public Feed As Single + ''' + ''' Valore Speed + ''' + Public Speed As Single + + End Structure + ''' ''' Struttura dati asse ''' @@ -1111,6 +1126,52 @@ Namespace CNC End Function + ''' + ''' recupera valori feed/speed + ''' + ''' + ''' + Public Function getAllNcInfo(maxProc As Integer) As FeedSpeedData + + ' RIFERIMENTO: + ' SynumerikOperate_net, pg 52 + ' Parameter manual NC, pg 21 + ' /Channel/MachineAxis/actFeedRate[u1, 0] + + ' preparo memorie + 'ReDim itemRead(maxProc - 1) + 'For i As Integer = 0 To maxProc - 1 + ' 'itemRead(i) = New Item("/Channel/MachineAxis/actFeedRate[u" & i + 1 & ",1]") ' leggo FEED! + ' itemRead(i) = New Item("DB21.DBW158:[36]") 'funzioni estese?!? + 'Next i + + ReDim itemRead(0) + itemRead(0) = New Item("DB21.DBW158:[36]") 'funzioni estese?!? + 'itemRead(1) = New Item("DB22.DBW158:[36]") 'funzioni estese?!? + 'itemRead(2) = New Item("DB23.DBW158:[36]") 'funzioni estese?!? + 'itemRead(3) = New Item("DB24.DBW158:[36]") 'funzioni estese?!? + 'itemRead(4) = New Item("DB25.DBW158:[36]") 'funzioni estese?!? + + 'lettura + Do + Try + m_DataSvcRW.Read(itemRead) + Exit Do + Catch ex As DataSvcBusyException + Debug.Print(ex.Message) + Catch ex As DataSvcException + Throw New CmsNcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex) + End Try + Loop + + Dim answ As FeedSpeedData + + answ.Feed = UIntegerToSingle(itemRead(0).Value(0)) + + Return answ + + End Function + ''' ''' procedura per risposta alla segnalazione di allarmi... ''' diff --git a/MTC_Adapter/MTC_Adapter/AdapterSiemens.cs b/MTC_Adapter/MTC_Adapter/AdapterSiemens.cs index 3326bd5..6677dc5 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterSiemens.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterSiemens.cs @@ -538,6 +538,31 @@ namespace MTC_Adapter /// public override void readGlobalData() { + // 2017.11.20 tentato di recuperare il dato ma pare ci siano solo info x singolo asse, la DB21 SEMBRA promettente ma lato S7 abbiamo verificato con Adimar che nON E? usata nella DBW158 e seg.. x popolare dati di FEEDRATE/SPEEDRATE... +#if true + // Parameter manual NC... pag 790: + /* + * Leggendo questo: + * "The extended address of the F function contains an identifier with the following meaning: + – 0: Path feedrate + – 1 - 31: Machine axis number for feedrate for positioning axes + * + * SEMBREREBBE che leggere u1,0 significhi leggere per INTERO path non x un singolo asse... + * --> pag 21--> leggo /Channel/MachineAxis/actFeedRate[u1, 0] + * */ + // leggo dati globali... + parentForm.commPlcActive = true; + inizio = DateTime.Now; + var fsData = SIEMENS_ref.getAllNcInfo(currAdpConf.nPath); + if (utils.CRB("recTime")) TimingData.addResult("R-NcInfo", DateTime.Now.Subtract(inizio).Ticks); + parentForm.commPlcActive = false; + + // recupero speed e feed... + FeedRate = Convert.ToInt32(fsData.Feed); + //SpeedRate = Convert.ToInt32(allNcData.realspeed); +#endif + + // cercare funzione!!! #if false // leggo dati globali... diff --git a/MaterialeSetup/SIEMENS/Documentazione_SIEMENS_EN/btss_eng.GID b/MaterialeSetup/SIEMENS/Documentazione_SIEMENS_EN/btss_eng.GID index 79772a1..4fa10a7 100644 Binary files a/MaterialeSetup/SIEMENS/Documentazione_SIEMENS_EN/btss_eng.GID and b/MaterialeSetup/SIEMENS/Documentazione_SIEMENS_EN/btss_eng.GID differ