DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Build channel list

Solved!
Go to solution

I want to programatically build a list of channels suitable for passing to a function such as DataBlDel() which requires the channels to be passed to it as a channel list which is a string. I don't want to build teh string by concatinating it as that seems like a terrible kludge!

 

I found the functions ChnStrToChnList() and ChnListToChnStr(). These functions require a Channel List as "...a channel list as a vector in the script environment". How do I bild this programatically or is this even what I need to be doing? - the help file is as helpful as a hole in the head!

 

 

0 Kudos
Message 1 of 3
(3,840 Views)
Solution
Accepted by topic author St3ve

Hi St3ve,

 

For DIAdem 11.1 and later, the DataBlCopy() function does indeed accept a Channel Collection as its first paramerter, like this:

 

Call DataBlDel(Data.Root.ChannelGroups(1).Channels, 1, 100)

 For earlier DIAdem versions, you can build the ChnStr variable like this:

 

ChnStr = ""
FOR Each Channel In Data.Root.ChannelGroups(1).Channels
  ChnStr = ChnStrAdd(ChnStr, Channel.Properties("Number").Value)
NEXT ' Channel
Call DataBlDel(ChnStr, 1, 100)

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 2 of 3
(3,809 Views)

Many thanks Brad,

 

Over the Weekend I discovered how to build an "element collection" and for anybody else struggling that is what to look for in the help.

 

I am quite new to scripting in Diadem and the experience so far has been mainly negative due to the poor structure of the help files. They would be greatly improved with more examples and a greater degree on links between relevant topics. It is of limited use to have a help file where you seem to have to know exactly what you are looking for to find any information!

 

Regards,

Steve.

0 Kudos
Message 3 of 3
(3,803 Views)