set_canonical

set_canonical — sets the type of a point.

Syntax

(set_canonical pointname canonical_type [force])
    

Arguments

pointname

The full name of the point, with domain.

canonical_type

Either a number with a legal numeric VT_TYPE value, or one of: I1, I2, I4, UI1, UI2, UI4, CY, DATE, BOOL, BSTR, R4, R8, EMPTY, I1 ARRAY, I2 ARRAY, I4 ARRAY, UI1 ARRAY, UI2 ARRAY, UI4 ARRAY, CY ARRAY, DATE ARRAY, BOOL ARRAY, BSTR ARRAY, R4 ARRAY, R8 ARRAY.

force

A value of 1 forces a change in canonical type. A value of 0, or the omission of this optional parameter, will allow the canonical type to change only if it is currently EMPTY.

Returns

A message indicating success or error. Please refer to Return Syntax for details.

Description

This command sets the canonical type of a point. Normally a point's canonical type is EMPTY, meaning that it will maintain the data type of whatever data is written to it. If the canonical type is other than EMPTY, then any data written to the point will be converted to that type before it is stored.

[Note]

When a point has a non-empty canonical type it is possible that the conversion could fail, in which case the point value is not changed.