DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I count channel's number in diadem?

I need to know the number of channels in a file. I use a bucle like:
NumCh_=0
Do While CHNLENGTH(NumCh_+1)>0
NumCh_=NumCh_+1
Loop

But I'm sure that it is a instruction to get the number of channels. Can you help me?
0 Kudos
Message 1 of 4
(4,449 Views)
There is the global variable "ChnNoMax". But i think, that's not what you are looking for. You are looking for channels with "content", so channels with a length > 0 ?
If so, you have to check all channels in a loop similar yours, because its possible that emty channels are in the middle.
And you have to descide your looking for the number of filled channels or the index of the highest filled channel. That's a difference.


bohm
0 Kudos
Message 2 of 4
(4,449 Views)
Hi Radurdin,

As "bohm" mentioned, you might be interested in the channel number of the last channel with any values in it. There is an easy way to get that-- the DIAdem variable

GlobUsedChn

always stores the channel number of the last channel with data in it. It can happen that there are smaller empty channels prior to the channel number returned by GlobUsedChn, but usually the channels before it are all full.

Also, you say you want to know how many channels there are in a file, but then you start a loop over the channels in DIAdem. If you really want to know how many channels there are in a file, without having to load them into DIAdem, this is possible for some files with an easy set of commands and for all files with a hard set of commmands.


Finally, in DIAdem 9.0 and later you can also get the number of channels in any group with the

GroupChnCount(GroupIndex)

variable, and the number of available Groups with the

GroupCount

variable.

Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 3 of 4
(4,449 Views)
This is teh instruction i was looking for. thanks
0 Kudos
Message 4 of 4
(4,449 Views)