Cicode Programming Reference > Cicode Function Categories > Super Genie Functions > AssGetProperty

AssGetProperty

This function gets association information about the current Super Genie from the data source (that is, information about a variable tag that has been substituted into the Super Genie). You can only call this function on a Super Genie after the associations are completed.

Use this function to display association information as part of the Super Genie. For example, if you have a Super Genie that is a loop controller, you could display the name of the loop at the top of the loop controller box. Each time the Super Genie is used with different associations (specifically a different tag name association) the correct loop name will be displayed.

If a constant value is associated, then only the constant value can be retrieved through the TagName property. The remaining properties are not valid.

This function replaces AssInfo.

Syntax

AssGetProperty(sArg, sProperty [, iCachedMode] )

sArg:

The argument number or name (integer or string) of the association from which to get information.

When you associate a partial variable tag name (or partial equipment.item to reference variable tag) a prefix or suffix needs be added to the association to form a valid tag reference. The Argument sArg needs to be parsed as a string when partial tag names are used for the association, such as "[a]?1?[b]".

For example, where the substitution is a valid equipment reference and ?INT 1?.HourRun is a valid 'equipment.item' reference to a tag, set sArg to:

"?INT 1?.HourRun"

sProperty:

The property to read. Property names are case sensitive. Supported properties are:

Address - The configured address of the referenced tag (as specified in the Variable Tags properties).

ArraySize - Array size of the referenced tag. Returns 1 for non-array types.

AssFullName - Full name of the referenced tag in the form cluster.tagname even if the tag is not resolved.

ClusterName - Name of the cluster the referenced tag resides on.

DataBitWidth - Number of bits used to store the value.

Description - Description of the referenced tag.

EngUnitsHigh - Maximum scaled value.

EngUnitsLow - Minimum scaled value.

Equipment - Name of the equipment.

Format - Format bit string. The format information is stored in the integer as follows:

ErrorValUsed - Returns 1 if the defined error value was used for the SuperGenie association. This means that tag name is invalid/unresolved or the substitutions are not complete. This is only relevant for named Super Genies. Returns zero (0) if the association string provided a value, or a default value was not defined.

FormatDecPlaces - Number of decimal places for default format.

FormatWidth - Number of characters used in default format.

FullName - Full name of the referenced tag in the form cluster.tagname If the referenced tag is not resolved, returns an empty string.

Item - Name of the equipment item associated with the Tag. If the tag is not resolved, returns an empty string.

Literal - Returns 1 if the substitution is a literal value, returns 0 if the substitution is a tag name.

RangeHigh - Maximum unscaled value.

RangeLow - Minimum unscaled value.

TagName - Name of the tag for the specified association. Will retrieve the tag name regardless if you used equipment.item to reference the tag.

Type - General type of associated tag. Allowed values are:

Units - Engineering Units for example, %, mm, Volts.

Custom1 ... Custom8 - User-defined strings.

iCachedMode:

Optional parameter that specifies from where to retrieve the value for the property.

Note: When retrieving bit width ("DataBitWidth" property) or array size ("ArraySize" property) from the local configuration (iCachedMode 2), the value is related to the data structure in the device. For example, MODNET, is a 16 bit device and does not have native LONG and REAL numbers. So when you have a LONG variable, an array of 2 INTEGERS are needed to store it. In the example, the property "DataBitWidth" against the variable will return 16 and property "ArraySize" will return 2. The combination of these two return values will add up to the correct bits.

-1 - The mode is determined by the INI parameter [Client]TagReadCachedMode.

0 - The property value is retrieved direct from the server in blocking mode and an error code is returned if it is not on the server (or the server is unavailable).

1 - The property value is retrieved from the cache and an error code is returned if the cache is not loaded yet.

2 - The property value is retrieved from the local configuration and an error code is returned if it is not available (this is the traditional behavior).

3 - The property value is retrieved from the cache, if the cache is loaded, and from the local configuration, if the cache is not loaded yet.

Default value is -1.

Return Value

String representation of the property of the referenced tag. On detection of an error, an empty string and an error are set.

Related Functions

Ass, AssChain, AssMetadata, AssMetadataPage, AssMetadataPopup, AssMetadataWin, AssChainPage, AssChainPopUp, AssChainWin, AssChainWinFree, AssGetScale, AssInfo, AssInfoEx, AssPage, AssPopUp, AssScaleStr, AssTag, AssTitle, AssVarTags, AssWin, TagGetProperty, TagGetScale, TagScaleStr, TagInfo

Example

//Using a string identifier for the substitution parameter

AssGetProperty("MILK_LEVEL", "TagName", 0);

// Get the engineering full scale value for the 2nd
// argument of the association of the current Super Genie
EngFullScale = AssGetProperty(2, "EngUnitsHigh", 0);
// Get the cached engineering units for the 3rd argument
// of the association of the current Super Genie
MeasureUnits = AssGetProperty(3, "Units", 1);

See Also

Super Genie Functions

Published June 2018