PlcDevice Members

Namespace: IPS7Lnk.Advanced
Assemblies: IPS7LnkNet.Advanced.dll, IPS7LnkNet.Advanced.dll
The PlcDevice type exposes the following members.

PlcDevice()

Initializes a new instance of the PlcDevice class.

C#

protected PlcDevice()

PlcDevice(PlcDeviceEndPoint)

Initializes a new instance of the PlcDevice class using the specified endPoint.

C#

protected PlcDevice(PlcDeviceEndPoint endPoint)


Parameters

endPoint PlcDeviceEndPoint

The PlcDeviceEndPoint which identifies the network address of the device.


Exceptions

ArgumentNullException

The endPoint is a null reference (Nothing in Visual Basic).

Blocks

Gets a collection of PlcBlockInfo objects associated with the device.

C#

public PlcBlockInfoCollection Blocks { get; }


Property Value

PlcBlockInfoCollection

An instance of the PlcBlockInfoCollection class.

EndPoint

Gets or sets the PlcDeviceEndPoint of the PLC device.

C#

public PlcDeviceEndPoint EndPoint { get; set; }


Property Value

PlcDeviceEndPoint

An instance of the PlcDeviceEndPoint class, which defines the end point information required to establish a connection to the device represented.



Exceptions

ArgumentNullException

The value is a null reference (Nothing in Visual Basic).

Name

Gets or sets the name of the device.

C#

public string Name { get; set; }


Property Value

String

A String value identifying the device.

Objects

Gets a collection of PlcObject objects associated with the device.

C#

public PlcObjectCollection Objects { get; }


Property Value

PlcObjectCollection

An instance of the PlcObjectCollection class.

Types

Gets a collection of PlcType objects associated with the device.

C#

public PlcTypeCollection Types { get; }


Property Value

PlcTypeCollection

An instance of the PlcTypeCollection class.

Values

Gets a collection of IPlcValue objects associated with the device.

C#

public PlcValueCollection Values { get; }


Property Value

PlcValueCollection

An instance of the PlcValueCollection class.

CreateConnection()

Creates a new instance of an object implementing the PlcDeviceConnection class which is associated with the device.

C#

public PlcDeviceConnection CreateConnection()


Returns

PlcDeviceConnection

An instance of the PlcDeviceConnection class which is associated with the device.


Remarks

Any changes made on EndPoint and any changes made on the configuration of the returned PlcDeviceConnection will take affect when calling Open. Any further changes made on the EndPoint or on the PlcDeviceConnection instance will when only take affect after closing (using Close) and re-opening (using Open) the connection.

In multi-threaded environments it is important to take care about which thread does open/close a connection and which threads do use the same connection concurrent. Scenarios there multiple threads do share the same connection instance have to ensure that changes to the PlcDevice (e.g. EndPoint changes) to that a PlcDeviceConnection does belong or any changes made on the connection itself will take affect in all threads (which share the same connection instance) immediately after closing and re-opening the connection.

CreateConnection(Boolean)

Creates a new instance of an object implementing the PlcDeviceConnection class which is associated with the device, if createNew is equals to the value true.

C#

public PlcDeviceConnection CreateConnection(bool createNew)


Parameters

createNew Boolean

A value indicating whether a new instance is to be created (the value true) or if there is already an existing instance of the PlcDeviceConnection class in usable state is to be returned (the value false).


Returns

PlcDeviceConnection

An instance of the PlcDeviceConnection class which is associated with the device.


Remarks

Any changes made on EndPoint and any changes made on the configuration of the returned PlcDeviceConnection will take affect when calling Open. Any further changes made on the EndPoint or on the PlcDeviceConnection instance will when only take affect after closing (using Close) and re-opening (using Open) the connection.

In multi-threaded environments it is important to take care about which thread does open/close a connection and which threads do use the same connection concurrent. Scenarios there multiple threads do share the same connection instance have to ensure that changes to the PlcDevice (e.g. EndPoint changes) to that a PlcDeviceConnection does belong or any changes made on the connection itself will take affect in all threads (which share the same connection instance) immediately after closing and re-opening the connection.

If there was a connection created for the first time using this PlcDevice instance these connection will be always returned by any subsequent calls to CreateConnection(Boolean) using createNew with the value false. This is the case until the cached connection will be discarded. A cached connection will be discarded then it is not in created nor in closed state and any changes are made to the configuration of this PlcDevice (e.g. EndPoint).

CreateConnectionCore()

When implemented in a derived class, creates a new instance of an object which is an instance of the PlcDeviceConnection class which is associated with the PlcDevice.

C#

protected abstract PlcDeviceConnection CreateConnectionCore()


Returns

PlcDeviceConnection

An instance of an object which is an instance of the PlcDeviceConnection class and is associated with the PlcDevice.

GetBlock(PlcOperand)

Retrieves the block information for the PLC block accessible by the operand specified.

C#

public PlcBlockInfo GetBlock(PlcOperand operand)


Parameters

operand PlcOperand

The PlcOperand for that the according block information is to be retrieved.


Returns

PlcBlockInfo

An instance of the PlcBlockInfo class containing the information of the block requested.



Exceptions

ArgumentNullException

The operand is a null reference (Nothing in Visual Basic).

GetBlockCore(PlcOperand)

When implemented in a derived class, retrieves the block information for the PLC block accessible by the operand specified.

C#

protected abstract PlcBlockInfo GetBlockCore(PlcOperand operand)


Parameters

operand PlcOperand

The PlcOperand for that the according block information is to be retrieved.


Returns

PlcBlockInfo

An instance of the PlcBlockInfo class containing the information of the block requested.

GetBlocks()

Retrieves all so far known block information which has been determined by either discovering a block using GetBlock(PlcOperand).

C#

public PlcBlockInfo[] GetBlocks()


Returns

PlcBlockInfo[]

An array of PlcBlockInfo objects.

GetInfo()

When implemented in a derived class, retrieves an instance of an object implementing the IPlcDeviceInfo interface which provides additional metadata about the device.

C#

public abstract IPlcDeviceInfo GetInfo()


Returns

IPlcDeviceInfo

An instance implementing the IPlcDeviceInfo interface which provides additional metadata about the device.

ToString()

Returns a string that represents the current PlcDevice.

C#

public override string ToString()


Returns

String

A string that represents the current PlcDevice.