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

AssScaleStr

Gets scale information about the associations of the current Super Genie (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.

Note: This function is being deprecated and is replaced by the AssGetScale function. If the Tag properties are updated AssScaleStr does not get the updated values whereas AssGetScale does.

Syntax

STRING AssScaleStr(STRING Arg, INT Percent, INT EngUnits[,INT CachedMode])

sArg:

When you associate variable tags with Super Genies, the Super Genie substitution strings are replaced by variable tags. The nArg argument allows you to get scale information about a particular variable tag. You need to know which substitution string the tag replaced when the association was performed.

Enter the argument number or name (substitution string number or name) of the relevant substitution string. For example, if you want scale information about the variable that replaced substitution string:

?INT 3?

set nArg to 3.

or

?Level?

set nArg to Level

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"

Percent:

The percentage of full scale of the returned value.

EngUnits:

Determines if the value is returned with engineering units:

0 - Do not return the value with engineering units

1 - Return the value with engineering units

CachedMode:

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

-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 behaviour).

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

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

Related Functions

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

Example

//Using a string identifier for the substitution parameter
AssScaleStr("MILK_LEVEL", 50, 1);
 
// Display the zero, 50% and full scale of the variable that was substituted for
Super Genie arg no. 3DspText(31,0,AssScaleStr(3, 0, 1));DspText(32,0,AssScaleStr(3, 50, 1));DspText(33,0,AssScaleStr(3, 100, 1));			

See Also

Super Genie Functions

Published June 2018