Table of Contents

Class AtomicType

Namespace
L5Sharp.Types
Assembly
L5Sharp.dll

A LogixType that represents value type object.

public abstract class AtomicType : LogixType, ILogixSerializable
Inheritance
AtomicType
Implements
Derived
Inherited Members

Remarks

Logix atomic types are types that have value (e.g., BOOL, SINT, INT, DINT, REAL, etc.). These type are synonymous with value types in .NET and in fact wrap the .NET value types internally while adding the common LogixType API. Atomic types also add Radix to indicate the format of the current type value.

All derived atomic types will implement value equality and comparison semantics to allow common operations to be performed. They will also implement the IConvertible interface explicitly so to allow conversion between types.

Properties

Class

The class (atomic, predefined, user-defined) that the type belongs to.

public override sealed DataTypeClass Class { get; }

Property Value

DataTypeClass

A DataTypeClass option representing the class type.

Family

The family (string or none) of the type.

public override sealed DataTypeFamily Family { get; }

Property Value

DataTypeFamily

A DataTypeFamily option representing the family value.

Members

The collection of LogixMember objects that make up the structure of the type.

public override IEnumerable<LogixMember> Members { get; }

Property Value

IEnumerable<LogixMember>

A IEnumerable<T> containing LogixMember objects.

Remarks

All logix types, with the exception of a BOOL and REAL/LREAL, have what can be considered members. Every derived type must implement this property for which it returns a collection of members, forming the type/member hierarchy of the logix type.

Radix

The radix format for the AtomicType.

public abstract Radix Radix { get; }

Property Value

Radix

A Radix representing the format of the atomic type value.

Methods

GetBytes()

Returns the AtomicType value as an array of byte values.

public abstract byte[] GetBytes()

Returns

byte[]

An array of byte representing the value of the type.

OnMemberDataChanged(object, EventArgs)

Trigger the DataChanged event when a atomic member data changed event is fired to forward the call up the type/member hierarchy.

protected virtual void OnMemberDataChanged(object sender, EventArgs e)

Parameters

sender object

The member sending the data changed event.

e EventArgs

The event args.

Serialize()

Serialized the atomic type as the DataValue XElement.

public override XElement Serialize()

Returns

XElement

A XElement containing the data for the atomic type.

ToString()

Return the atomic value formatted using the current Radix format.

public override string ToString()

Returns

string

A string representing the formatted atomic value.

ToString(Radix)

Returns the atomic value formatted in the specified Radix format.

public string ToString(Radix radix)

Parameters

radix Radix

The radix format.

Returns

string

A string representing the formatted atomic value.