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(ipFanucTgt As String)


            '************ Istanzio l'oggetto NC *****************
            Try
                '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 = ipFanucTgt


                portIpFanuc = "8193"
                CncScreenHssb = "0"
                NC = New FANUC(0, ipFanuc, portIpFanuc, CncScreenHssb)

                '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