DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

List of unique channels in data portal

Hello,
 
I often have multiple groups in my data portal and many of the channels (though not all) in each group share the same name as channels in the other groups.  What would be the most quick/efficient way that I could retrieve a list of the unique channel names in the data portal? 
 
For example, my data set might look as follows:
Group 1: contains channels A, B, C and D
Group 2: contains channels A, B, C, D and E
Group 3: contains channels B, C, D and E
 
My desired result:  Unique channel names in portal = A, B, C, D and E
**note, my groups often have 500+ channels in them, and this is why I am looking for something very quick.
 
Thanks!
Julia
0 Kudos
Message 1 of 3
(3,039 Views)
Hello Julia,

I dont have an idea if this is the fastest method but its working and not too difficult to implement.
I am using the VBS library object to create a list of the channels. The add method is giving an error if a channel name is allready existing. With the on error resume next statement I am suppressing these errors, though. In this way I am creating a list with unique channel names. Actually its a table with the channel names in the 1st column (called key) and the channel number of the 1st channel with this name in the second column (called item).

on error resume next
  Set chn = CreateObject("Scripting.Dictionary")
  for x = 1 to globusedchn
    chn.add cn(x), x
  next
  list = "Channels:"&vbcrlf

  for each k in chn.keys
  list = list & k & vbcrlf
  next
  msgbox list
on error goto 0

Let me know if this is running sufficiently quickly for all of your channels.

Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 3
(3,029 Views)
Thank you, this seems to work well.  I am actually putting the channel names into a ComboBox in a dialog box, to plot the multiple instances of each channel.  With 5000+ channels in the data portal it is relatively quick.
 
Thanks again!
Julia
0 Kudos
Message 3 of 3
(3,012 Views)