DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

chnalloc and default group

Hi everybody

I have  3 groups  A, B and C , each gruop has 2 channels : time , and , X
so I wrote this :

for i=1 to groupcount
  call chnalloc("["&i&"]/X2",cl("["&i&"]/time"))
next

SO i wish to have the same 3 group and in each group a channel X2. Although I get 3 different lengths corresponding to cl(A/time ), cl(B/time) and (C/time) the channels are created always in the default group with this names "[1]\X2", "[1]\X21" and "[1]\X22" , how can i force the chnalloc to create the channel where i want

Thanks in advance





0 Kudos
Message 1 of 4
(3,687 Views)
Hello arkangel,

I tested your script on my DIAdem 9.1SP2 and it worked perfectly as you desire, After running it I got one xhannel called X2 in each of the groups. In my case the maximum length of the newly created channels is larger than the length of the time channel, but this is due to my dataarea configuration in the general desktop parameters.

If i understand your description correctly, all of your newly created channels will occure inside the same group, allthough you specify a groupnumber within the channelname. The name of the channel is incremented automatically, that is why you are getting the x21 and x22 channels.

Which version of DIAdem are you using?
Thanks.
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 4
(3,676 Views)
Hi arkangel,
 
There was a change in the behavior of the ChnAlloc() function in DIAdem 9.1 SP2b, which I'm guessing you have.  In the SP2b version, including group information in the channel name parameter of ChnAlloc() no longer sends the new channel to that group.  What has NOT changed is that the second to last parameter in the ChnAlloc() function is the TargetGroupIndex, so this is where your "i" variable should go.  Or alternatively you can Call GroupDefaultSet(i) inside the loop.
 
for i=1 to groupcount
  Call ChnAlloc("X2", cl("["&i&"]/time"), 1, DataTypeFloat64, "Numeric", i)
next
 
<OR>
 
for i=1 to groupcount
  call GroupDefaultSet(i)
  call chnalloc("["&i&"]/X2",cl("["&i&"]/time"))
next

Either way will work in any DIAdem 9.x,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 3 of 4
(3,675 Views)
Hi Walter , IngoS
I solved using the groupdefaultset , practical in the same way  as Walter  recommned , as  U guessed I am using Diadem 9.1 SP2b  ,

Thanks

0 Kudos
Message 4 of 4
(3,669 Views)