Namespace: IPS7Lnk.Advanced
Assemblies: IPS7LnkNet.Advanced.dll, IPS7LnkNet.Advanced.dll
The PlcDevice type exposes the following members.
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
The endPoint
is a null reference (Nothing in Visual Basic).
Gets a collection of PlcBlockInfo objects associated with the device.
C#
public PlcBlockInfoCollection Blocks { get; }
Property Value
An instance of the PlcBlockInfoCollection class.
Gets or sets the PlcDeviceEndPoint of the PLC device.
C#
public PlcDeviceEndPoint EndPoint { get; set; }
Property Value
An instance of the PlcDeviceEndPoint class, which defines the end point information required to establish a connection to the device represented.
Exceptions
The value is a null reference (Nothing in Visual Basic).
Gets a collection of PlcObject objects associated with the device.
C#
public PlcObjectCollection Objects { get; }
Property Value
An instance of the PlcObjectCollection class.
Gets a collection of PlcType objects associated with the device.
C#
public PlcTypeCollection Types { get; }
Property Value
An instance of the PlcTypeCollection class.
Gets a collection of IPlcValue objects associated with the device.
C#
public PlcValueCollection Values { get; }
Property Value
An instance of the PlcValueCollection class.
Creates a new instance of an object implementing the PlcDeviceConnection class which is associated with the device.
C#
public PlcDeviceConnection CreateConnection()
Returns
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.
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
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).
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
An instance of an object which is an instance of the PlcDeviceConnection class and is associated with the PlcDevice.
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
An instance of the PlcBlockInfo class containing the information of the block requested.
Exceptions
The operand
is a null reference (Nothing in Visual Basic).
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
An instance of the PlcBlockInfo class containing the information of the block requested.
Retrieves all so far known block information which has been determined by either discovering a block using GetBlock(PlcOperand).
C#
public PlcBlockInfo[] GetBlocks()
Returns
An array of PlcBlockInfo objects.
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
An instance implementing the IPlcDeviceInfo interface which provides additional metadata about the device.