DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

"Concatenating" Channels?

Hi,
 
I am using DIAdem 10.0.  I need to load several data sets into the data portal (each data set will be in one group).  Each data set has the same (or similar) channels.  For example, a simplified list of my channels:
 
Group1/ChannelA
Group2/ChannelA
Group3/ChannelA
...
GroupN/ChannelA
 
I need to "combine" all of the similar channels (ChannelA in my example) into one channel (CombChannelA) so I can create 3D graphs.  Is there a quick way to do this?  This is what I have been doing, and it is kind of slow:
 
 
 ChannelNameToCombine
 NewChnLength = 0
  NewChnName = "(Joint) " & ChannelNameToCombine
 
  ChnGroupArr = Split(ChnGroupStr, ", ")
  ChnArr = Split(ChnStr, ", ")
  For k = 0 To UBound(ChnGroupArr) - 1
    NewChnLength = NewChnLength + ChnLength(ChnGroupArr(k) & "/" & ChnArr(k))
  Next ' i
  Call GetCreateChannel(GroupIndexGet("Combined Channels"), NewChnName, NewChnLength)
  Row = 1
  For k = 0 To UBound(ChnGroupArr) - 1
     For l = 1 To ChnLength(ChnGroupArr(k) & "/" & ChnArr(k))
        ChDX(Row, CNo("Combined Channels/" & NewChnName)) = ChDX(l, CNo(ChnGroupArr(k) & "/" & ChnArr(k)))
        Row = Row + 1
      Next ' l
  Next ' k
0 Kudos
Message 1 of 2
(2,800 Views)

Hi Julia,

This is a common use-case.  Check out the following Example Program on the ni web:

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=C34F36CBFA7173C3E034080020E74861&p_...

Make sure you choose the "_91_" version, which is more robust, more full-featured, and faster (but will only run on DIAdem 9.1 or later).  If you are loading TDM files, just use the "Binary_Files" version and type in "TDM" for the DataPlugin name in the VBScript.

Ask if you have further questions,
Brad Turpin
DIAdem Product Support Engineer
National Intruments

 

0 Kudos
Message 2 of 2
(2,784 Views)