Imports NGP_COMM_DLL Public Class MachineManager ' ' ' !!!! TO DO : use a list of n machines, not just 2 !!!! ' Private m_Machine1 As NC.NC_generic Public ReadOnly Property Machine1 As NC.NC_generic Get Return m_Machine1 End Get End Property Private m_Machine2 As NC.NC_generic Public ReadOnly Property Machine2 As NC.NC_generic Get Return m_Machine2 End Get End Property Sub New() End Sub Sub Init() If GetMainPrivateProfileInt(S_NC, K_NC_SIMULATE, 0) = 1 Then m_Machine1 = New NC.Simulated m_Machine1.Connect("") m_Machine2 = New NC.Simulated m_Machine2.Connect("") Else m_Machine1 = New NC.OsaiOpen m_Machine2 = New NC.OsaiOpen Dim sM1IpAddress As String = "" Dim sM2IpAddress As String = "" GetMainPrivateProfileString(S_NC, K_IP_ADDRESS & 1.ToString(), "", sM1IpAddress) GetMainPrivateProfileString(S_NC, K_IP_ADDRESS & 2.ToString(), "", sM2IpAddress) m_Machine1.Connect(sM1IpAddress) m_Machine2.Connect(sM2IpAddress) End If End Sub Sub Close() m_Machine1.Disconnect() m_Machine2.Disconnect() End Sub End Class