diff --git a/IOB-WIN/CncLib/CNC/CNC.FANUC/CNC.FANUC.vb b/IOB-WIN/CncLib/CNC/CNC.FANUC/CNC.FANUC.vb index 0275d7d..d8f4d17 100644 --- a/IOB-WIN/CncLib/CNC/CNC.FANUC/CNC.FANUC.vb +++ b/IOB-WIN/CncLib/CNC/CNC.FANUC/CNC.FANUC.vb @@ -1,4 +1,4 @@ -Imports CMSCncLib.Config.Settings +Imports CncLib.Config.Settings Namespace CNC @@ -155,7 +155,7 @@ Namespace CNC szStatus = "ERR cnc_allclibhndl3 Connect CNC.FANUC Return=" & nReturn Focas1.cnc_freelibhndl(nLibHandle(1)) _bConnected = False - Throw New CmsNcException("ERR cnc_allclibhndl3 Connect CNC.FANUC") + Throw New NcException("ERR cnc_allclibhndl3 Connect CNC.FANUC") Exit Sub Else 'leggo la serie del cnc @@ -168,7 +168,7 @@ Namespace CNC szStatus = "ERR cnc_getpath Connect CNC.FANUC Return=" & nReturn Focas1.cnc_freelibhndl(nLibHandle(1)) _bConnected = False - Throw New CmsNcException("ERR cnc_getpath Connect CNC.FANUC") + Throw New NcException("ERR cnc_getpath Connect CNC.FANUC") Exit Sub Else If _nMaxPath > 1 Then @@ -178,7 +178,7 @@ Namespace CNC szStatus = "ERR cnc_setpath Connect CNC.FANUC Return=" & nReturn Focas1.cnc_freelibhndl(nLibHandle(1)) _bConnected = False - Throw New CmsNcException("ERR cnc_setpath Connect CNC.FANUC") + Throw New NcException("ERR cnc_setpath Connect CNC.FANUC") Exit Sub Else ReDim Preserve nLibHandle(_nMaxPath) @@ -189,7 +189,7 @@ Namespace CNC szStatus = "ERR cnc_allclibhndl3 Connect CNC.FANUC to Path " & i & " Return=" & nReturn Focas1.cnc_freelibhndl(nLibHandle(i)) _bConnected = False - Throw New CmsNcException("ERR cnc_allclibhndl3 Connect CNC.FANUC to Path " & i) + Throw New NcException("ERR cnc_allclibhndl3 Connect CNC.FANUC to Path " & i) Exit Sub Else nReturn = Focas1.cnc_setpath(nLibHandle(i), i) @@ -197,7 +197,7 @@ Namespace CNC szStatus = "ERR cnc_setpath Connect CNC.FANUC to Path " & i & " Return=" & nReturn Focas1.cnc_freelibhndl(nLibHandle(i)) _bConnected = False - Throw New CmsNcException("ERR cnc_setpath Connect CNC.FANUC to Path " & i) + Throw New NcException("ERR cnc_setpath Connect CNC.FANUC to Path " & i) Exit Sub Else _bConnected = True @@ -222,7 +222,7 @@ Namespace CNC szStatus = "ERR cnc_allclibhndl2 Connect CNC.FANUC Return=" & nReturn Focas1.cnc_freelibhndl(nLibHandle(1)) _bConnected = False - Throw New CmsNcException("ERR cnc_allclibhndl2 Connect CNC.FANUC") + Throw New NcException("ERR cnc_allclibhndl2 Connect CNC.FANUC") Exit Sub Else _bConnected = True @@ -258,7 +258,7 @@ Namespace CNC nOdb = New Focas1.ODBSYS nReturn = Focas1.cnc_sysinfo(nLibHandle(1), nOdb) If F_CheckRetError_Cnc(nReturn, "cnc_sysinfo F_GetCncSeries CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_sysinfo F_GetCncSeries CNC.FANUC") + Throw New NcException("ERR cnc_sysinfo F_GetCncSeries CNC.FANUC") Else nSeries = Val(nOdb.cnc_type) If nSeries >= 30 Then @@ -328,7 +328,7 @@ Namespace CNC 'Reads the memory type of tool offset, and the available number of it. Focas1.cnc_rdtofsinfo(nLibHandle(1), odbtlinf) If F_CheckRetError_Cnc(Focas1.cnc_rdtofsinfo(nLibHandle(1), odbtlinf), "cnc_rdtofsinfo GetStaticData CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_rdtofsinfo GetStaticData CNC.FANUC") + Throw New NcException("ERR cnc_rdtofsinfo GetStaticData CNC.FANUC") End If Me._MaxUtensiliGestibili = odbtlinf.use_no @@ -351,7 +351,7 @@ Namespace CNC bStaticDataReaded = True - Catch ex As CmsNcException + Catch ex As NcException Me.CncException(ex.Message) End Try @@ -416,7 +416,7 @@ Namespace CNC 'leggo la memoria nReturn = Focas1.pmc_rdpmcrng(nLibHandle(1), iodb0.type_a, iodb0.type_d, iodb0.datano_s, iodb0.datano_e, nlength, iodb0) If F_CheckRetError_Pmc(nReturn, "pmc_rdpmcrng F_RW_Boolean CNC.FANUC") Then - Throw New CmsNcException("ERR pmc_rdpmcrng F_RW_Boolean CNC.FANUC") + Throw New NcException("ERR pmc_rdpmcrng F_RW_Boolean CNC.FANUC") Return False Else nValue = iodb0.cdata(0) @@ -430,10 +430,10 @@ Namespace CNC iodb0.cdata(0) = nValue nReturn = Focas1.pmc_wrpmcrng(nLibHandle(1), nlength, iodb0) If nReturn = Focas1.EW_SOCKET Then - Throw New CmsNcException("ERR pmc_wrpmcrng CNC.FANUC") + Throw New NcException("ERR pmc_wrpmcrng CNC.FANUC") Return False ElseIf nReturn <> Focas1.EW_OK Then - 'CMSCncLib.App.Runtime.Log.WW("ERR pmc_wrpmcrng on F_RW_Boolean CNC.FANUC", "Return=" & nReturn, True) + 'CncLib.App.Runtime.Log.WW("ERR pmc_wrpmcrng on F_RW_Boolean CNC.FANUC", "Return=" & nReturn, True) Return False End If @@ -494,14 +494,14 @@ Namespace CNC Next nReturn = Focas1.pmc_wrpmcrng(nLibHandle(1), nlength, iodb0) If F_CheckRetError_Pmc(nReturn, "pmc_wrpmcrng F_RW_Byte CNC.FANUC") Then - Throw New CmsNcException("ERR pmc_wrpmcrng F_RW_Byte CNC.FANUC") + Throw New NcException("ERR pmc_wrpmcrng F_RW_Byte CNC.FANUC") Return False End If Else ' ************* Read nReturn = Focas1.pmc_rdpmcrng(nLibHandle(1), iodb0.type_a, iodb0.type_d, iodb0.datano_s, iodb0.datano_e, nlength, iodb0) If F_CheckRetError_Pmc(nReturn, "pmc_rdpmcrng F_RW_Byte CNC.FANUC") Then - Throw New CmsNcException("ERR pmc_rdpmcrng F_RW_Byte CNC.FANUC") + Throw New NcException("ERR pmc_rdpmcrng F_RW_Byte CNC.FANUC") Return False Else For i = 0 To nQta - 1 @@ -576,14 +576,14 @@ Namespace CNC Next nReturn = Focas1.pmc_wrpmcrng(nLibHandle(1), nlength, iodb1) If F_CheckRetError_Pmc(nReturn, "pmc_wrpmcrng F_RW_Word CNC.FANUC") Then - Throw New CmsNcException("ERR pmc_wrpmcrng F_RW_Word CNC.FANUC") + Throw New NcException("ERR pmc_wrpmcrng F_RW_Word CNC.FANUC") Return False End If Else ' ************* Read nReturn = Focas1.pmc_rdpmcrng(nLibHandle(1), iodb1.type_a, iodb1.type_d, iodb1.datano_s, iodb1.datano_e, nlength, iodb1) If F_CheckRetError_Pmc(nReturn, "pmc_rdpmcrng F_RW_Word CNC.FANUC") Then - Throw New CmsNcException("ERR pmc_rdpmcrng F_RW_Word CNC.FANUC") + Throw New NcException("ERR pmc_rdpmcrng F_RW_Word CNC.FANUC") Return False Else For i = 0 To nQta - 1 @@ -703,14 +703,14 @@ Namespace CNC Next nReturn = Focas1.pmc_wrpmcrng(nLibHandle(1), nlength, iodb2) If F_CheckRetError_Pmc(nReturn, "pmc_wrpmcrng F_RW_DWord CNC.FANUC") Then - Throw New CmsNcException("ERR pmc_wrpmcrng F_RW_DWord CNC.FANUC") + Throw New NcException("ERR pmc_wrpmcrng F_RW_DWord CNC.FANUC") Return False End If Else ' ************* Read nReturn = Focas1.pmc_rdpmcrng(nLibHandle(1), iodb2.type_a, iodb2.type_d, iodb2.datano_s, iodb2.datano_e, nlength, iodb2) If F_CheckRetError_Pmc(nReturn, "pmc_rdpmcrng F_RW_DWord CNC.FANUC") Then - Throw New CmsNcException("ERR pmc_rdpmcrng F_RW_DWord CNC.FANUC") + Throw New NcException("ERR pmc_rdpmcrng F_RW_DWord CNC.FANUC") Return False Else For i = 0 To nQta - 1 @@ -785,14 +785,14 @@ Namespace CNC Next nReturn = Focas1.pmc_wrpmcrng(nLibHandle(1), nlength, iodb2) If F_CheckRetError_Pmc(nReturn, "pmc_wrpmcrng F_RW_Integer CNC.FANUC") Then - Throw New CmsNcException("ERR pmc_wrpmcrng F_RW_Integer CNC.FANUC") + Throw New NcException("ERR pmc_wrpmcrng F_RW_Integer CNC.FANUC") Return False End If Else ' ************* Read nReturn = Focas1.pmc_rdpmcrng(nLibHandle(1), iodb2.type_a, iodb2.type_d, iodb2.datano_s, iodb2.datano_e, nlength, iodb2) If F_CheckRetError_Pmc(nReturn, "pmc_rdpmcrng F_RW_Integer CNC.FANUC") Then - Throw New CmsNcException("ERR pmc_rdpmcrng F_RW_Integer CNC.FANUC") + Throw New NcException("ERR pmc_rdpmcrng F_RW_Integer CNC.FANUC") Return False Else For i = 0 To nQta - 1 @@ -843,7 +843,7 @@ Namespace CNC 'Leggo se il CN è impostato in Inch (parametro 0.2) nReturn = Focas1.cnc_rdparam(nLibHandle(1), 0, 0, 4 + 1, iodbpsd_1) If F_CheckRetError_Cnc(nReturn, "cnc_rdparam F_RW_LengthOffset CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_rdparam F_RW_LengthOffset CNC.FANUC") + Throw New NcException("ERR cnc_rdparam F_RW_LengthOffset CNC.FANUC") End If bNcInInch = (iodbpsd_1.cdata And MASK_BIT2) = MASK_BIT2 @@ -853,7 +853,7 @@ Namespace CNC 'leggo le cifre decimali nReturn = Focas1.cnc_getfigure(nLibHandle(1), 1, valid_fig, dec_fig_in, dec_fig_out) If F_CheckRetError_Cnc(nReturn, "cnc_getfigure F_RW_LengthOffset CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_getfigure F_RW_LengthOffset CNC.FANUC") + Throw New NcException("ERR cnc_getfigure F_RW_LengthOffset CNC.FANUC") End If If bWrite Then ' *** Write @@ -878,7 +878,7 @@ Namespace CNC End If nReturn = Focas1.cnc_wrtofs(nLibHandle(1), ToolOffsetNumber, i, 8, nTmp) If F_CheckRetError_Pmc(nReturn, "cnc_wrtofs F_RW_ToolOffset CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_wrtofs F_RW_ToolOffset CNC.FANUC") + Throw New NcException("ERR cnc_wrtofs F_RW_ToolOffset CNC.FANUC") End If Next @@ -886,7 +886,7 @@ Namespace CNC For i = 0 To 3 nReturn = Focas1.cnc_rdtofs(nLibHandle(1), ToolOffsetNumber, i, 8, odbtofs) If F_CheckRetError_Pmc(nReturn, "cnc_rdtofs F_RW_ToolOffset CNC.FANUC") OrElse (odbtofs.datano <> ToolOffsetNumber Or odbtofs.type <> i) Then - Throw New CmsNcException("ERR cnc_rdtofs F_RW_ToolOffset CNC.FANUC") + Throw New NcException("ERR cnc_rdtofs F_RW_ToolOffset CNC.FANUC") Else Dim dblTmp As Double 'riporto all'unità di misura di ToolTable @@ -928,7 +928,7 @@ Namespace CNC iodbto_1_3 = New Focas1.IODBTO_1_3 ofs_3 = New Focas1.OFS_3 - nMaxUt = CMSCncLib.CNC.Runtime.NC.MaxIdUtensile + nMaxUt = CncLib.CNC.Runtime.NC.MaxIdUtensile Dim n As Integer n = nMaxUt \ 100 @@ -949,7 +949,7 @@ Namespace CNC iodbto_1_3.type = i nReturn = Focas1.cnc_wrtofsr(nLibHandle(1), 8 + 4 * (iodbto_1_3.datano_e - iodbto_1_3.datano_s + 1), iodbto_1_3) If F_CheckRetError_Pmc(nReturn, "cnc_wrtofsr F_Clear_ToolOffsets CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_wrtofsr F_Clear_ToolOffsets CNC.FANUC") + Throw New NcException("ERR cnc_wrtofsr F_Clear_ToolOffsets CNC.FANUC") End If Next Next @@ -1024,7 +1024,7 @@ Namespace CNC nReturn = Focas1.cnc_wrparam(nLibHandle(1), nlength, iodbpsd3) End If If F_CheckRetError_Cnc(nReturn, "cnc_wrparam F_RW_Param_DWord CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_wrparam F_RW_Param_DWord CNC.FANUC") + Throw New NcException("ERR cnc_wrparam F_RW_Param_DWord CNC.FANUC") Return False End If @@ -1035,7 +1035,7 @@ Namespace CNC nReturn = Focas1.cnc_rdparam(nLibHandle(1), ParamIndex, Axis, nlength, iodbpsd3) End If If F_CheckRetError_Pmc(nReturn, "cnc_rdparam F_RW_Param_DWord CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_rdparam F_RW_Param_DWord CNC.FANUC") + Throw New NcException("ERR cnc_rdparam F_RW_Param_DWord CNC.FANUC") Return False Else If nQta = 1 Then @@ -1132,7 +1132,7 @@ Namespace CNC nReturn = Focas1.cnc_wrmacror(nLibHandle(nActivePath), MacroIndex, iodbmr) If F_CheckRetError_Cnc(nReturn, "cnc_wrmacror F_RW_Macro_Short CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_wrmacror F_RW_Macro_Short CNC.FANUC") + Throw New NcException("ERR cnc_wrmacror F_RW_Macro_Short CNC.FANUC") Return False End If @@ -1140,7 +1140,7 @@ Namespace CNC nReturn = Focas1.cnc_rdmacror(nLibHandle(nActivePath), iodbmr.datano_s, iodbmr.datano_e, nlength, iodbmr) If F_CheckRetError_Cnc(nReturn, "cnc_rdmacror F_RW_Macro_Short CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_rdmacror F_RW_Macro_Short CNC.FANUC") + Throw New NcException("ERR cnc_rdmacror F_RW_Macro_Short CNC.FANUC") Return False Else If nQta >= 1 Then Value(0 + b * F_MAX_MACRO) = iodbmr.data.data1.mcr_val / (10 ^ iodbmr.data.data1.dec_val) @@ -1259,7 +1259,7 @@ Namespace CNC nReturn = Focas1.cnc_wrmacror(nLibHandle(nActivePath), MacroIndex, iodbmr) If F_CheckRetError_Cnc(nReturn, "cnc_wrmacror F_RW_Macro_Double CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_wrmacror F_RW_Macro_Double CNC.FANUC") + Throw New NcException("ERR cnc_wrmacror F_RW_Macro_Double CNC.FANUC") Return False End If @@ -1267,7 +1267,7 @@ Namespace CNC nReturn = Focas1.cnc_rdmacror(nLibHandle(nActivePath), iodbmr.datano_s, iodbmr.datano_e, nlength, iodbmr) If F_CheckRetError_Cnc(nReturn, "cnc_rdmacror F_RW_Macro_Double CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_rdmacror F_RW_Macro_Double CNC.FANUC") + Throw New NcException("ERR cnc_rdmacror F_RW_Macro_Double CNC.FANUC") Return False Else If nQta >= 1 Then Value(0 + b * F_MAX_MACRO) = iodbmr.data.data1.mcr_val / (10 ^ iodbmr.data.data1.dec_val) @@ -1352,7 +1352,7 @@ Namespace CNC nReturn = Focas1.cnc_wrpmacror(nLibHandle(nActivePath), MacroIndex, iodbpr) If F_CheckRetError_Cnc(nReturn, "cnc_wrpmacror F_RW_PCodeMacro_Short CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_wrpmacror F_RW_PCodeMacro_Short CNC.FANUC") + Throw New NcException("ERR cnc_wrpmacror F_RW_PCodeMacro_Short CNC.FANUC") Return False End If @@ -1360,7 +1360,7 @@ Namespace CNC nReturn = Focas1.cnc_rdpmacror(nLibHandle(nActivePath), iodbpr.datano_s, iodbpr.datano_e, nlength, iodbpr) If F_CheckRetError_Cnc(nReturn, "cnc_rdmacror F_RW_Macro_Short CNC.FANUC") Then - Throw New CmsNcException("ERR cnc_rdmacror F_RW_Macro_Short CNC.FANUC") + Throw New NcException("ERR cnc_rdmacror F_RW_Macro_Short CNC.FANUC") Return False Else If nQta >= 1 Then Value(0 + b * F_MAX_MACRO) = iodbpr.data.data1.mcr_val / (10 ^ iodbpr.data.data1.dec_val) @@ -1439,7 +1439,7 @@ Namespace CNC ' impostato a true x mostrare errore If False Then 'If nReturn <> Focas1.EW_SOCKET Then 'tranne su errore di connessione - 'CMSCncLib.App.Runtime..Log.WW("ERR pmc_wrpmcrng on F_RW_DWord CNC.FANUC", "Return=" & nReturn, True) + 'CncLib.App.Runtime..Log.WW("ERR pmc_wrpmcrng on F_RW_DWord CNC.FANUC", "Return=" & nReturn, True) MsgBox(szErrorDesc & vbLf & "Occurred in: " & Position, MsgBoxStyle.Exclamation + MsgBoxStyle.ApplicationModal, "Error on Fanuc CNC Data Window") 'End If End If @@ -1483,7 +1483,7 @@ Namespace CNC ''Stampo il messaggio 'If (Config.Settings.Settings.Debug > 0) Then ' 'If nReturn <> Focas1.EW_SOCKET Then 'tranne su errore di connessione - ' 'CMSCncLib.App.Runtime..Log.WW("ERR pmc_wrpmcrng on F_RW_DWord CNC.FANUC", "Return=" & nReturn, True) + ' 'CncLib.App.Runtime..Log.WW("ERR pmc_wrpmcrng on F_RW_DWord CNC.FANUC", "Return=" & nReturn, True) ' MsgBox(szErrorDesc & vbLf & "Occurred in: " & Position, MsgBoxStyle.Exclamation + MsgBoxStyle.ApplicationModal, "Error on Fanuc CNC Data Window") ' 'End If 'End If @@ -1516,8 +1516,8 @@ Namespace CNC ' leggo tutto!!! nReturn = Focas1.cnc_rdposition(nLibHandle(nPathIdx), -1, nNumAxisRead, posizAssi) - If F_CheckRetError_Cnc(nReturn, "cnc_rdposition RefreshAxisPosition CNC.FANUC.CMS_CncLib") Then - Throw New CmsNcException("ERR cnc_rdposition RefreshAxisPosition CNC.FANUC.CMS_CncLib") + If F_CheckRetError_Cnc(nReturn, "cnc_rdposition RefreshAxisPosition CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rdposition RefreshAxisPosition CNC.FANUC.CncLib") End If End If @@ -1545,8 +1545,8 @@ Namespace CNC ' 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") + If F_CheckRetError_Cnc(nReturn, "cnc_rdsvmeter RefreshAxisMeter CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rdsvmeter RefreshAxisMeter CNC.FANUC.CncLib") End If End If @@ -1576,8 +1576,8 @@ Namespace CNC ' leggo feed globale nReturn = Focas1.cnc_actf(nLibHandle(nPathIdx), feedData) - If F_CheckRetError_Cnc(nReturn, "cnc_actf RefreshActFeedRate CNC.FANUC.CMS_CncLib") Then - Throw New CmsNcException("ERR cnc_actf RefreshActFeedRate CNC.FANUC.CMS_CncLib") + If F_CheckRetError_Cnc(nReturn, "cnc_actf RefreshActFeedRate CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_actf RefreshActFeedRate CNC.FANUC.CncLib") End If End If @@ -1608,8 +1608,8 @@ Namespace CNC ' leggo feed globale nReturn = Focas1.cnc_rdspload(nLibHandle(nPathIdx), -1, allData) - If F_CheckRetError_Cnc(nReturn, "cnc_rdspload RefreshAllSpindleLoad CNC.FANUC.CMS_CncLib") Then - Throw New CmsNcException("ERR cnc_rdspload RefreshAllSpindleLoad CNC.FANUC.CMS_CncLib") + If F_CheckRetError_Cnc(nReturn, "cnc_rdspload RefreshAllSpindleLoad CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rdspload RefreshAllSpindleLoad CNC.FANUC.CncLib") End If End If @@ -1640,8 +1640,8 @@ Namespace CNC '!!! non funziona: con -1 LEGGE 1 SOLO ASSE!!! 'nReturn = Focas1.cnc_rddynamic2(nLibHandle(nPathIdx), -1, 28 + 4 * (4 * nNumAxisRead), 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") + If F_CheckRetError_Cnc(nReturn, "cnc_rddynamic2 RefreshAllData CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rddynamic2 RefreshAllData CNC.FANUC.CncLib") End If End If @@ -1677,8 +1677,8 @@ Namespace CNC ' leggo tutto!!! nReturn = Focas1.cnc_rdalmmsg2(nLibHandle(nPathIdx), -1, numAllarmi, allData) - If F_CheckRetError_Cnc(nReturn, "cnc_rdalmmsg2 GetCncAlarm CNC.FANUC.CMS_CncLib") Then - Throw New CmsNcException("ERR cnc_rdalmmsg2 GetCncAlarm CNC.FANUC.CMS_CncLib") + If F_CheckRetError_Cnc(nReturn, "cnc_rdalmmsg2 GetCncAlarm CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rdalmmsg2 GetCncAlarm CNC.FANUC.CncLib") Return New Focas1.ODBALMMSG2 End If Catch ex As Exception @@ -1713,8 +1713,8 @@ Namespace CNC ' leggo tutto!!! 0-27 (28 elementi) nReturn = Focas1.cnc_rdgcode(nLibHandle(nPathIdx), -1, 1, 37, 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") + If F_CheckRetError_Cnc(nReturn, "cnc_rdgcode RefreshPathGCode CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rdgcode RefreshPathGCode CNC.FANUC.CncLib") End If End If @@ -1744,8 +1744,8 @@ Namespace CNC ' leggo tutto!!! 0-27 (28 elementi) nReturn = Focas1.cnc_rdgcode(nLibHandle(nPathIdx), -2, 1, 4, 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") + If F_CheckRetError_Cnc(nReturn, "cnc_rdgcode RefreshPathGCode CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rdgcode RefreshPathGCode CNC.FANUC.CncLib") End If End If @@ -1775,8 +1775,8 @@ Namespace CNC ' leggo tutto!!! nReturn = Focas1.cnc_rd5axmandt(nLibHandle(nPathIdx), ttCoord) - If F_CheckRetError_Cnc(nReturn, "cnc_rd3dtooltip RefreshPathTTCoord CNC.FANUC.CMS_CncLib") Then - Throw New CmsNcException("ERR cnc_rd3dtooltip RefreshPathTTCoord CNC.FANUC.CMS_CncLib") + If F_CheckRetError_Cnc(nReturn, "cnc_rd3dtooltip RefreshPathTTCoord CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rd3dtooltip RefreshPathTTCoord CNC.FANUC.CncLib") End If End If @@ -1804,8 +1804,8 @@ Namespace CNC ' leggo tutto!!! nReturn = Focas1.cnc_rdspeed(nLibHandle(nPathIdx), -1, speedAssi) - If F_CheckRetError_Cnc(nReturn, "cnc_rdspeed RefreshAxisSpeed CNC.FANUC.CMS_CncLib") Then - Throw New CmsNcException("ERR cnc_rdspeed RefreshAxisSpeed CNC.FANUC.CMS_CncLib") + If F_CheckRetError_Cnc(nReturn, "cnc_rdspeed RefreshAxisSpeed CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rdspeed RefreshAxisSpeed CNC.FANUC.CncLib") End If End If diff --git a/IOB-WIN/CncLib/CNC/CNC.OSAI/CNC.OSAI.vb b/IOB-WIN/CncLib/CNC/CNC.OSAI/CNC.OSAI.vb index f0f4ee7..8e331eb 100644 --- a/IOB-WIN/CncLib/CNC/CNC.OSAI/CNC.OSAI.vb +++ b/IOB-WIN/CncLib/CNC/CNC.OSAI/CNC.OSAI.vb @@ -2,7 +2,7 @@ Imports T_memType = System.Collections.Generic.Dictionary(Of System.Int32, System.Collections.Generic.Dictionary(Of System.Int32, System.Object)) Imports T_memDim = System.Collections.Generic.Dictionary(Of System.Int32, System.Object) -Imports CMSCncLib.Config.Settings +Imports CncLib.Config.Settings Namespace CNC @@ -95,20 +95,20 @@ Namespace CNC Dim sValue(0) As Short Dim TimeStart As Date - 'CMSCncLib.App.Runtime.Log.WI("TRY OpenSession CNC.OSAI", "RemoteName=" & _szRemoteName, CLog.Lev.Secondary) + 'CncLib.App.Runtime.Log.WI("TRY OpenSession CNC.OSAI", "RemoteName=" & _szRemoteName, CLog.Lev.Secondary) 'nReturn = Cndex.OpenSession_C(_szRemoteName, _UserSession, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("OpenSession_C({0},{1}) Connect CNC.OSAI", _szRemoteName, _UserSession), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Else - 'CMSCncLib.App.Runtime.Log.WI("OK OpenSession CNC.OSAI", , CLog.Lev.Secondary) + 'CncLib.App.Runtime.Log.WI("OK OpenSession CNC.OSAI", , CLog.Lev.Secondary) 'leggo in che fase di boot mi trovo 'nReturn = Cndex.BootPhaseEnquiry_C(_UserSession, pPhase, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("BootPhaseEnquiry_C({0},{1}) Connect CNC.OSAI", _UserSession, pPhase), szReturn) Then _bConnected = False - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Else 'verifico che il sistema si trovi in una fase operativa "stabile" - 'CMSCncLib.App.Runtime.Log.WI("OK BootPhaseEnquiry CNC.OSAI", "Phase=" & pPhase, CLog.Lev.Secondary) + 'CncLib.App.Runtime.Log.WI("OK BootPhaseEnquiry CNC.OSAI", "Phase=" & pPhase, CLog.Lev.Secondary) If pPhase = 4 Then 'SYSTEM_UP_PHASE 'leggo matricola e verifico che sia diversa da zero @@ -132,23 +132,23 @@ Namespace CNC End If If (Now - TimeStart).Seconds > 30 Then - Select Case MsgBox("Matricola non inizializzata in 30 secondi: Verificare CMSKMG o PLC", MsgBoxStyle.Exclamation + MsgBoxStyle.RetryCancel) - Case MsgBoxResult.Retry : TimeStart = Now - Case MsgBoxResult.Cancel : Exit Do - End Select - End If - 'CMSCncLib.App.Runtime.Log.WI("OK Connect CNC.OSAI but SERIAL NUMBER NOT YET INITIALIZED", , CLog.Lev.Secondary) + Select Case MsgBox("Matricola non inizializzata in 30 secondi: Verificare KMG o PLC", MsgBoxStyle.Exclamation + MsgBoxStyle.RetryCancel) + Case MsgBoxResult.Retry : TimeStart = Now + Case MsgBoxResult.Cancel : Exit Do + End Select + End If + 'CncLib.App.Runtime.Log.WI("OK Connect CNC.OSAI but SERIAL NUMBER NOT YET INITIALIZED", , CLog.Lev.Secondary) 'Application.DoEvents() Threading.Thread.Sleep(500) 'aspetto 500ms prima di ritentare 'Application.DoEvents() Loop _bConnected = True - 'CMSCncLib.App.Runtime.Log.WI("OK Connect CNC.OSAI", "Connected=" & _bConnected, CLog.Lev.Secondary) + 'CncLib.App.Runtime.Log.WI("OK Connect CNC.OSAI", "Connected=" & _bConnected, CLog.Lev.Secondary) Else _bConnected = False - 'CMSCncLib.App.Runtime.Log.WI("OK Connect CNC.OSAI but PHASE NOT OK", "Phase=" & pPhase & " Connected=" & _bConnected, CLog.Lev.Secondary) - Throw New CmsNcException("ERR BootPhase NOT OK CNC.OSAI") + 'CncLib.App.Runtime.Log.WI("OK Connect CNC.OSAI but PHASE NOT OK", "Phase=" & pPhase & " Connected=" & _bConnected, CLog.Lev.Secondary) + Throw New NcException("ERR BootPhase NOT OK CNC.OSAI") End If End If End If @@ -165,7 +165,7 @@ Namespace CNC If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("CloseSession_C({0}) Disconnect CNC.OSAI", _UserSession), szReturn) Then _bConnected = False '? bRet = False - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Else _bConnected = False bRet = True @@ -187,21 +187,21 @@ Namespace CNC 'Matricola 'nReturn = Cndex.ReadVarWord_C(_UserSession, Cndex.MW_CODE, 0, 3187, 1, sValue, _ErrClass, _ErrNum) If nReturn = ERRORE Then - 'CMSCncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) + 'CncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) Else Me._Matricola = sValue(0) End If 'Teste 'nReturn = Cndex.ReadVarWord_C(_UserSession, Cndex.MW_CODE, 0, 3161, 1, sValue, _ErrClass, _ErrNum) If nReturn = ERRORE Then - 'CMSCncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) + 'CncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) Else Me._Teste = sValue(0) End If 'Magazzini 'nReturn = Cndex.ReadVarWord_C(_UserSession, Cndex.MW_CODE, 0, 3163, 1, sValue, _ErrClass, _ErrNum) If nReturn = ERRORE Then - 'CMSCncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) + 'CncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) Else Me._Magazzini = sValue(0) End If @@ -211,14 +211,14 @@ Namespace CNC If i <= 8 Then 'nReturn = Cndex.ReadVarWord_C(_UserSession, Cndex.MW_CODE, 0, 3164 + (i - 1), 1, sValue, _ErrClass, _ErrNum) If nReturn = ERRORE Then - 'CMSCncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) + 'CncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) Else Me._ManineMagazzino(i - 1) = sValue(0) End If Else '8-20 'nReturn = Cndex.ReadVarWord_C(_UserSession, Cndex.MW_CODE, 0, 3188 + (i - 1), 1, sValue, _ErrClass, _ErrNum) If nReturn = ERRORE Then - 'CMSCncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) + 'CncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) Else Me._ManineMagazzino(i - 1) = sValue(0) End If @@ -231,21 +231,21 @@ Namespace CNC 'Matricola 'nReturn = Cndex.ReadVarWord_C(_UserSession, Cndex.MW_CODE, 0, 3403, 1, sValue, _ErrClass, _ErrNum) If nReturn = ERRORE Then - 'CMSCncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) + 'CncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) Else Me._Matricola = sValue(0) End If 'Teste 'nReturn = Cndex.ReadVarWord_C(_UserSession, Cndex.MW_CODE, 0, 3405, 1, sValue, _ErrClass, _ErrNum) If nReturn = ERRORE Then - 'CMSCncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) + 'CncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) Else Me._Teste = sValue(0) End If 'Magazzini 'nReturn = Cndex.ReadVarWord_C(_UserSession, Cndex.MW_CODE, 0, 3407, 1, sValue, _ErrClass, _ErrNum) If nReturn = ERRORE Then - 'CMSCncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) + 'CncLib.App.Runtime.Log.WW("ERR GetStaticData CNC.OSAI", "Return=" & nReturn & " ErrClass=" & _ErrClass & " ErrNum=0x" & Hex(_ErrNum)) Else Me._Magazzini = sValue(0) End If @@ -286,7 +286,7 @@ Namespace CNC bStaticDataReaded = True - 'Catch ex As CmsNcException + 'Catch ex As NcException ' Me.CncException(ex.Message) 'End Try @@ -310,7 +310,7 @@ Namespace CNC 'leggo la memoria 'nReturn = Cndex.ReadVarWord_C(_UserSession, MemType, 0, MemIndex, nValue.Length, nValue, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarWord_C({0},{1},{2}) O_RW_Boolean CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False Else If bWrite Then ' *** Write @@ -321,7 +321,7 @@ Namespace CNC End If 'nReturn = Cndex.WriteVarWord_C(_UserSession, MemType, 0, MemIndex, nValue.Length, nValue, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("WriteVarWord_C({0},{1},{2}) O_RW_Boolean CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -360,7 +360,7 @@ Namespace CNC Dim ValStartTmp(0) As Short 'nReturn = Cndex.ReadVarWord_C(_UserSession, MemType, 0, MemIndex, ValStartTmp.Length, ValStartTmp, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarWord_C({0},{1},{2}) O_RW_Byte CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False Else cStart = ShortToByte(ValStartTmp(0), LOW_ORDER) @@ -372,7 +372,7 @@ Namespace CNC Dim ValEndTmp(0) As Short 'nReturn = Cndex.ReadVarWord_C(_UserSession, MemType, 0, MemIndex + ValueTmp.Length - 1, ValEndTmp.Length, ValEndTmp, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarWord_C({0},{1},{2}) O_RW_Byte CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False Else cEnd = ShortToByte(ValEndTmp(0), HIGH_ORDER) @@ -399,14 +399,14 @@ Namespace CNC 'nReturn = Cndex.WriteVarWord_C(_UserSession, MemType, 0, MemIndex, Value.Length, ValueTmp, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("WriteVarWord_C({0},{1},{2}) O_RW_DWord CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If Else ' ************* Read 'nReturn = Cndex.ReadVarWord_C(_UserSession, MemType, 0, MemIndex, ValueTmp.Length, ValueTmp, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarWord_C({0},{1},{2}) O_RW_Byte CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False Else For i = 0 To Value.Length - 1 @@ -437,14 +437,14 @@ Namespace CNC Next 'nReturn = Cndex.WriteVarWord_C(_UserSession, MemType, 0, MemIndex, Value.Length, nValue, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("WriteVarWord_C({0},{1},{2}) O_RW_Word CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If Else ' ************* Read 'nReturn = Cndex.ReadVarWord_C(_UserSession, MemType, 0, MemIndex, Value.Length, nValue, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarWord_C({0},{1},{2}) O_RW_Word CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If For i = 0 To Value.Length - 1 @@ -471,14 +471,14 @@ Namespace CNC If bWrite Then ' *** Write 'nReturn = Cndex.WriteVarWord_C(_UserSession, MemType, 0, MemIndex, Value.Length, Value, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("WriteVarWord_C({0},{1},{2}) O_RW_Word CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If Else ' ************* Read 'nReturn = Cndex.ReadVarWord_C(_UserSession, MemType, 0, MemIndex, Value.Length, Value, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarWord_C({0},{1},{2}) O_RW_Word CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If End If @@ -506,14 +506,14 @@ Namespace CNC Next 'nReturn = Cndex.WriteVarWord_C(_UserSession, MemType, 0, MemIndex, ValueTmp.Length, ValueTmp, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("WriteVarWord_C({0},{1},{2}) O_RW_DWord CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If Else ' ************* Read 'nReturn = Cndex.ReadVarWord_C(_UserSession, MemType, 0, MemIndex, ValueTmp.Length, ValueTmp, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarWord_C({0},{1},{2}) O_RW_DWord CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False Else For i = 0 To Value.Length - 1 @@ -546,14 +546,14 @@ Namespace CNC Next 'nReturn = Cndex.WriteVarWord_C(_UserSession, MemType, 0, MemIndex, ValueTmp.Length, ValueTmp, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("WriteVarWord_C({0},{1},{2}) O_RW_DWord CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If Else ' ************* Read 'nReturn = Cndex.ReadVarWord_C(_UserSession, MemType, 0, MemIndex, ValueTmp.Length, ValueTmp, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarWord_C({0},{1},{2}) O_RW_DWord CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False Else For i = 0 To Value.Length - 1 @@ -581,14 +581,14 @@ Namespace CNC If bWrite Then ' *** Write 'nReturn = Cndex.WriteVarDouble_C(_UserSession, MemType, 0, MemIndex, Value.Length, Value, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("WriteVarDouble_C({0},{1},{2}) O_RW_Double CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException("ERR WriteVarDouble_C O_RW_Double CNC.OSAI") + Throw New NcException("ERR WriteVarDouble_C O_RW_Double CNC.OSAI") Return False End If Else ' ************* Read 'nReturn = Cndex.ReadVarDouble_C(_UserSession, MemType, 0, MemIndex, Value.Length, Value, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarDouble_C({0},{1},{2}) O_RW_Double CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException("ERR ReadVarDouble_C O_RW_Double CNC.OSAI") + Throw New NcException("ERR ReadVarDouble_C O_RW_Double CNC.OSAI") Return False End If End If @@ -610,14 +610,14 @@ Namespace CNC If bWrite Then ' *** Write 'nReturn = Cndex.WriteVarText_C(_UserSession, MemType, 1, MemIndex, MemLength, Value, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("WriteVarText_C({0},{1},{2}) O_RW_Text CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException("ERR WriteVarText_C O_RW_Text CNC.OSAI") + Throw New NcException("ERR WriteVarText_C O_RW_Text CNC.OSAI") Return False End If Else ' ************* Read 'nReturn = Cndex.ReadVarText_C(_UserSession, MemType, 1, MemIndex, MemLength, Value, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, String.Format("ReadVarText_C({0},{1},{2}) O_RW_Text CNC.OSAI", [Enum].GetName(MemType.GetType, MemType), MemIndex, Value), szReturn) Then - Throw New CmsNcException("ERR ReadVarText_C O_RW_Text CNC.OSAI") + Throw New NcException("ERR ReadVarText_C O_RW_Text CNC.OSAI") Return False End If End If @@ -657,7 +657,7 @@ Namespace CNC 'nReturn = Cndex.GetSelectedProcess_C(_UserSession, ProcessId, _ErrClass, _ErrNum) If O_CheckRetError(nReturn, _ErrClass, _ErrNum, "GetSelectedProcess_C O_GetSelectedProcess CNC.OSAI", szReturn) Then - Throw New CmsNcException("ERR GetSelectedProcess_C O_GetSelectedProcess CNC.OSAI") + Throw New NcException("ERR GetSelectedProcess_C O_GetSelectedProcess CNC.OSAI") Return False End If @@ -688,7 +688,7 @@ Namespace CNC Line = szLine2 If O_CheckRetError(nReturn, _ErrClass, _ErrNum, "GetPartProgramLines_C O_GetActiveLineProgram CNC.OSAI", szReturn) Then - Throw New CmsNcException("ERR GetPartProgramLines_C O_GetActiveLineProgram CNC.OSAI") + Throw New NcException("ERR GetPartProgramLines_C O_GetActiveLineProgram CNC.OSAI") Return False End If diff --git a/IOB-WIN/CncLib/CNC/CNC.OSAI/CNC.OSAI_SOAP.vb b/IOB-WIN/CncLib/CNC/CNC.OSAI/CNC.OSAI_SOAP.vb index 0cb762d..cb9a789 100644 --- a/IOB-WIN/CncLib/CNC/CNC.OSAI/CNC.OSAI_SOAP.vb +++ b/IOB-WIN/CncLib/CNC/CNC.OSAI/CNC.OSAI_SOAP.vb @@ -1,4 +1,4 @@ -Imports CMSCncLib.Config.Settings +Imports CncLib.Config.Settings Namespace CNC @@ -80,15 +80,15 @@ Namespace CNC BootPhaseEnquiryR = OPENws.BootPhaseEnquiry(BootPhaseEnquiry) Catch ex As System.ServiceModel.EndpointNotFoundException _bConnected = False - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Catch ex As System.ServiceModel.CommunicationException _bConnected = False - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) End Try If O_CheckRetError(BootPhaseEnquiryR.retval, BootPhaseEnquiryR.ErrClass, BootPhaseEnquiryR.ErrNum, String.Format("BootPhaseEnquiry({0}) Connect CNC.OSAI_OPEN", BootPhaseEnquiry), szReturn) Then _bConnected = False - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Else 'verifico che il sistema si trovi in una fase operativa "stabile" If BootPhaseEnquiryR.Phase = 4 Then 'SYSTEM_UP_PHASE @@ -116,7 +116,7 @@ Namespace CNC _bConnected = True Else _bConnected = False - Throw New CmsNcException("ERR BootPhase NOT OK CNC.OSAI_OPEN") + Throw New NcException("ERR BootPhase NOT OK CNC.OSAI_OPEN") End If End If @@ -183,7 +183,7 @@ Namespace CNC bStaticDataReaded = True - Catch ex As CmsNcException + Catch ex As NcException Me.CncException(ex.Message) End Try @@ -215,7 +215,7 @@ Retry: nRetry += 1 myWriteVarWordBit.BitValue = IIf(Value, 1, 0) myWriteVarWordBitR = OPENws.WriteVarWordBit(myWriteVarWordBit) If O_CheckRetError(myWriteVarWordBitR.retval, myWriteVarWordBitR.ErrClass, myWriteVarWordBitR.ErrNum, String.Format("WriteVarWordBit({0},{1}) O_RW_Boolean CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -227,7 +227,7 @@ Retry: nRetry += 1 myReadVarWord.NumVar = 1 myReadVarWordR = OPENws.ReadVarWord(myReadVarWord) If O_CheckRetError(myReadVarWordR.retval, myReadVarWordR.ErrClass, myReadVarWordR.ErrNum, String.Format("ReadVarWord({0},{1}) O_RW_Boolean CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If If (myReadVarWordR.Value(0) And (2 ^ MemBit)) = (2 ^ MemBit) Then 'True @@ -240,10 +240,10 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False Catch ex As System.TimeoutException - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -310,7 +310,7 @@ Retry: nRetry += 1 myReadVarWord.NumVar = ValueTmp.Length myReadVarWordR = OPENws.ReadVarWord(myReadVarWord) If O_CheckRetError(myReadVarWordR.retval, myReadVarWordR.ErrClass, myReadVarWordR.ErrNum, String.Format("ReadVarWord({0},{1}) O_RW_Byte CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If For i = 0 To Value.Length - 1 @@ -321,10 +321,10 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False Catch ex As System.TimeoutException - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -353,7 +353,7 @@ Retry: nRetry += 1 Array.Copy(Value, myWriteVarWord.Value, Value.Length) myWriteVarWordR = OPENws.WriteVarWord(myWriteVarWord) If O_CheckRetError(myWriteVarWordR.retval, myWriteVarWordR.ErrClass, myWriteVarWordR.ErrNum, String.Format("WriteVarWord({0},{1}) O_RW_Word CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -365,7 +365,7 @@ Retry: nRetry += 1 myReadVarWord.NumVar = Value.Length myReadVarWordR = OPENws.ReadVarWord(myReadVarWord) If O_CheckRetError(myReadVarWordR.retval, myReadVarWordR.ErrClass, myReadVarWordR.ErrNum, String.Format("ReadVarWord({0},{1}) O_RW_Word CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If Array.Copy(myReadVarWordR.Value, Value, Value.Length) @@ -375,10 +375,10 @@ Retry: nRetry += 1 Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False Catch ex As System.TimeoutException - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -410,7 +410,7 @@ Retry: nRetry += 1 Next myWriteVarWordR = OPENws.WriteVarWord(myWriteVarWord) If O_CheckRetError(myWriteVarWordR.retval, myWriteVarWordR.ErrClass, myWriteVarWordR.ErrNum, String.Format("WriteVarWord({0},{1}) O_RW_Short CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -422,7 +422,7 @@ Retry: nRetry += 1 myReadVarWord.NumVar = Value.Length myReadVarWordR = OPENws.ReadVarWord(myReadVarWord) If O_CheckRetError(myReadVarWordR.retval, myReadVarWordR.ErrClass, myReadVarWordR.ErrNum, String.Format("ReadVarWord({0},{1}) O_RW_Short CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If For i = 0 To Value.Length - 1 @@ -432,10 +432,10 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False Catch ex As System.TimeoutException - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -470,7 +470,7 @@ Retry: nRetry += 1 Array.Copy(ValueTmp, myWriteVarWord.Value, ValueTmp.Length) myWriteVarWordR = OPENws.WriteVarWord(myWriteVarWord) If O_CheckRetError(myWriteVarWordR.retval, myWriteVarWordR.ErrClass, myWriteVarWordR.ErrNum, String.Format("WriteVarWord({0},{1}) O_RW_DWord CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -482,7 +482,7 @@ Retry: nRetry += 1 myReadVarWord.NumVar = ValueTmp.Length myReadVarWordR = OPENws.ReadVarWord(myReadVarWord) If O_CheckRetError(myReadVarWordR.retval, myReadVarWordR.ErrClass, myReadVarWordR.ErrNum, String.Format("ReadVarWord({0},{1}) O_RW_DWord CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False Else For i = 0 To Value.Length - 1 @@ -494,10 +494,10 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False Catch ex As System.TimeoutException - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -532,7 +532,7 @@ Retry: nRetry += 1 Array.Copy(ValueTmp, myWriteVarWord.Value, ValueTmp.Length) myWriteVarWordR = OPENws.WriteVarWord(myWriteVarWord) If O_CheckRetError(myWriteVarWordR.retval, myWriteVarWordR.ErrClass, myWriteVarWordR.ErrNum, String.Format("WriteVarDWord({0},{1}) O_RW_DWord CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -544,7 +544,7 @@ Retry: nRetry += 1 myReadVarWord.NumVar = ValueTmp.Length myReadVarWordR = OPENws.ReadVarWord(myReadVarWord) If O_CheckRetError(myReadVarWordR.retval, myReadVarWordR.ErrClass, myReadVarWordR.ErrNum, String.Format("ReadVarDWord({0},{1}) O_RW_DWord CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False Else For i = 0 To Value.Length - 1 @@ -556,10 +556,10 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False Catch ex As System.TimeoutException - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -588,7 +588,7 @@ Retry: nRetry += 1 Array.Copy(Value, myWriteVarDouble.Value, Value.Length) myWriteVarDoubleR = OPENws.WriteVarDouble(myWriteVarDouble) If O_CheckRetError(myWriteVarDoubleR.retval, myWriteVarDoubleR.ErrClass, myWriteVarDoubleR.ErrNum, String.Format("WriteVarDouble({0},{1}) O_RW_Double CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -600,7 +600,7 @@ Retry: nRetry += 1 myReadVarDouble.NumVar = Value.Length myReadVarDoubleR = OPENws.ReadVarDouble(myReadVarDouble) If O_CheckRetError(myReadVarDoubleR.retval, myReadVarDoubleR.ErrClass, myReadVarDoubleR.ErrNum, String.Format("ReadVarDouble({0},{1}) O_RW_Double CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If Array.Copy(myReadVarDoubleR.Value, Value, Value.Length) @@ -609,10 +609,10 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False Catch ex As System.TimeoutException - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -641,7 +641,7 @@ Retry: nRetry += 1 myWriteVarText.Process = 1 'serve per le variabili SC myWriteVarTextR = OPENws.WriteVarText(myWriteVarText) If O_CheckRetError(myWriteVarTextR.retval, myWriteVarTextR.ErrClass, myWriteVarTextR.ErrNum, String.Format("WriteVarText({0},{1}) O_RW_Text CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -654,17 +654,17 @@ Retry: nRetry += 1 myReadVarText.Process = 1 'serve per le variabili SC myReadVarTextR = OPENws.ReadVarText(myReadVarText) If O_CheckRetError(myReadVarTextR.retval, myReadVarTextR.ErrClass, myReadVarTextR.ErrNum, String.Format("ReadVarText({0},{1}) O_RW_Text CNC.OSAI_OPEN", [Enum].GetName(MemType.GetType, MemType), MemIndex), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If Value = myReadVarTextR.Text End If Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False Catch ex As System.TimeoutException - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try @@ -690,7 +690,7 @@ Retry: nRetry += 1 myGetOffsetTabRecordII.RecordNum = ToolOffsetNumber myGetOffsetTabRecordIIR = OPENws.GetOffsetTabRecordII(myGetOffsetTabRecordII) If O_CheckRetError(myGetOffsetTabRecordIIR.retval, myGetOffsetTabRecordIIR.ErrClass, myGetOffsetTabRecordIIR.ErrNum, String.Format("GetOffsetTabRecordII({0}) O_RW_ToolOffset CNC.OSAI_OPEN", ToolOffsetNumber), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -707,7 +707,7 @@ Retry: nRetry += 1 'scrivo il correttore mySetOffsetTabRecordIIR = OPENws.SetOffsetTabRecordII(mySetOffsetTabRecordII) If O_CheckRetError(mySetOffsetTabRecordIIR.retval, mySetOffsetTabRecordIIR.ErrClass, mySetOffsetTabRecordIIR.ErrNum, String.Format("SetOffsetTabRecordII({0}) O_RW_ToolOffset CNC.OSAI_OPEN", ToolOffsetNumber), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -717,7 +717,7 @@ Retry: nRetry += 1 myGetOffsetTabRecordII.RecordNum = ToolOffsetNumber myGetOffsetTabRecordIIR = OPENws.GetOffsetTabRecordII(myGetOffsetTabRecordII) If O_CheckRetError(myGetOffsetTabRecordIIR.retval, myGetOffsetTabRecordIIR.ErrClass, myGetOffsetTabRecordIIR.ErrNum, String.Format("GetOffsetTabRecordII({0}) O_RW_ToolOffset CNC.OSAI_OPEN", ToolOffsetNumber), szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -728,7 +728,7 @@ Retry: nRetry += 1 End If Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try @@ -755,7 +755,7 @@ Retry: nRetry += 1 myLockTableII.TableNum = O_Table.OFFSET_TABLE_ID myLockTableIIR = OPENws.LockTableII(myLockTableII) If O_CheckRetError(myLockTableIIR.retval, myLockTableIIR.ErrClass, myLockTableIIR.ErrNum, String.Format("LockTableII({0}) O_LockOffsetTable CNC.OSAI_OPEN", myLockTableII.TableNum), szReturn) Then - 'Throw New CmsNcException(szReturn) + 'Throw New NcException(szReturn) Return False End If bLocked = True @@ -766,7 +766,7 @@ Retry: nRetry += 1 myUnLockTableII.TableNum = O_Table.OFFSET_TABLE_ID myUnLockTableIIR = OPENws.UnLockTableII(myUnLockTableII) If O_CheckRetError(myUnLockTableIIR.retval, myUnLockTableIIR.ErrClass, myUnLockTableIIR.ErrNum, String.Format("UnLockTableII({0}) O_LockOffsetTable CNC.OSAI_OPEN", myUnLockTableII.TableNum), szReturn) Then - 'Throw New CmsNcException(szReturn) + 'Throw New NcException(szReturn) Return False End If bLocked = False @@ -774,7 +774,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -795,7 +795,7 @@ Retry: nRetry += 1 Try myGetSelectedProcessR = OPENws.GetSelectedProcess(myGetSelectedProcess) If O_CheckRetError(myGetSelectedProcessR.retval, myGetSelectedProcessR.ErrClass, myGetSelectedProcessR.ErrNum, "GetSelectedProcess() O_GetSelectedProcess CNC.OSAI_OPEN", szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -803,7 +803,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -827,7 +827,7 @@ Retry: nRetry += 1 myGetPartProgramLines.ProcNum = ProcessId myGetPartProgramLinesR = OPENws.GetPartProgramLines(myGetPartProgramLines) If O_CheckRetError(myGetPartProgramLinesR.retval, myGetPartProgramLinesR.ErrClass, myGetPartProgramLinesR.ErrNum, "GetPartProgramLines() O_GetActiveLineProgram CNC.OSAI_OPEN", szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -835,7 +835,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -859,7 +859,7 @@ Retry: nRetry += 1 myGetAxesInfo3.AxesNum = 64 myGetAxesInfo3R = OPENws.GetAxesInfo3(myGetAxesInfo3) If O_CheckRetError(myGetAxesInfo3R.retval, myGetAxesInfo3R.ErrClass, myGetAxesInfo3R.ErrNum, "GetAxesInfo3() O_RW_Word CNC.OSAI_OPEN", szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -878,7 +878,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try End Function @@ -902,7 +902,7 @@ Retry: nRetry += 1 myGetNcInfo1.ProcNum = ProcessId myGetNcInfo1R = OPENws.GetNcInfo1(myGetNcInfo1) If O_CheckRetError(myGetNcInfo1R.retval, myGetNcInfo1R.ErrClass, myGetNcInfo1R.ErrNum, "GetNcInfo1() O_GetNcInfo1 CNC.OSAI_OPEN", szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -910,7 +910,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try @@ -933,7 +933,7 @@ Retry: nRetry += 1 myReadCurrentErrorMsg.Process = ProcessId myReadCurrentErrorMsgR = OPENws.ReadCurrentErrorMsg(myReadCurrentErrorMsg) If O_CheckRetError(myReadCurrentErrorMsgR.retval, myReadCurrentErrorMsgR.ErrClass, myReadCurrentErrorMsgR.ErrNum, "ReadCurrentErrorMsg() O_ReadCurrentErrorMsg CNC.OSAI_OPEN", szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -941,7 +941,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try @@ -963,7 +963,7 @@ Retry: nRetry += 1 myReadCurrentEmergMsg.Process = ProcessId myReadCurrentEmergMsgR = OPENws.ReadCurrentEmergMsg(myReadCurrentEmergMsg) If O_CheckRetError(myReadCurrentEmergMsgR.retval, myReadCurrentEmergMsgR.ErrClass, myReadCurrentEmergMsgR.ErrNum, "ReadCurrentEmergMsg() O_ReadCurrentEmergMsg CNC.OSAI_OPEN", szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -971,7 +971,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try @@ -992,7 +992,7 @@ Retry: nRetry += 1 myReadCurrentAnomalyMsgR = OPENws.ReadCurrentAnomalyMsg(myReadCurrentAnomalyMsg) If O_CheckRetError(myReadCurrentAnomalyMsgR.retval, myReadCurrentAnomalyMsgR.ErrClass, myReadCurrentAnomalyMsgR.ErrNum, "ReadCurrentAnomalyMsg() O_ReadCurrentAnomalyMsg CNC.OSAI_OPEN", szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -1000,7 +1000,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try @@ -1025,7 +1025,7 @@ Retry: nRetry += 1 myGetAxesPositionR = OPENws.GetAxesPosition(myGetAxesPosition) If O_CheckRetError(myGetAxesPositionR.retval, myGetAxesPositionR.ErrClass, myGetAxesPositionR.ErrNum, "GetAxesPosition() getAllAxisPos CNC.OSAI_OPEN", szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -1033,7 +1033,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try @@ -1056,7 +1056,7 @@ Retry: nRetry += 1 myGetGCodeR = OPENws.GetGCode(myGetGCode) If O_CheckRetError(myGetGCodeR.retval, myGetGCodeR.ErrClass, myGetGCodeR.ErrNum, "ReadCurrentGCodes() O_ReadCurrentGCodes CNC.OSAI_OPEN", szReturn) Then - Throw New CmsNcException(szReturn) + Throw New NcException(szReturn) Return False End If @@ -1065,7 +1065,7 @@ Retry: nRetry += 1 Return True Catch ex As System.ServiceModel.CommunicationException If nRetry < MAXRET Then GoTo Retry - Throw New CmsNcException(ex.Message) + Throw New NcException(ex.Message) Return False End Try @@ -1101,8 +1101,8 @@ Retry: nRetry += 1 ' leggo tutto!!! nReturn = Focas1.cnc_rdalmmsg2(nLibHandle(nPathIdx), -1, numAllarmi, allData) - If F_CheckRetError_Cnc(nReturn, "cnc_rdalmmsg2 GetCncAlarm CNC.FANUC.CMS_CncLib") Then - Throw New CmsNcException("ERR cnc_rdalmmsg2 GetCncAlarm CNC.FANUC.CMS_CncLib") + If F_CheckRetError_Cnc(nReturn, "cnc_rdalmmsg2 GetCncAlarm CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rdalmmsg2 GetCncAlarm CNC.FANUC.CncLib") End If End If @@ -1134,8 +1134,8 @@ Retry: nRetry += 1 ' leggo tutto!!! nReturn = Focas1.cnc_rd5axmandt(nLibHandle(nPathIdx), ttCoord) - If F_CheckRetError_Cnc(nReturn, "cnc_rd3dtooltip RefreshPathTTCoord CNC.FANUC.CMS_CncLib") Then - Throw New CmsNcException("ERR cnc_rd3dtooltip RefreshPathTTCoord CNC.FANUC.CMS_CncLib") + If F_CheckRetError_Cnc(nReturn, "cnc_rd3dtooltip RefreshPathTTCoord CNC.FANUC.CncLib") Then + Throw New NcException("ERR cnc_rd3dtooltip RefreshPathTTCoord CNC.FANUC.CncLib") End If End If diff --git a/IOB-WIN/CncLib/CNC/CNC.Runtime.vb b/IOB-WIN/CncLib/CNC/CNC.Runtime.vb index bdfa3f0..b6b02e9 100644 --- a/IOB-WIN/CncLib/CNC/CNC.Runtime.vb +++ b/IOB-WIN/CncLib/CNC/CNC.Runtime.vb @@ -1,7 +1,7 @@ Namespace CNC Public Class Runtime - Public Shared NC As CMSCncLib.CNC.CNC + Public Shared NC As CncLib.CNC.CNC Public Shared Sub CreateNC(tipoNC As CNC.NcType, ipTarget As String) @@ -11,7 +11,7 @@ Select Case tipoNC Case NC_FANUC - 'CMSCncLib.App.Runtime.Log.WI("TRY creating NC CNC.NC", "TypeNC=" & Config.Settings.Settings.TypeNC.ToString, CLog.Lev.Principal) + 'CncLib.App.Runtime.Log.WI("TRY creating NC CNC.NC", "TypeNC=" & Config.Settings.Settings.TypeNC.ToString, CLog.Lev.Principal) Dim ipFanuc As String Dim portIpFanuc As String Dim CncScreenHssb As String @@ -47,18 +47,18 @@ Case NC_SIEMENS Try NC = New SIEMENS - Catch ex As CmsNcException + Catch ex As NcException 'NC.frmMain_ref.ExitApp() 'frmMain.ExitApp() 'End End Try End Select - 'CMSCncLib.App.Runtime.Log.WI("OK crating NC CNC.NC", , CLog.Lev.Principal) + 'CncLib.App.Runtime.Log.WI("OK crating NC CNC.NC", , CLog.Lev.Principal) Catch ex As Exception Dim exStr As String exStr = ex.Message - 'CMSCncLib.App.Runtime.Log.WE("ERR crating NC CNC.NC", ex.Message, True) + 'CncLib.App.Runtime.Log.WE("ERR crating NC CNC.NC", ex.Message, True) End Try diff --git a/IOB-WIN/CncLib/CNC/CNC.SIEMENS/CNC.SIEMENS.vb b/IOB-WIN/CncLib/CNC/CNC.SIEMENS/CNC.SIEMENS.vb index 18e293c..99f4723 100644 --- a/IOB-WIN/CncLib/CNC/CNC.SIEMENS/CNC.SIEMENS.vb +++ b/IOB-WIN/CncLib/CNC/CNC.SIEMENS/CNC.SIEMENS.vb @@ -52,15 +52,15 @@ Namespace CNC MyBase.New() _Type = NcType.SIEMENS - ' commentato in blocco: c aspettiamo che il CmsControl, che lancia l'adapter, si occupi della verifica dell'HMI siemens - ''verifico di aver prima avviato la Sinumerik HMI - 'If FindProcess("slsmhmihost") Is Nothing Then - ' 'MessageBox.Show("Sinumerik HMI process not found!" & vbNewLine & _ - ' ' "Run Sinumerik HMI before starting CMS Control.", My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Stop) - ' Throw New CmsNcException("ERR Sinumerik HMI process not found CNC.SIEMENS") - 'End If + ' commentato in blocco: c aspettiamo che il SINUMERIK HMI Control, che lancia l'adapter, si occupi della verifica dell'HMI siemens + ''verifico di aver prima avviato la Sinumerik HMI + 'If FindProcess("slsmhmihost") Is Nothing Then + ' 'MessageBox.Show("Sinumerik HMI process not found!" & vbNewLine & _ + ' ' "Run Sinumerik HMI before starting SINUMERIK HMI Control.", My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Stop) + ' Throw New NcException("ERR Sinumerik HMI process not found CNC.SIEMENS") + 'End If - Try + Try m_DataSvcRW = New DataSvc m_DriveSVC = New DrivesSvc m_AlarmService = New AlarmSvc("eng") @@ -68,11 +68,11 @@ Namespace CNC m_AlarmGuid = m_AlarmService.Subscribe(New AlarmListChanged(AddressOf AlarmList)) Catch ex As System.IO.FileNotFoundException - ' intercetta l'exception se non lanciato sopra l'hmi - 'MessageBox.Show("CMS Control must be run over Sinumerik Operate!" & vbNewLine & _ - '"Run CMS Control through shortcut.", My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Stop) - Throw New CmsNcException("ERR CMS Control must be run over Sinumerik Operate CNC.SIEMENS") - End Try + ' intercetta l'exception se non lanciato sopra l'hmi + 'MessageBox.Show("SINUMERIK HMI Control must be run over Sinumerik Operate!" & vbNewLine & _ + '"Run SINUMERIK HMI Control through shortcut.", My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Stop) + Throw New NcException("ERR SINUMERIK HMI Control must be run over Sinumerik Operate CNC.SIEMENS") + End Try End Sub @@ -82,7 +82,7 @@ Namespace CNC _bConnected = True 'Log.WI("OK Connect CNC.SIEMENS", "Connected=" & _bConnected, CLog.Lev.Secondary) Catch ex As Exception - Throw New CmsNcException("ERR Connect CNC.SIEMENS", ex) + Throw New NcException("ERR Connect CNC.SIEMENS", ex) End Try End Sub @@ -93,7 +93,7 @@ Namespace CNC _bConnected = False 'Log.WI("OK Disconnect CNC.SIEMENS", "Connected=" & _bConnected, CLog.Lev.Secondary) Catch ex As Exception - Throw New CmsNcException("ERR Disconnect CNC.SIEMENS", ex) + Throw New NcException("ERR Disconnect CNC.SIEMENS", ex) End Try End Sub @@ -146,9 +146,9 @@ Namespace CNC bStaticDataReaded = True Catch ex As InfrastructureException - Throw New CmsNcException("ERR GetStaticData CNC.SIEMENS InfrastructureException", ex) + Throw New NcException("ERR GetStaticData CNC.SIEMENS InfrastructureException", ex) Catch ex As DataSvcException - Throw New CmsNcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex) + Throw New NcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex) End Try End If @@ -969,7 +969,7 @@ Namespace CNC Catch ex As DataSvcBusyException Debug.Print(ex.Message) Catch ex As DataSvcException - Throw New CmsNcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex) + Throw New NcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex) End Try Loop @@ -1014,7 +1014,7 @@ Namespace CNC Catch ex As DataSvcBusyException Debug.Print(ex.Message) Catch ex As DataSvcException - Throw New CmsNcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex) + Throw New NcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex) End Try Loop @@ -1095,7 +1095,7 @@ Namespace CNC Catch ex As DataSvcBusyException Debug.Print(ex.Message) Catch ex As DataSvcException - Throw New CmsNcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex) + Throw New NcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex) End Try Loop diff --git a/IOB-WIN/CncLib/CNC/CNC/CNC.CNC.vb b/IOB-WIN/CncLib/CNC/CNC/CNC.CNC.vb index 9ae1903..0a3c588 100644 --- a/IOB-WIN/CncLib/CNC/CNC/CNC.CNC.vb +++ b/IOB-WIN/CncLib/CNC/CNC/CNC.CNC.vb @@ -3,237 +3,237 @@ Imports System.Runtime.Serialization Namespace CNC - Partial Public MustInherit Class CNC + Partial Public MustInherit Class CNC - Protected bStaticDataReaded As Boolean - Protected _CncWindowProcess As Process + Protected bStaticDataReaded As Boolean + Protected _CncWindowProcess As Process - Public Const R = False - Public Const W = True + Public Const R = False + Public Const W = True - Public Enum NcType - DEMO = 0 - FANUC = 1 - OSAI = 2 - SIEMENS = 3 - End Enum + Public Enum NcType + DEMO = 0 + FANUC = 1 + OSAI = 2 + SIEMENS = 3 + End Enum - Public Enum Memo - MemBool = 1 - MemByte = 2 - MemWord = 3 - MemInt = 4 - MemDWord = 5 - MemDInt = 6 - MemSingle = 7 - MemDouble = 8 - End Enum + Public Enum Memo + MemBool = 1 + MemByte = 2 + MemWord = 3 + MemInt = 4 + MemDWord = 5 + MemDInt = 6 + MemSingle = 7 + MemDouble = 8 + End Enum - Public Enum InfoType - Descrizione - Matricola - Teste - Magazzini - ManineMagazzino - End Enum + Public Enum InfoType + Descrizione + Matricola + Teste + Magazzini + ManineMagazzino + End Enum - Protected _Type As NcType - Public ReadOnly Property Type() As NcType - Get - Return _Type - End Get - End Property + Protected _Type As NcType + Public ReadOnly Property Type() As NcType + Get + Return _Type + End Get + End Property - Protected _Descrizione As String - Public ReadOnly Property Descrizione() As String - Get - Return _Descrizione - End Get - End Property - Protected _Matricola As Integer - Public ReadOnly Property Matricola() As Integer - Get - If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("Matricola not found") - Return _Matricola - End Get - End Property - Protected _Teste As Integer - Public ReadOnly Property Teste() As Integer - Get - If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("Teste not found") - Return _Teste - End Get - End Property - Protected _Magazzini As Integer - Public ReadOnly Property Magazzini() As Integer - Get - If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("Magazzini not found") - Return _Magazzini - End Get - End Property - Protected _ManineMagazzino() As Integer - Public ReadOnly Property ManineMagazzino() As Integer() - Get - If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("ManineMagazzino not found") - Return _ManineMagazzino - End Get - End Property - Protected _MagazziniConAttrezzaggioAutomatico As Integer - Public ReadOnly Property MagazziniConAttrezzaggioAutomatico() As Integer - Get - If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("MagazziniConAttrezzaggioAutomatico not found") - Return _MagazziniConAttrezzaggioAutomatico - End Get - End Property - Protected _MaxUtensiliGestibili As Integer - Public ReadOnly Property MaxUtensiliGestibili() As Integer - Get - If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("MaxUtensiliGestibili not found") - Return _MaxUtensiliGestibili - End Get - End Property - Protected _MaxIdUtensile As Integer - Public ReadOnly Property MaxIdUtensile() As Integer - Get - If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("MaxIdUtensile not found") - Return _MaxIdUtensile - End Get - End Property - Protected _ZoomSpeed As Integer - Public ReadOnly Property ZoomSpeed() As Integer '(aka: FattoreMoltSpeed) - Get - If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("ZoomSpeed not found") - Return _ZoomSpeed - End Get - End Property + Protected _Descrizione As String + Public ReadOnly Property Descrizione() As String + Get + Return _Descrizione + End Get + End Property + Protected _Matricola As Integer + Public ReadOnly Property Matricola() As Integer + Get + If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("Matricola not found") + Return _Matricola + End Get + End Property + Protected _Teste As Integer + Public ReadOnly Property Teste() As Integer + Get + If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("Teste not found") + Return _Teste + End Get + End Property + Protected _Magazzini As Integer + Public ReadOnly Property Magazzini() As Integer + Get + If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("Magazzini not found") + Return _Magazzini + End Get + End Property + Protected _ManineMagazzino() As Integer + Public ReadOnly Property ManineMagazzino() As Integer() + Get + If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("ManineMagazzino not found") + Return _ManineMagazzino + End Get + End Property + Protected _MagazziniConAttrezzaggioAutomatico As Integer + Public ReadOnly Property MagazziniConAttrezzaggioAutomatico() As Integer + Get + If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("MagazziniConAttrezzaggioAutomatico not found") + Return _MagazziniConAttrezzaggioAutomatico + End Get + End Property + Protected _MaxUtensiliGestibili As Integer + Public ReadOnly Property MaxUtensiliGestibili() As Integer + Get + If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("MaxUtensiliGestibili not found") + Return _MaxUtensiliGestibili + End Get + End Property + Protected _MaxIdUtensile As Integer + Public ReadOnly Property MaxIdUtensile() As Integer + Get + If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("MaxIdUtensile not found") + Return _MaxIdUtensile + End Get + End Property + Protected _ZoomSpeed As Integer + Public ReadOnly Property ZoomSpeed() As Integer '(aka: FattoreMoltSpeed) + Get + If Not bStaticDataReaded Then Throw New System.Configuration.SettingsPropertyNotFoundException("ZoomSpeed not found") + Return _ZoomSpeed + End Get + End Property - Protected _ScreenSize As Size - Public Property ScreenSize() As Size - Get - Return _ScreenSize - End Get - Set(ByVal value As Size) - _ScreenSize = value - End Set - End Property + Protected _ScreenSize As Size + Public Property ScreenSize() As Size + Get + Return _ScreenSize + End Get + Set(ByVal value As Size) + _ScreenSize = value + End Set + End Property - Protected _CncWindowSize As Size - Public Property CncWindowSize() As Size - Get - Return _CncWindowSize - End Get - Set(ByVal value As Size) - _CncWindowSize = value - End Set - End Property + Protected _CncWindowSize As Size + Public Property CncWindowSize() As Size + Get + Return _CncWindowSize + End Get + Set(ByVal value As Size) + _CncWindowSize = value + End Set + End Property - Protected _CncWindowPosition As Point - Public Property CncWindowPosition() As Point - Get - Return _CncWindowPosition - End Get - Set(ByVal value As Point) - _CncWindowPosition = value - End Set - End Property + Protected _CncWindowPosition As Point + Public Property CncWindowPosition() As Point + Get + Return _CncWindowPosition + End Get + Set(ByVal value As Point) + _CncWindowPosition = value + End Set + End Property - Protected _bConnected As Boolean - Public Property Connected() As Boolean - Get - Return _bConnected - End Get - Private Set(ByVal value As Boolean) - _bConnected = value - End Set - End Property + Protected _bConnected As Boolean + Public Property Connected() As Boolean + Get + Return _bConnected + End Get + Private Set(ByVal value As Boolean) + _bConnected = value + End Set + End Property - Protected _Licenza As Integer - Public Overridable Property Licenza() As Integer - Get - Return _Licenza - End Get - Set(ByVal value As Integer) - _Licenza = value - End Set - End Property + Protected _Licenza As Integer + Public Overridable Property Licenza() As Integer + Get + Return _Licenza + End Get + Set(ByVal value As Integer) + _Licenza = value + End Set + End Property - Protected _LicenzaScaduta As Boolean - Public Overridable Property LicenzaScaduta() As Boolean - Get - Return _LicenzaScaduta - End Get - Set(ByVal value As Boolean) - _LicenzaScaduta = value - End Set - End Property + Protected _LicenzaScaduta As Boolean + Public Overridable Property LicenzaScaduta() As Boolean + Get + Return _LicenzaScaduta + End Get + Set(ByVal value As Boolean) + _LicenzaScaduta = value + End Set + End Property - Public Sub New() + Public Sub New() - 'Definisco l'area della Cnc Window - _CncWindowPosition = New System.Drawing.Point(0, 0) - _CncWindowSize = New System.Drawing.Size(800, 600) + 'Definisco l'area della Cnc Window + _CncWindowPosition = New System.Drawing.Point(0, 0) + _CncWindowSize = New System.Drawing.Size(800, 600) - End Sub + End Sub - Public Overridable Sub Initialize() - End Sub + Public Overridable Sub Initialize() + End Sub - Public Overridable Sub Connect(Optional ByRef szStatus As String = "") - End Sub + Public Overridable Sub Connect(Optional ByRef szStatus As String = "") + End Sub - Public Overridable Sub Disconnect(Optional ByRef szStatus As String = "") - End Sub + Public Overridable Sub Disconnect(Optional ByRef szStatus As String = "") + End Sub - Public Overridable Sub CncException(Optional ByRef szStatus As String = "") - _bConnected = False - End Sub + Public Overridable Sub CncException(Optional ByRef szStatus As String = "") + _bConnected = False + End Sub - ''' - ''' Legge il valore del tempo di lavorazione totale del CN - ''' - Public Overridable Function GetDataMaintenance() As TimeSpan - End Function + ''' + ''' Legge il valore del tempo di lavorazione totale del CN + ''' + Public Overridable Function GetDataMaintenance() As TimeSpan + End Function - ''' - ''' Legge le memorie di configurazione dal cn - ''' - Public Overridable Sub GetStaticData() - End Sub + ''' + ''' Legge le memorie di configurazione dal cn + ''' + Public Overridable Sub GetStaticData() + End Sub - ''' - ''' Chiude l'applicazione CNC - ''' - Public Overridable Sub CloseCnc() - End Sub + ''' + ''' Chiude l'applicazione CNC + ''' + Public Overridable Sub CloseCnc() + End Sub - End Class + End Class - Public Class CmsNcException - Inherits System.ApplicationException - Public Sub New() - MyBase.New("CMS NC Exception") - End Sub - Public Sub New(ByVal new_message As String) - MyBase.New(new_message) - End Sub - Public Sub New(ByVal new_message As String, ByVal inner_exception As Exception) - MyBase.New(new_message, inner_exception) - End Sub - Public Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext) - MyBase.New(info, context) - End Sub - End Class + Public Class NcException + Inherits System.ApplicationException + Public Sub New() + MyBase.New("NC Exception") + End Sub + Public Sub New(ByVal new_message As String) + MyBase.New(new_message) + End Sub + Public Sub New(ByVal new_message As String, ByVal inner_exception As Exception) + MyBase.New(new_message, inner_exception) + End Sub + Public Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext) + MyBase.New(info, context) + End Sub + End Class - Public MustInherit Class CExceptionInfo - Public Overrides Function ToString() As String - ToString = "" - End Function - End Class + Public MustInherit Class CExceptionInfo + Public Overrides Function ToString() As String + ToString = "" + End Function + End Class End Namespace \ No newline at end of file diff --git a/IOB-WIN/CncLib/CMSCncLib.vbproj b/IOB-WIN/CncLib/CncLib.vbproj similarity index 54% rename from IOB-WIN/CncLib/CMSCncLib.vbproj rename to IOB-WIN/CncLib/CncLib.vbproj index 8456dda..068d93e 100644 --- a/IOB-WIN/CncLib/CMSCncLib.vbproj +++ b/IOB-WIN/CncLib/CncLib.vbproj @@ -6,8 +6,8 @@ AnyCPU {2D769FFD-1122-4276-A115-29246E6D23C5} Library - CMSCncLib - CMSCncLib + CncLib + CncLib 512 Windows v4.5.2 @@ -19,7 +19,7 @@ true true bin\Debug\ - CMSCncLib.xml + CncLib.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 FS30D=1,SIEMENS=1 true @@ -32,7 +32,7 @@ true true bin\Release\ - CMSCncLib.xml + CncLib.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 FS30D=1,SIEMENS=1 false @@ -49,10 +49,10 @@ On - + true - bin\CMS\ - CMSCncLib.xml + bin\FANUC\ + CncLib.xml true 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 pdbonly @@ -61,10 +61,10 @@ FS30D=1,SIEMENS=1 false - + true - bin\SCM\ - CMSCncLib.xml + bin\ESA\ + CncLib.xml true 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 pdbonly @@ -73,11 +73,11 @@ FS30D=1,SIEMENS=1 false - + true - bin\CMS-SIEMENS\ + bin\SIEMENS\ FS30D=1,SIEMENS=1 - CMSCncLib.xml + CncLib.xml true 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 pdbonly @@ -85,11 +85,11 @@ MinimumRecommendedRules.ruleset false - + true - bin\CMS-OSAI\ + bin\OSAI\ FS30D=1,SIEMENS=1 - CMSCncLib.xml + CncLib.xml true 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 pdbonly @@ -178,436 +178,436 @@ My Settings.Designer.vb - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap - + Reference.svcmap diff --git a/IOB-WIN/CncLib/Config/Config.Options.vb b/IOB-WIN/CncLib/Config/Config.Options.vb index 4f9cc55..73618af 100644 --- a/IOB-WIN/CncLib/Config/Config.Options.vb +++ b/IOB-WIN/CncLib/Config/Config.Options.vb @@ -277,7 +277,7 @@ Me._ToolTable_SharedDB = Ini.GetBoolean("OPTIONS", "TOOLTABLE_SHAREDDB", 0) End If Else - 'CMSCncLib.App.Runtime.Log.WW("ERR LoadOptions", String.Format("File {0} not found", szFileIni), True) + 'CncLib.App.Runtime.Log.WW("ERR LoadOptions", String.Format("File {0} not found", szFileIni), True) End If End Sub diff --git a/IOB-WIN/CncLib/Config/Config.Settings.vb b/IOB-WIN/CncLib/Config/Config.Settings.vb index d8374cf..56fbfe0 100644 --- a/IOB-WIN/CncLib/Config/Config.Settings.vb +++ b/IOB-WIN/CncLib/Config/Config.Settings.vb @@ -133,7 +133,7 @@ Namespace Config End If End With Else - 'CMSCncLib.App.Runtime.Log.WW("ERR LoadFromFile", String.Format("File {0} not found", szFileIni), True) + 'CncLib.App.Runtime.Log.WW("ERR LoadFromFile", String.Format("File {0} not found", szFileIni), True) End If End Sub @@ -173,9 +173,9 @@ Namespace Config Next End With - 'CMSCncLib.App.Runtime.Log.WI("END SaveToFile", , CCMSCncLib.App.Runtime.Log.Lev.Secondary) + 'CncLib.App.Runtime.Log.WI("END SaveToFile", , CCncLib.App.Runtime.Log.Lev.Secondary) Else - 'CMSCncLib.App.Runtime.Log.WW("ERR SaveToFile", String.Format("File {0} not found", szFileIni), True) + 'CncLib.App.Runtime.Log.WW("ERR SaveToFile", String.Format("File {0} not found", szFileIni), True) End If End Sub diff --git a/IOB-WIN/CncLib/My Project/AssemblyInfo.vb b/IOB-WIN/CncLib/My Project/AssemblyInfo.vb index 1b7d311..ff9228a 100644 --- a/IOB-WIN/CncLib/My Project/AssemblyInfo.vb +++ b/IOB-WIN/CncLib/My Project/AssemblyInfo.vb @@ -8,28 +8,17 @@ Imports System.Runtime.InteropServices ' Review the values of the assembly attributes - - - - - + + + + + 'The following GUID is for the ID of the typelib if this project is exposed to COM - + -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - + + diff --git a/IOB-WIN/CncLib/My Project/Resources.Designer.vb b/IOB-WIN/CncLib/My Project/Resources.Designer.vb index 78e3bf0..4ebee5f 100644 --- a/IOB-WIN/CncLib/My Project/Resources.Designer.vb +++ b/IOB-WIN/CncLib/My Project/Resources.Designer.vb @@ -39,7 +39,7 @@ Namespace My.Resources Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("CMSCncLib.Resources", GetType(Resources).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("CncLib.Resources", GetType(Resources).Assembly) resourceMan = temp End If Return resourceMan diff --git a/IOB-WIN/CncLib/My Project/Settings.Designer.vb b/IOB-WIN/CncLib/My Project/Settings.Designer.vb index 4a81491..d0ef8ed 100644 --- a/IOB-WIN/CncLib/My Project/Settings.Designer.vb +++ b/IOB-WIN/CncLib/My Project/Settings.Designer.vb @@ -64,9 +64,9 @@ Namespace My Friend Module MySettingsProperty _ - Friend ReadOnly Property Settings() As Global.CMSCncLib.My.MySettings + Friend ReadOnly Property Settings() As Global.CncLib.My.MySettings Get - Return Global.CMSCncLib.My.MySettings.Default + Return Global.CncLib.My.MySettings.Default End Get End Property End Module diff --git a/IOB-WIN/IOB-UT/baseUtils.cs b/IOB-WIN/IOB-UT/baseUtils.cs index 18d612f..28bf300 100644 --- a/IOB-WIN/IOB-UT/baseUtils.cs +++ b/IOB-WIN/IOB-UT/baseUtils.cs @@ -583,32 +583,20 @@ namespace IOB_UT public enum tipoAdapter { - ///// - ///// Adapter DB - ///// - //DB, /// /// Adapter generico/demo /// DEMO, - ///// - ///// Adapter ESAGV (SCM) - ///// - //ESAGV, /// - /// adapter FANUC (CMS) + /// adapter FANUC /// FANUC, /// /// Adapter non specificato /// ND, - ///// - ///// Adapter OSAI - ///// - //OSAI, /// - /// Adapter SIEMENS (CMS) + /// Adapter SIEMENS /// SIEMENS } diff --git a/IOB-WIN/IOB-WIN.sln b/IOB-WIN/IOB-WIN.sln index 45181c1..a44133b 100644 --- a/IOB-WIN/IOB-WIN.sln +++ b/IOB-WIN/IOB-WIN.sln @@ -9,27 +9,69 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersGen", "..\..\..\Visual EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IOB-UT", "IOB-UT\IOB-UT.csproj", "{90512E12-29FC-460D-94CC-648C2A072DBD}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CncLib", "..\..\..\Visual Studio 2017\Projects\Mapo-IOB\IOB-WIN\CncLib\CncLib.vbproj", "{2D769FFD-1122-4276-A115-29246E6D23C5}" +EndProject Global GlobalSection(Performance) = preSolution HasPerformanceSessions = true EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + ESA|Any CPU = ESA|Any CPU + FANUC|Any CPU = FANUC|Any CPU + OSAI|Any CPU = OSAI|Any CPU Release|Any CPU = Release|Any CPU + SIEMENS|Any CPU = SIEMENS|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.ESA|Any CPU.ActiveCfg = Release|Any CPU + {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.ESA|Any CPU.Build.0 = Release|Any CPU + {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.FANUC|Any CPU.ActiveCfg = Release|Any CPU + {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.FANUC|Any CPU.Build.0 = Release|Any CPU + {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.OSAI|Any CPU.ActiveCfg = Release|Any CPU + {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.OSAI|Any CPU.Build.0 = Release|Any CPU {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.Release|Any CPU.ActiveCfg = Release|Any CPU {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.Release|Any CPU.Build.0 = Release|Any CPU + {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU + {ADCB8028-79C4-4896-A9A7-E3C5140FC00B}.SIEMENS|Any CPU.Build.0 = Release|Any CPU {58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58E399F3-9D4E-49D3-AB35-9ED536543D50}.ESA|Any CPU.ActiveCfg = Release|Any CPU + {58E399F3-9D4E-49D3-AB35-9ED536543D50}.ESA|Any CPU.Build.0 = Release|Any CPU + {58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|Any CPU.ActiveCfg = Release|Any CPU + {58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|Any CPU.Build.0 = Release|Any CPU + {58E399F3-9D4E-49D3-AB35-9ED536543D50}.OSAI|Any CPU.ActiveCfg = Release|Any CPU + {58E399F3-9D4E-49D3-AB35-9ED536543D50}.OSAI|Any CPU.Build.0 = Release|Any CPU {58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.ActiveCfg = Release|Any CPU {58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.Build.0 = Release|Any CPU + {58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU + {58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.Build.0 = Release|Any CPU {90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90512E12-29FC-460D-94CC-648C2A072DBD}.ESA|Any CPU.ActiveCfg = Release|Any CPU + {90512E12-29FC-460D-94CC-648C2A072DBD}.ESA|Any CPU.Build.0 = Release|Any CPU + {90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|Any CPU.ActiveCfg = Release|Any CPU + {90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|Any CPU.Build.0 = Release|Any CPU + {90512E12-29FC-460D-94CC-648C2A072DBD}.OSAI|Any CPU.ActiveCfg = Release|Any CPU + {90512E12-29FC-460D-94CC-648C2A072DBD}.OSAI|Any CPU.Build.0 = Release|Any CPU {90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.ActiveCfg = Release|Any CPU {90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.Build.0 = Release|Any CPU + {90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU + {90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.Build.0 = Release|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.ESA|Any CPU.ActiveCfg = ESA|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.ESA|Any CPU.Build.0 = ESA|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.FANUC|Any CPU.ActiveCfg = FANUC|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.FANUC|Any CPU.Build.0 = FANUC|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.OSAI|Any CPU.ActiveCfg = OSAI|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.OSAI|Any CPU.Build.0 = OSAI|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.Release|Any CPU.Build.0 = Release|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.SIEMENS|Any CPU.ActiveCfg = SIEMENS|Any CPU + {2D769FFD-1122-4276-A115-29246E6D23C5}.SIEMENS|Any CPU.Build.0 = SIEMENS|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/IOB-WIN/IOB-WIN/IOB-WIN.csproj b/IOB-WIN/IOB-WIN/IOB-WIN.csproj index a491f14..fa15ae4 100644 --- a/IOB-WIN/IOB-WIN/IOB-WIN.csproj +++ b/IOB-WIN/IOB-WIN/IOB-WIN.csproj @@ -54,6 +54,7 @@ VersGen.cs + @@ -121,6 +122,10 @@ + + {2d769ffd-1122-4276-a115-29246e6d23c5} + CncLib + {90512e12-29fc-460d-94cc-648c2a072dbd} IOB-UT @@ -129,5 +134,8 @@ + + + \ No newline at end of file diff --git a/IOB-WIN/IOB-WIN/IobFanuc.cs b/IOB-WIN/IOB-WIN/IobFanuc.cs index 7e236b9..fa7b117 100644 --- a/IOB-WIN/IOB-WIN/IobFanuc.cs +++ b/IOB-WIN/IOB-WIN/IobFanuc.cs @@ -31,7 +31,7 @@ namespace IOB_WIN prevDirAxis = new int[adpConf.nAxis]; FANUC_ref = (FANUC)Runtime.NC; - if (utils.CRB("verbose")) lg.Info("FANUC_ref da CMSCncLib"); + if (utils.CRB("verbose")) lg.Info("FANUC_ref da CncLib"); // disconnetto e connetto... if (utils.CRB("verbose")) lg.Info("FANUC: tryDisconnect"); diff --git a/IOB-WIN/IOB-WIN/IobSiemens.cs b/IOB-WIN/IOB-WIN/IobSiemens.cs new file mode 100644 index 0000000..2118a49 --- /dev/null +++ b/IOB-WIN/IOB-WIN/IobSiemens.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using IOB_UT; + +namespace IOB_WIN +{ + public class IobSiemens : IobGeneric + { + /// + /// estende l'init della classe base... + /// + /// + /// + public IobSiemens(MainForm caller, IobConfiguration IOBConf) : base(caller, IOBConf) + { + } + } +}