PointMetadata

PointMetadata — queries a point for its metadata structure.

Syntax

PointMetadata (point)
    

Arguments

point

The fully-qualified symbolic point name of a DataHub point.

Returns

Either a DH_Item structure, or nil.

Description

This function queries a point for its metadata structure, which is a DH_Item containing the following fields:

item.canonical_type

A number representing the canonical type of the point. See the possible values of VARTYPE in Windows:

VT_EMPTY= 0
VT_I2= 2
VT_I4= 3
VT_R4= 4
VT_R8= 5
VT_CY= 6
VT_DATE= 7
VT_BSTR= 8
VT_BOOL= 11
VT_I1= 16
VT_UI1= 17
VT_UI2= 18
VT_UI4= 19
VT_I8= 20
VT_UI8= 21
VT_INT= 22
VT_UINT= 23
item.conf

A number from 0 to 100 indicating a confidence factor.

item.flags

Any bitwise combination of the following numeric set of flags:

DH_ITEM_READABLE0x0001
DH_ITEM_WRITABLE0x0002
DH_ITEM_LOCKED0x0004
DH_ITEM_PROPERTY0x0008
DH_ITEM_SUBASSEMBLY0x0010
DH_ITEM_ASSEMBLY0x0020
DH_ITEM_ATTRIBUTE0x0040
DH_ITEM_TYPE0x0080
DH_ITEM_ACTIVE0x0100
DH_ITEM_PRIVATE_ATTRIBUTE0x0200
DH_ITEM_PROCESSED0x0400
DH_ITEM_HIDDEN0x0800
DH_ITEM_AUTO_ID0x1000
item.opcaccessrights

Any bitwise combination of 1 for READABLE and 2 for WRITABLE. The same as the first two bits of item.flags.

item.quality

The OPC quality value. You can get the name associated with the value by using the GetQualityName function in the Quality.g file. Put the statement:

require ("Quality");

at the beginning of your script to gain access to this function.

item.scan_max

Maximum scan rate on this point. Not in use.

item.security

The security level on this point.

item.timeoffset

Offset in seconds from local clock time for the originator of this point value. Not in use.

item.timestamp

The Windows time stamp of this point.

[Note]

The point metadata is likely to change in the future, though the actual fields available will remain the same. It would be good practice to wrap access to the metadata within wrapper functions.