DIAdem Help

Method: AddStoreChannel for Channels <DataPlugin>

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

Method: AddStoreChannel for Channels <DataPlugin>

Adds an object to the Channels collection and returns an ImplicitChannel object or a ProcessedChannel object.

Set oDispatch = Object.AddStoreChannel(oChannel, [sName])
ObjectChannels <DataPlugin>
Object with this method
oChannelObject
Specifies the channel to be added.
[sName]String
Specifies the name of the channel to be added.
oDispatchReturned object
ImplicitChannel | ProcessedChannel

The following example transfers the information in the FromStore object about channel groups and about channels, into the structure of the TDM data model:

Sub ReadStore(FromStore) 
  Call FindAndCreateGroups(FromStore.Children) 
End Sub 

Sub FindAndCreateGroups(StoreElements) 
  Dim StoreElement 
  Dim TDMGroup 
  For Each StoreElement in StoreElements 
    If StoreElement.IsKindOf(eStoreChannelGroup) Then 
      Set TDMGroup = Root.ChannelGroups.Add(StoreElement.Name) 
      Call TDMGroup.Properties.AddProperties(StoreElement.Properties) 
      Call CreateChannels(StoreElement, TDMGroup) 
    Else 
      Call FindAndCreateGroups(StoreElement.Children) 
    End If 
  Next 
End Sub 

Sub CreateChannels(StoreGroup, TDMGroup) 
  Dim StoreChannel 
  For Each StoreChannel In StoreGroup.Channels 
    Call TDMGroup.Channels.AddStoreChannel(StoreChannel) 
  Next 
End Sub

Log in to get a better experience