DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

ChnConcat with any Groups

Hello i must Concat any Groups with any Channels

 

Group 1 to 11 are the Basic Groups, Group 12 to 22 are Groups with the same Structure.

 

I tink i make a Loop for all Groups and into this loop a second loop with the Channels in this Group with the

GroupChnCount to count the chanels in the Group

 

the Offset ist the difference to beginn the Second Groups

 

the Code

 

'-------------------------------------------------------------------------------

'-- VBS-Script-Datei

'-- Neu erstellt am 07.07.2015 16:58:58

'-- Ersteller:

'-- Kommentar:

'-------------------------------------------------------------------------------

Option Explicit 'Erzwingt die explizite Deklaration aller Variablen in einem Script.

Dim Groupindex,GroupindexHigh

Dim Kanalindex

Dim Endindex

Dim Offset

Offset=11

For Groupindex= 1 to 11 'Group

Endindex=GroupChnCount(Groupindex)

 

GroupindexHigh=(Groupindex+Offset)

For Kanalindex= 1 to Endindex

 

 

call chnconcat(cnoxget(Groupindex,Kanalindex),cnoxget(Groupindex,Kanalindex))

Next

 

Next 'Group

 

greetings Thomas

 

0 Kudos
Message 1 of 2
(4,158 Views)

Hi Thomas,

 

Looks pretty good-- I think the only thing you're missing is the "GroupindexHigh" in the second parameter:

 

 

Call chnconcat(cnoxget(Groupindex,Kanalindex),cnoxget(GroupindexHigh,Kanalindex))

 

Note that in the next couple of versions DIAdem will stop supporting the old channel number approach, so the CNoXGet() command won't work for much longer.  This is an example of the new object approach:

 

iMax = 11
For i = 1 to iMax 'Group
  Set FromGroup = Data.Root.ChannelGroups(i)
  Set ToGroup = Data.Root.ChannelGroups(i+iMax)
  jMax = FromGroup.Channels.Count
  For j = 1 TO jMax
    Call ChnConcat(FromGroup.Channels(j), ToGroup.Channels(j))
  Next ' Channel
Next ' Group

 

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 2 of 2
(4,094 Views)