Method: Exists for Channels <Data>
- Updated2024-09-12
- 1 minute(s) read
Internal Data > Methods > Method: Exists for Channels <Data>
Method: Exists for Channels <Data>
Checks whether a Channel object with a specific name already exists in the Channels <Data> collection in the script interface for internal data. The Channels <Data> collection contains all channels of a channel group.
bExists = Object.Exists(Name)
| Object | Channels <Data> Object with this method |
| Name | String Specifies the name of the channel to be checked. DIAdem does not check the name in accordance with the DIAdem Name Conventions. |
| bExists | Boolean The value is TRUE if the collection contains an object with the specified name. |
The following example generates the SecondChannel in the first channel group only if the FirstChannel channel already exists:
| VBScript | Python |
Dim oGrp Set oGrp = Data.Root.ChannelGroups(1) If oGrp.Channels.Exists("FirstChannel") Then Call oGrp.Channels.Add("SecondChannel", DataTypeFloat64) End If