DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

setting the default group

Hello
maybe somebody can help , I have several groups loaded in the data portal, with different names from differents measurements, but all of them have the same channels, i mean the measurements were taken in different moments and under different circunstances but all of them measure the same properties, and I have to count the change in some channels in particular , in a loop over all the groups , I always get the result for the first group , i have used something like this:

for i=1 to groupcount
Call GroupDefaultSet(i)
msgbox(chnlength("Time")) 'time is the name of one channel in more than one group
next

and instead of getting , for example the length of all channels "time " i get the length of the channel "time" from the first gruop

Thanks for your help
0 Kudos
Message 1 of 2
(3,274 Views)
Hi arkangel,

The GroupDefaultSet() command changes the default group, but that only affects ADDITIONS to the Data Portal after that point, such as new FormulaCalculation channels, excerpted section channels from VIEW, new ANALYSIS channels from an FFT calculation, etc.

If you want to reference channels of the same name from multiple groups, and you have DIAdem 9.x, you can use the [GroupName]/[ChannelName] adressing scheme to query off the "Time" channel from multiple groups. If you have DIAdem 9.1, then you can also use the [GroupIndex]/[ChannelName], [GroupName]/[ChannelIndex], or {GroupIndex]/[ChannelIndex] adressing options. For example:

For i = 1 TO GroupCount
ChNum = CNo("[" & i & "]/Time")
IF ChNum > 0 THEN Msg = Msg & "Group " & i & " --> " & ChnLength(ChNum) & vbCRLF
NEXT
MsgBox Msg

For DIAdem 8.x you will need to use the CNo() function's optional second parameter (ChannelNoStart) in order to ensure that you start at the next channel AFTER the one you just found. Channel numbers was all there was in DIAdem 8.x.

Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,260 Views)