PointMetadata

PointMetadata — queries a point for its metadata structure.

Synopsis

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:

DH_ITEM_READABLE0x0001/* Matches OpcReadable. */
DH_ITEM_WRITABLE0x0002/* Matches OpcWritable. */
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 
DH_ITEM_UNINITIALIZED0x200000/* The item has been created but never assigned a value. */
DH_ITEM_FIRST_VALUE0x400000/* This is the first value that has been assigned to the point. */
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.