API to obtain the type information to a given variable¶
With the API function window.Utils.getTypeDesc(typeid) the type information from a variable with the typeid can be obtained. The result can be one of the following objects.
- class IecTypes()¶
enum {number} with all scalar type classes
- Arguments:
Bool (number) – 0
Bit (number) – 1
Byte (number) – 2
Word (number) – 3
DWord (number) – 4
LWord (number) – 5
SInt (number) – 6
Int (number) – 7
DInt (number) – 8
LInt (number) – 9
USInt (number) – 10
UInt (number) – 11
UDInt (number) – 12
ULInt (number) – 13
Real (number) – 14
LReal (number) – 15
String (number) – 16
WString (number) – 17
Time (number) – 18
Date (number) – 19
DateAndTime (number) – 20
TimeOfDay (number) – 21
- class TypeIds()¶
enum {number} with all specific type ids
- Arguments:
Color (number) – 997
Font (number) – 998
- class ArrayDimension(minRange, maxRange)¶
Provides an object ArrayDimension.
- ArrayDimension.MinRange¶
type: number
The minimum range of the array dimension.
- ArrayDimension.MaxRange¶
type: number
The maximum range of the array dimension.
- class StructComponent(typeId, offset)¶
Provides an object StructComponent which describes one component of a CODESYS Struct.
- StructComponent.TypeId¶
type: number
The type id of that component.
- StructComponent.Offset¶
type: number
The offset of that component.
- class TypeDescArray(size, baseTypeId, dimensions)¶
Provides an object TypeDescArray which corresponds to a CODESYS Array.
- TypeDescArray.Size¶
type: number
The size of the array.
- TypeDescArray.BaseTypeId¶
type: number
The base type id of the array.
- TypeDescArray.Dimensions¶
type: Array.<ArrayDimension>
The array dimensions.
- class TypeDescStruct(size, components)¶
Provides an object TypeDescStruct which corresponds to a CODESYS Struct.
- TypeDescStruct.Size¶
type: number
The size of the struct.
- TypeDescStruct.Components¶
type: Array.<StructComponent>
The components of the struct.
- class TypeDescEnum(baseTypeId, baseTypeSize, enumValues)¶
Provides an object TypeDescEnum which corresponds to a CODESYS Enumeration.
- TypeDescEnum.BaseTypeId¶
type: number
The base type id of the enumeration.
- TypeDescEnum.EnumValues¶
type: Array.<string>
The enumeration values.
- class TypeDescNonStandardString(size, typeId)¶
Provides an object TypeDescNonStandardString which corresponds to a CODESYS STRING or WSTRING. The object is necessary when not STRING(80) or WSTRING(80) is used.
- TypeDescNonStandardString.Size¶
type: number
The size of the string or wstring.
- TypeDescNonStandardString.TypeId¶
type: number
The type id string or wstring.
- class TypeDescSubrange(typeId, lowerBorder, upperBorder)¶
Provides an object TypeDescSubrange which corresponds to a CODESYS Subrange Type.
- TypeDescSubrange.TypeId¶
type: number
The type id of the subrange type.
- TypeDescSubrange.LowerBorder¶
type: number
The lower border of the subrange type.
- TypeDescSubrange.UpperBorder¶
type: number
The upper border of the subrange type.