Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read the internal gain ?

if I set an internal gain with this command:

m_CWAI.GetChannels().Add(ScanChannels[i],CNiVariant(10),CNiVariant(-10), vOptional, vOptional);

Then my internal card gain should be 0.5. How do I read this gain value with the GetGain command?

I use m_CWAI.GetChannels().Item (??????).GetGain();

I have problem with the Item command since it needs Variant type variable and I have no clue what should be the input.

by the way, my DAQ is PCI-MIO-16E-1 card.
0 Kudos
Message 1 of 2
(2,659 Views)
Hey DrObb,

I notice that you are using Visual C++. I know that in Visual Basic it represents the index of the channel. If you have just used one instance of .Add to add the channel than it should be Item(1).GetGain(). This will return the gain of the first channel index that was added.

However, assume you added channel 0 with a range of +/- 10V and then added channel 6 with a range +/- 5V.

Item(1).GetGain() will return a gain of 0.5 for channel 0 and Item(2).GetGain() will return a gain of 1 for channel 6.

I hope this helps out.

Joshua P.
Application Engineering
National Instruments
0 Kudos
Message 2 of 2
(2,659 Views)