Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Set input mode RSE DIFF NRSE

How can I program the input mode(RSE, NRSE, DIFF) use CCWAI class in Measurement studio? I am using PCI-MIO-16E-4 DAQ board.
0 Kudos
Message 1 of 3
(2,890 Views)
Hello

you can do that using MAX and changing the properties of the device or if you need to do it programmatically, you can try the following:

Access the CWAIChannel object from the CWAI object. And once to get the handle on that, you can call the setinputmode method

CWAIChannel singleChannel=m_ai.GetChannels().Item(_variant_t(1.0));

//_variant_t is a helper class from comdef.h

//Set to NRSE
singleChannel.SetInputMode(3);

You can set the following values for the various modes


cwaiDefaultInputMode=0
cwaiDIFF=1
cwaiRSE=2
cwaiNRSE=3

I hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(2,890 Views)
Thank you,
When I tried to use singleChannel.SetInputMode(3), the program calls CATCH_ALL(e){} of oledisp1.cpp, so I couldn't use set function of C_CWAICannel, but all get funtion is works. does anybody know why?
My program like this:

C_CWAIChannel singleChannel = m_ai.GetChannels().Add(channelString, CNiVariant(upper), CNiVariant(lower), vOptional, vOptional);

singleChannel.SetInputMode(2);
singleChannel.SetGain(10.0f);
singleChannel.SetScaleOffset(0.0f);

And who can tell me the relationship of gain, offset, scale and input range for PCI-MIO-16E-4 board?
0 Kudos
Message 3 of 3
(2,890 Views)