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

Ass

Associates a variable tag or equipment with a Super Genie. This association is only made for the next Super Genie you display (either in the current window or in a new window). You cannot create an association for a Super Genie that is already displayed. You need to call this function once for every Super Genie substitution string in the Super Genie, otherwise the variable (substitution string) will remain uninitialized and it will be displayed as #ASC.

Note: If you need to replace an association for a Super Genie that is already displayed, you can use the function AssWinReplace.

This function provides the lowest level of support for associating Super Genie variables with physical tags. The higher level functions (listed below) are simpler to use.

Syntax

Ass(hWin, nArg, sTag, nMode [, sClusterName] )

hWin:

The association will be created for the next Super Genie to display in the window specified here; enter the window number or:

nArg:

The argument number or name (substitution string number or name) of the Super Genie string to be replaced by sTag. For example, to replace ?INT 3? with sTag, set nArg to 3 ,or ?Level? set nArg to Level.

sTag:

Variable tag, or equipment and item name reference of a variable tag (using equipment.item notation) that will replace the Super Genie association. Partial tag names or equipment.item tag references can also be used.

The name of the tag can be prefixed by the name of the cluster for example, "ClusterName.Tag" or "ClusterName.Equipment.Item".

Note: If the tag name exceeds the length limit of 254 characters the hardware alarm "Tag name exceed length limit" will be raised.

nMode:

The mode of the association. Set to 0.

sClusterName:

Specifies the name of the cluster in which the Variable Tag resides. This is optional if you have one cluster or are resolving the tag via the page's current cluster context. The argument is enclosed in quotation marks "".

Resolution of the tag's cluster context occurs when the page is displayed. It is resolved to the page's cluster context, not the context in force when this function is called.

Return Value

0 (zero) if successful, otherwise an error code is returned.When using partial associations, an error 274 or 289 may be returned even though the association is successful, and can be ignored.

Related Functions

AssChain, AssMetadata, AssMetadataPage, AssMetadataPopup, AssMetadataWin, AssChainPage, AssChainPopUp, AssChainWin, AssChainWinFree, AssGetProperty, AssGetScale, AssInfo, AssInfoEx, AssPage, AssPopUp, AssScaleStr, AssTag, AssTitle, AssVarTags, AssWin

Example

//Using a string identifier for the substitution parameter
        Ass(-2,"Level", "MIlK_LEVEL",0);             
         
// Associate variable tag PV123 with the next Genie to display in the current window
Ass(-3, 5, "PV123", 0);

See Also

Super Genie Functions

Published June 2018