Gets the given property of the given tag.
Syntax
ctTagGetProperty(hCTAPI, szTagName, szProperty, pData, dwBufferLength, dwType)
hCTAPI
Type: Handle
Input/output: Input
Description: The handle to the CTAPI as returned from ctOpen().
szTagName
Type: LPCSTR
Input/output: Input
Description: The name of the tag. To specify cluster add "ClusterName." in front of the tag. For example Cluster1.Tag1 (note the period at the end of the cluster name).
Variable tags can be specified as a string in multiple forms. Refer to Tag Names for more information.
szProperty
Type: LPCSTR
Input/output: Input
Description: The property to read. Property names are case sensitive. Supported properties are:
ArraySize: Array size of the associated tag. Returns 1 for non-array types.
DataBitWidth: Number of bits used to store the value.
Description: Tag description.
EngUnitsHigh: Maximum scaled value.
EngUnitsLow: Minimum scaled value.
Format: Format bit string. The format information is stored in the integer as follows:
FormatDecPlaces: Number of decimal places for default format.
FormatWidth: Number of characters used in default format.
RangeHigh: Maximum unscaled value.
RangeLow: Minimum unscaled value.
Type: Type of tag as a number:
Units: Engineering Units for example %, mm, Volts.
pData
Type: VOID*
Input/output: Output
Description: The output data buffer for the property value retrieved.
dwBufferLength
Type: DWORD
Input/output: Input
Description: The length of the output data buffer in bytes.
dwType
Type: DWORD
Input/output: Input
Description: The type of data to return.
Value |
Meaning |
---|---|
DBTYPE_U11 |
UCHAR |
DBTYPE_I1 |
1 byte INT |
DBTYPE_I2 |
2 byte INT |
DBTYPE_I4 |
4 byte INT |
DBTYPE_R4 |
4 byte REAL |
DBTYPE_R8 |
8 byte REAL |
DBTYPE_BOOL |
BOOLEAN |
DBTYPE_BYTES |
Byte Stream |
DBTYPE_STR |
NULL terminated STRING |
Return Value
If the function succeeds, the return value is non-zero. If the function does not succeed, the return value is zero. To get extended error information, call GetLastError().
Published June 2018