Brad Turpin
unread,Aug 11, 2008, 3:10:11 PM8/11/08You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi Hristo,
I think the error code you're getting is misleading. What the error should say is something like "The channel index parameter is invalid". The trouble arises because there is a difference between the global channel number that CNo() returns and the group-relative channel index that is pertinent in the Channels collection. If you only have 1 group, and if the channels were created in order and never moved, then these two properties "Channel.Number" and "Channel.GroupIndex" are in fact the same for each channel. As soon as you have a second group, though, its first channel has Channel.GroupIndex = 1, and this is not equal to its Channel.Number property, which is > 1. I also missed the "-1" in your original code post-- you want to reference the channel BEFORE the "NewChannel". So, you first need to get the group-relative channel index of the "NewChannel", then reference the channel immediately previous to that channel, like this:
ChIdx = Data. Root. ChannelGroups( GroupDefaultGet).Channels( "NewChannel").Properties( "groupindex").ValueChLen = Data. Root. ChannelGroups( GroupDefaultGet).Channels(ChIdx-1 ).Properties( "length").Value
Ask if you have further questions,Brad TurpinDIAdem Product Support EngineerNational Instruments