GetTagTypes
(VTScada-Layer function. Must be called with a leading backslash.)
Description: | Returns an array of either the common names or the module names of all tag types. May optionally include the list of tag groups. |
Returns: | Array |
Usage: | Script Only. |
Function Groups: | Basic Module |
Related to: | PointList | GetTagList |
Format: | \GetTagTypes([GetGroups, GetModuleNames]) |
Parameters: |
GetGroups |
Optional Boolean. If set TRUE, the list of tag groups will be retrieved and returned at the end of the list of types. Defaults to TRUE. |
GetModuleNames |
Optional Boolean. If set TRUE, this function will return module names rather than the display name for each type. If set, Groups will be invalid. Defaults to FALSE. |
Comments: | This function is used to populate a selection list of types. |
Examples:
Create a dictionary of tag types and how many running instances there are of each type
GetTagCounts [ If 1; [ TagTypes = GetTagTypes(FALSE, TRUE); Counts = Dictionary(); I = 0; WhileLoop(I < ArraySize(TagTypes), Counts[TagTypes[I]] = NumInstances( LocalScope(Code, TagTypes[I])); I++; ); Return(Counts); ] ]