Method: GetChannelGroups for Data
- Updated2024-09-12
- 2 minute(s) read
Internal Data > Methods > Method: GetChannelGroups for Data
Method: GetChannelGroups for Data
Returns a collection of channel groups in the script interface for internal data.
Set oElementList = Object.GetChannelGroups(Reference)
| Object | Data Object with this method | ||||
| Reference | Variant Specifies which channel groups are in the list the method returns. You can use different comma-separated expressions. Each expression must conform to the following syntax:
| ||||
| oElementList | ElementList <Data> Returned object |
![]() | Note If the method GetChannelGroups does not find a channel group that matches the specified criteria in the Reference parameter or if the expression is not valid, the method returns an empty list. |
The following example returns the second, fourth, fifth to seventh, and the default channel group:
| VBScript | Python |
Dim oMyChannelGroups, oMyChnGrp Set oMyChannelGroups = Data.GetChannelgroups("[2,4,5..7],[]") For Each oMyChnGrp in oMyChannelGroups Call MsgBoxDisp(oMyChnGrp.Name) Next
The following example outputs the names of all channel groups whose names start with E:
| VBScript | Python |
Dim oMyChannelGroups, oMyChnGrp Set oMyChannelGroups = Data.GetChannelgroups("E*") For Each oMyChnGrp in oMyChannelGroups Call MsgBoxDisp(oMyChnGrp.Name) Next
The following example displays the names of the Example channel group and the second channel group:
| VBScript | Python |
Dim oMyChannelGroups, oMyChnGrp Set oMyChannelGroups = Data.GetChannelgroups("Example/Time,[2]") For Each oMyChnGrp in oMyChannelGroups Call MsgBoxDisp(oMyChnGrp.Name) Next
