Namespace: IPS7Lnk.Advanced
Assemblies: IPS7LnkNet.Advanced.dll, IPS7LnkNet.Advanced.dll
The PlcValue<T> type exposes the following members.
Initializes a new instance of the PlcValue´1 class using the specified type
.
C#
protected PlcValue(PlcType type)
Parameters
type
PlcType
The type of value represented.
Exceptions
The type
is a null reference (Nothing in Visual Basic).
Initializes a new instance of the PlcValue´1 class using the specified type
and name
.
C#
protected PlcValue(PlcType type, PlcName name)
Parameters
type
PlcType
The type of value represented.
name
PlcName
The name of the value represented.
Exceptions
The type
or name
is a null reference (Nothing in Visual Basic).
Initializes a new instance of the PlcValue´1 class using the specified type
, name
and value
.
C#
protected PlcValue(PlcType type, PlcName name, T value)
Parameters
type
PlcType
The type of value represented.
name
PlcName
The name of the value represented.
value
T
The initial value of the new PlcValue´1.
Exceptions
The type
or name
is a null reference (Nothing in Visual Basic).
Initializes a new instance of the PlcValue´1 class using the specified type
and value
.
C#
protected PlcValue(PlcType type, T value)
Parameters
type
PlcType
The type of value represented.
value
T
The initial value of the new PlcValue´1.
Exceptions
The type
is a null reference (Nothing in Visual Basic).
Occurs when the value of the Value property has changed.
C#
public event ValueChangedEventHandler<T> Changed
Gets a value indicating whether the instance is in initializing mode.
C#
protected bool IsInitializing { get; }
Property Value
The value true, if the instance is in initializing mode; otherwise the value false.
Remarks
In case there the value is true, the data provided by Value represents the data before the initialization sequence has been entered. This means that any changes to the Value property will only take place after the initilization sequence has been exited.
Also any value validations are performed after the initilization sequence has been exited. This also includes the Changed event.
Gets the status information provided by the software driver related to the value.
C#
public PlcStatus Status { get; }
Property Value
The latest status information provided by the software driver related to the value.
Gets or sets the value assigned to the PLC value.
C#
public virtual T Value { get; set; }
Property Value
The T
value assigned to the PLC value.
Exceptions
The value
is invalid. It either does not fall within an expected value range or its type is not supported by the PlcValue´1.
The value is a null reference (Nothing in Visual Basic).
When implemented in a derived class; signals the PlcValue´1 that initialization is started.
C#
protected virtual void BeginInitCore()
When implemented in a derived class; signals the PlcValue´1 that initialization is completed.
C#
protected virtual void EndInitCore()
Retrieves the value assigned to the PLC value.
C#
protected virtual T GetInstanceValue()
Returns
The value assigned to the PLC value.
Retrieves the current value of the PLC value from the device
specified.
C#
public T GetValue(IPlcDevice device)
Parameters
device
IPlcDevice
The IPlcDevice from that the data is to be retrieved.
Returns
The current value of the PLC value.
Exceptions
The device
is a null reference (Nothing in Visual Basic).
Retrieves the current value of the PLC value from a IPlcDevice using the connection
specified.
C#
public T GetValue(PlcDeviceConnection connection)
Parameters
connection
PlcDeviceConnection
The PlcDeviceConnection from that the data is to be retrieved.
Returns
The current value of the PLC value.
Exceptions
The connection
is a null reference (Nothing in Visual Basic).
The connection
is in Faulted state and cannot longer be opened.
The connection
has been disposed of.
Retrieves the current value of the PLC value from a IPlcDevice using the connection
specified.
C#
protected virtual T GetValueCore(PlcDeviceConnection connection)
Parameters
connection
PlcDeviceConnection
The PlcDeviceConnection from that the data is to be retrieved.
Returns
The current value of the PLC value.
Exceptions
The connection
is a null reference (Nothing in Visual Basic).
The connection
is in Faulted state and cannot longer be opened.
The connection
has been disposed of.
Determines whether a specified value is acceptable for this PlcValue´1.
C#
public virtual bool IsValidType(object value)
Parameters
value
Object
The value to check.
Returns
The value true, if the specified value
is the Type or an acceptable derived type; otherwise the value false.
Determines whether the provided value is accepted for the type of PLC value through basic type checking and also potentially if it is within the allowed range of value for that type.
C#
public virtual bool IsValidValue(object value)
Parameters
value
Object
The value to check.
Returns
The value true, if the specified value
is acceptable and is of the correct type or a derived type; otherwise the value false.
Raises the Changed event.
C#
protected virtual void OnChanged(ValueChangedEventArgs e)
Parameters
The ValueChangedEventArgs that contains the event data.
Raises the Changed event.
C#
protected virtual void OnChanged(ValueChangedEventArgs<T> e)
Parameters
The ValueChangedEventArgs´1 that contains the event data.
Relocates the PlcValue´1 using the specified offset. The original PlcValue´1 remains unmodified.
C#
public IPlcValue Relocate(int operandNumber)
Parameters
operandNumber
Int32
The operand number offset used to adjust the address of the Type.
Returns
A new instance of the PlcValue´1 configured with the same metadata as this instance but relocated using the specified offset.
Exceptions
The offset specified by operandNumber
result into a new value that would be out of the bounds defined by MinOperandNumber or MaxOperandNumber.
It is not possible to relocate relative types.
Relocates the PlcValue´1 using the specified offset. The original PlcValue´1 remains unmodified.
C#
public IPlcValue Relocate(int operandNumber, int byteNumber)
Parameters
operandNumber
Int32
The operand number offset used to adjust the address of the Type.
byteNumber
Int32
The byte number offset used to adjust the address of the Type.
Returns
A new instance of the PlcValue´1 configured with the same metadata as this instance but relocated using the specified offset.
Exceptions
One of the offsets specified by operandNumber
or byteNumber
result into a new value that would be out of the bounds defined by MinOperandNumber, MaxOperandNumber, MinByteNumber and MaxByteNumber.
It is not possible to relocate relative types.
Relocates the PlcValue´1 using the specified offset. The original PlcValue´1 remains unmodified.
C#
public IPlcValue Relocate(int operandNumber, int byteNumber, int bitNumber)
Parameters
operandNumber
Int32
The operand number offset used to adjust the address of the Type.
byteNumber
Int32
The byte number offset used to adjust the address of the Type.
bitNumber
Int32
The bit number offset used to adjust the address of the Type.
Returns
A new instance of the PlcValue´1 configured with the same metadata as this instance but relocated using the specified offset.
Exceptions
One of the offsets specified by operandNumber
, byteNumber
or bitNumber
result into a new value that would be out of the bounds defined by MinOperandNumber, MaxOperandNumber, MinByteNumber, MaxByteNumber, MinBitNumber or MaxBitNumber.
It is not possible to relocate relative types.
Relocates the PlcValue´1 using the specified address
. The original PlcValue´1 remains unmodified.
C#
public IPlcValue Relocate(PlcAddress address)
Parameters
address
PlcAddress
The PlcAddress to that the value is to be relocated.
Returns
A new instance of the PlcValue´1 configured with the same metadata as this instance but relocated using the specified address
.
Exceptions
The address
is a null reference (Nothing in Visual Basic).
The address
does not refer to the same RawType as this PlcType.
It is not possible to relocate absolute object types without relative type information.
Remarks
The RawType of the address
specified needs to be the same as defined by the address of the Type of the PLC value.
When implemented in a derived class, relocates the value to the address
specified.
C#
protected abstract IPlcValue RelocateCore(PlcAddress address)
Parameters
address
PlcAddress
The PlcAddress to that the value is to be relocated.
Returns
A new instance of the same type as this PLC value instance relocated to the address
specified.
Applies the value to the PLC value.
C#
protected virtual void SetInstanceValue(T value)
Parameters
value
T
The new value for the PLC value.
Stores the Value in the device
specified.
C#
public void SetValue(IPlcDevice device)
Parameters
device
IPlcDevice
The IPlcDevice in that the data is to be stored.
Exceptions
The device
is a null reference (Nothing in Visual Basic).
Stores the value
in the device
specified.
C#
public void SetValue(IPlcDevice device, T value)
Parameters
device
IPlcDevice
The IPlcDevice in that the data is to be stored.
value
T
The value to be stored.
Exceptions
The value
is invalid. It either does not fall within an expected value range or its type is not supported by the PlcValue´1.
The device
is a null reference (Nothing in Visual Basic).
Stores the Value in the IPlcDevice assigned to the connection
specified.
C#
public void SetValue(PlcDeviceConnection connection)
Parameters
connection
PlcDeviceConnection
The PlcDeviceConnection to use to store the Value.
Exceptions
The connection
is a null reference (Nothing in Visual Basic).
The connection
is in Faulted state and cannot longer be opened.
The connection
has been disposed of.
Stores the value
in the IPlcDevice assigned to the connection
specified.
C#
public void SetValue(PlcDeviceConnection connection, T value)
Parameters
connection
PlcDeviceConnection
The PlcDeviceConnection to use to store the value
.
value
T
The value to be stored.
Exceptions
The value
is invalid. It either does not fall within an expected value range or its type is not supported by the PlcValue´1.
The connection
is a null reference (Nothing in Visual Basic).
The connection
is in Faulted state and cannot longer be opened.
The connection
has been disposed of.
Stores the value
in the IPlcDevice assigned to the connection
specified.
C#
protected virtual void SetValueCore(PlcDeviceConnection connection, T value)
Parameters
connection
PlcDeviceConnection
The PlcDeviceConnection to use to store the value
.
value
T
The value to be stored.
Exceptions
The value
is invalid. It either does not fall within an expected value range or its type is not supported by the PlcValue´1.
The connection
is a null reference (Nothing in Visual Basic).
The connection
is in Faulted state and cannot longer be opened.
The connection
has been disposed of.
Converts the value to its string representation.
C#
public override string ToString()
Returns
A string that contains the value.
Validates the specified value
whether it can be assigned to this PlcValue´1.
C#
public void ValidateValue(object value)
Parameters
value
Object
The value to validate.
Exceptions
The value
is invalid. It either does not fall within an expected value range or its type is not supported by the PlcValue´1.
Converts a PlcValue´1 to an object of the type T
.
C#
public static explicit operator T(PlcValue<T> value)