Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you configure the antialiasing filters on a PXI-6120 DAQ card?

I'm am using Measurement Studio 7.0 and C#. I am trying to use the AIParameter function in the CWDAQTools control.
0 Kudos
Message 1 of 5
(4,107 Views)
Hey krahne,

Here is a knowledgebase that addresses this issue. The example code is in Visual Basic, but you will need to follow the same guide lines in C#.

http://digital.ni.com/public.nsf/websearch/5567DA28A5A99C8686256BDF0075FF65?OpenDocument

I hope this helps out.

Joshua P.
Application Engineering
National Instruments
Message 2 of 5
(4,107 Views)
I was originally trying to use the approach in the link, but am getting a type mismatch error. Here is my code. Maybe you can see what I'm doing wrong.

//***************************************************
int device = 4;
CWAIParameterNames paramName = CWAIParameterNames.cwaiFilterSetting;
string channelString = "1";
CWDAQParameterOperations operation = CWDAQParameterOperations.cwdaqParameterSet;
double floatIn = 100000 //100 kHz for 6120;
CWAIParameterValues valueIn = CWAIParameterValues.cwaiVolts;
string stringIn = "";
bool boolIn = false;

object deviceOut = new int();
object valueOut = CWAIParameterValues.cwaiVolts;
object floatOut = new double();
object stringOut = new string(new char[0]);
object boolOut = new bool();

axCWDAQTo
ols1.AIParameter(device, paramName,
channelString, operation,
floatIn, valueIn, stringIn,
boolIn, ref deviceOut,
ref valueOut,ref floatOut,
ref stringOut,ref boolOut);
//***************************************************
0 Kudos
Message 3 of 5
(4,107 Views)
Hey krahne,

I looked into this a little more and it seems to be a problem when you
initialize the objects. If the object is equal to null it works fine,
but if it has a value and is related to a type then you get the error.
I have included an example that should help out and here is some
documentation on our web site that talks about it as well.

http://zone.ni.com/devzone/conceptd.nsf/webmain/CB6EEFBA3C5FEFF186256B68007130A1?opendocument

Thanks,

Joshua P.
Application Engineering
National Instruments
0 Kudos
Message 4 of 5
(4,107 Views)
Joshua,

Thank you for all your help. I was finally able to get it working.
0 Kudos
Message 5 of 5
(4,107 Views)