DIAdem Help

Method: Exists for Channels <Data>

  • Updated2024-09-12
  • 1 minute(s) read

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)
ObjectChannels <Data>
Object with this method
NameString
Specifies the name of the channel to be checked. DIAdem does not check the name in accordance with the DIAdem Name Conventions.
bExistsBoolean
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:

VBScriptPython

 

Dim oGrp
Set oGrp = Data.Root.ChannelGroups(1)
If oGrp.Channels.Exists("FirstChannel") Then
  Call oGrp.Channels.Add("SecondChannel", DataTypeFloat64)
End If

Log in to get a better experience