DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Group number from Channel (GroupIndexGet only works provided you know the group name)

Solved!
Go to solution

As it says in title. Im trying to get the group index number from the user having selected a channel. The ChannelNameGet also relies on you knowing the group index, any help here would be greatly appreciated!

Many thanks

Dan

0 Kudos
Message 1 of 4
(5,437 Views)
Solution
Accepted by topic author danz001

Hi Dan -

 

If you're using a relatively recent version of DIAdem, just use the object-oriented structure of the Data Portal:

 

Data.GetChannel("Channel_Name").ChannelGroup.Properties("index").Value

 

...where "Channel_Name" is your channel's name.  If you use the above line of code literally, then make sure your channel name is unique - otherwise you'll need to provide a group name as well (e.g. "Strain/Channel_1") to the parameter being passed to the GetChannel() method.

Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 2 of 4
(5,420 Views)

Many thanks Derik this was exactly what I needed!

Dan

0 Kudos
Message 3 of 4
(5,415 Views)

Hi All,

 

For completeness, if you're using a creepy-old version of DIAdem that doesn't support channel objects or you're stuck with legacy code that uses channel names or channel numbers instead, you can still get the group index of a channel with the ChnGroup(ChannelNameOrNum) command.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 4
(5,382 Views)