CimDeviceList.New (method)

Creates a new device.
Syntax: Set CimDevice = object.New ( DeviceID, ProcessID )
DeviceID As String - Name of the new device
ProcessID As String - Name of an existing port
Description: CimDeviceList.New returns a new CimDevice object. This is the method to call to create a new device. You must call CimDeviceList.Save to save the device to the project.


Dim project As CimProject
Set project = CreateObject("CimProject")
project.OpenLocalProject "d:\classes\classes.gef"
Dim dl As CimDeviceList
Dim d As cimDevice
Set dl = project.Devices
Set d = dl.New("PLC1", "MASTER_TCPIP1")
d.ResourceID = "$SYSTEM"
d.Model = "GE Fanuc Series 90-70"
d.ProtocolObject.IPAddress = ""
dl.Save d, False