Files
CMS-MTConn/MTC_Adapter/CMSCncLib/CNC/CNC.Runtime.vb
T

72 lines
2.5 KiB
VB.net

Imports CMSCncLib.App.Runtime
Imports CMSCncLib.CNC
Imports CMSCncLib.Tools
Namespace CNC
Public Class Runtime
Public Shared NC As CMSCncLib.CNC.CNC
Public Shared Sub CreateNC(tipoNC As CNC.NcType, ipTarget As String)
'************ Istanzio l'oggetto NC *****************
Try
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)
Dim ipFanuc As String
Dim portIpFanuc As String
Dim CncScreenHssb As String
' SIMULATORE
' IP LOOPBACK: 192.168.211.5/255.255.255.0
'ipFanuc = "192.168.211.5"
' PRODUZIONE
' IP ETH: 192.168.139.201/255.255.255.0
'ipFanuc = "192.168.139.1"
' imposto IP da chiamata
ipFanuc = ipTarget
portIpFanuc = "8193"
CncScreenHssb = "0"
NC = New FANUC(0, ipFanuc, portIpFanuc, CncScreenHssb)
Case NC_OSAI
'If Config.Settings.Settings.OsaiCommType = 1 Then 'SOAP
NC = New OSAI_OPEN(ipTarget)
'Else 'DCOM
' Dim DotNet As Boolean
' If OSAI.GetWinnbi(DotNet) Then
' NC = New OSAI(Config.Settings.Settings.NcName)
' Else
' Log.WE("Error on GetWinnbi or WINNBI are not installed", "Install Osai WINNBI before run this software", True)
' End If
'End If
Case NC_SIEMENS
' Try
' NC = New SIEMENS
' Catch ex As CmsNcException
' 'NC.frmMain_ref.ExitApp()
' 'frmMain.ExitApp()
' End
' End Try
End Select
'CMSCncLib.App.Runtime.Log.WI("OK crating NC CNC.NC", , CLog.Lev.Principal)
Catch ex As Exception
'CMSCncLib.App.Runtime.Log.WE("ERR crating NC CNC.NC", ex.Message, True)
End Try
End Sub
End Class
End Namespace