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

AssGetScale

Gets scale information about the associations of 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(iArg, iPercent, iEngUnits [, iCached] )

iArg:

The argument number or name of the association from which to get information.

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 association (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