08-26-2011 10:55 AM
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!
Solved! Go to Solution.
08-30-2011 04:48 PM
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
08-31-2011 04:55 AM
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.