PlcDateTime Members

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

PlcDateTime(PlcDateTimeType)

Initializes a new instance of the PlcDateTime class using the specified type

C#

public PlcDateTime(PlcDateTimeType type)


Parameters

type PlcDateTimeType

The PlcDateTimeType of the new PlcDateTime to which the PLC value belongs.


Exceptions

ArgumentNullException

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

PlcDateTime(PlcDateTimeType, DateTime)

Initializes a new instance of the PlcDateTime class using the specified type and value.

C#

public PlcDateTime(PlcDateTimeType type, DateTime value)


Parameters

type PlcDateTimeType

The PlcDateTimeType of the new PlcDateTime to which the PLC value belongs.

value DateTime

The initial value of the new PlcDateTime.


Exceptions

ArgumentNullException

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

ArgumentOutOfRangeException

The value is out of the bounds defined by MinValue and MaxValue.

PlcDateTime(PlcDateTimeType, PlcName)

Initializes a new instance of the PlcDateTime class using the specified type and name.

C#

public PlcDateTime(PlcDateTimeType type, PlcName name)


Parameters

type PlcDateTimeType

The PlcDateTimeType of the new PlcDateTime to which the PLC value belongs.

name PlcName

The name of the value.


Exceptions

ArgumentNullException

The type or name is a null reference (Nothing in Visual Basic).

PlcDateTime(PlcDateTimeType, PlcName, DateTime)

Initializes a new instance of the PlcDateTime class using the specified type, name and value.

C#

public PlcDateTime(PlcDateTimeType type, PlcName name, DateTime value)


Parameters

type PlcDateTimeType

The PlcDateTimeType of the new PlcDateTime to which the PLC value belongs.

name PlcName

The name of the value.

value DateTime

The initial value of the new PlcDateTime.


Exceptions

ArgumentNullException

The type or name is a null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The value is out of the bounds defined by MinValue and MaxValue.

PlcDateTime(PlcIdentity)

Initializes a new instance of the PlcDateTime class using the specified identity

C#

public PlcDateTime(PlcIdentity identity)


Parameters

identity PlcIdentity

The PlcIdentity of the new PlcDateTime to which the PLC value belongs.


Exceptions

ArgumentException

The identity does not refer to the Byte.

ArgumentNullException

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

PlcDateTime(PlcIdentity, DateTime)

Initializes a new instance of the PlcDateTime class using the specified identity and value.

C#

public PlcDateTime(PlcIdentity identity, DateTime value)


Parameters

identity PlcIdentity

The PlcIdentity of the new PlcDateTime to which the PLC value belongs.

value DateTime

The initial value of the new PlcDateTime.


Exceptions

ArgumentException

The identity does not refer to the Byte.

ArgumentNullException

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

ArgumentOutOfRangeException

The value is out of the bounds defined by MinValue and MaxValue.

PlcDateTime(PlcIdentity, PlcName)

Initializes a new instance of the PlcDateTime class using the specified identity and name.

C#

public PlcDateTime(PlcIdentity identity, PlcName name)


Parameters

identity PlcIdentity

The PlcIdentity of the new PlcDateTime to which the PLC value belongs.

name PlcName

The name of the value.


Exceptions

ArgumentException

The identity does not refer to the Byte.

ArgumentNullException

The identity or name is a null reference (Nothing in Visual Basic).

PlcDateTime(PlcIdentity, PlcName, DateTime)

Initializes a new instance of the PlcDateTime class using the specified identity, name and value.

C#

public PlcDateTime(PlcIdentity identity, PlcName name, DateTime value)


Parameters

identity PlcIdentity

The PlcIdentity of the new PlcDateTime to which the PLC value belongs.

name PlcName

The name of the value.

value DateTime

The initial value of the new PlcDateTime.


Exceptions

ArgumentException

The identity does not refer to the Byte.

ArgumentNullException

The identity or name is a null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The value is out of the bounds defined by MinValue and MaxValue.

MaxValue

Represents the largest possible value of a PlcDateTime.

C#

public static readonly DateTime MaxValue


Field Value
DateTime


Remarks

The according PLC value would be: DT#2089-12-31-23:59:59.999.

MinValue

Represents the smallest possible value of a PlcDateTime.

C#

public static readonly DateTime MinValue


Field Value
DateTime


Remarks

The according PLC value would be: DT#1990-1-1-0:0:0.0.

Value

Gets or sets the value assigned to the PLC value.

C#

public override DateTime Value { get; set; }


Property Value

DateTime

The DateTime value assigned to the PLC value.



Exceptions

ArgumentNullException

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

ArgumentOutOfRangeException

The value is out of the bounds defined by MinValue and MaxValue.

GetBytes(DateTime)

Returns the specified DateTime value as an array of BCD Byte values.

C#

public static byte[] GetBytes(DateTime value)


Parameters

value DateTime

A DateTime value.


Returns

Byte[]

The array of BCD Byte values.

GetDateTime(Byte[])

Returns the specified BCD values (bcdValues) as a DateTime.

C#

public static DateTime GetDateTime(byte[] bcdValues)


Parameters

bcdValues Byte[]

The Byte array containing at least eight elements.


Returns

DateTime

The DateTime value.



Exceptions

ArgumentOutOfRangeException

The bcdValues array have to contain at least eight elements.

GetValueCore(PlcDeviceConnection)

Retrieves the current value of the PLC value from a IPlcDevice using the connection specified.

C#

protected override DateTime GetValueCore(PlcDeviceConnection connection)


Parameters

connection PlcDeviceConnection

The PlcDeviceConnection from that the data is to be retrieved.


Returns

DateTime

The current value of the PLC value.



Exceptions

InvalidOperationException

The connection is in Faulted state and cannot longer be opened.

ObjectDisposedException

The connection has been disposed of.

IsValidValue(Object)

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 override bool IsValidValue(object value)


Parameters

value Object

The value to check.


Returns

Boolean

The value true, if the specified value is acceptable and is of the correct type or a derived type; otherwise the value false.

RelocateCore(PlcAddress)

Relocates the value to the address specified.

C#

protected override IPlcValue RelocateCore(PlcAddress address)


Parameters

address PlcAddress

The PlcAddress to that the value is to be relocated.


Returns

IPlcValue

A new instance of the same type as this PLC value instance relocated to the address specified.

SetValueCore(PlcDeviceConnection, DateTime)

Stores the value in the IPlcDevice assigned to the connection specified.

C#

protected override void SetValueCore(PlcDeviceConnection connection, DateTime value)


Parameters

connection PlcDeviceConnection

The PlcDeviceConnection to use to store the value.

value DateTime

The value to be stored.



Exceptions

InvalidOperationException

The connection is in Faulted state and cannot longer be opened.

ObjectDisposedException

The connection has been disposed of.