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

AssGetScale

Gets scale information about the tag references for the current Super Genie from the datasource (that is scale 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 scale information as part of the Super Genie. For example, if you have a bar graph illustrating output, you could indicate zero, 50%, and full scale output on the vertical axis of the graph. Each time the Super Genie is used with different associations the correct scale values will be displayed.

The value is returned as a formatted string using the association format specification and (optionally) the engineering units.

This function replaces AssScaleStr.

Syntax

AssGetScale(sArg, iPercent, iEngUnits [, iCached] )

sArg:

The argument number or name 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 ie "[a]?1?[b]".

eg 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"

iPercent:

The percentage of full scale of the returned value.

iEngUnits:

Flag to determine if the value is returned with engineering units:

0 - Return the value without engineering units

1 - Return the value with engineering units

iCached:

Optional flag to attempt to retrieve the cached value for the property rather than the current value. This makes the function non-blocking. If the property has not yet been cached, an error is set.

0 - Do not force cached read. Cicode is blocking

1 - Force cached read. Cicode is non-blocking

Default value is 1 (true).

Return Value

The scale of the referenced tag (as a string).

Related Functions

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

Example

//Using a string identifier for the substitution parameter
AssGetScale("MILK_LEVEL", 50, 1, 0);

 

// Display the zero, 50% and full scale of the 2nd argument 
// of the association of the current Super Genie
DspText(31,0,AssGetScale(2, 0, 1));
DspText(32,0,AssGetScale(2, 50, 1));
DspText(33,0,AssGetScale(2, 100, 1));

See Also

Super Genie Functions

Published June 2018