From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the coupling mode in the PXI4464 module.

Solved!
Go to solution

Hello guys.
In order to perform voltage measurements with the PXI4464, I am writing a code in C using the LabWindows.

In a simple way, I have created the Task, the Voltage Channel and set the Timing. To do this, I used the following functions:

DAQmxCreateTask("",&taskHandle);

DAQmxCreateAIVoltageChan(taskHandle ,chan ,"", DAQmx_Val_Cfg_Default, min, max, DAQmx_Val_Volts, NULL);

DAQmxCfgSampClkTiming(taskHandle, clockSource, rate, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000);

Sometimes I need to perform test using DC coupling mode; sometimes using AC coupling mode. However, I did not find how to set the coupling mode using the DAQmx functions.

Could anyone help me?

Regards,

Johann

0 Kudos
Message 1 of 4
(2,763 Views)
Solution
Accepted by topic author JJJJeb

I never tried this, but digging into channel attributes I have found this one that should suit your needs:

DAQmxSetChanAttribute (taskHandle, "Channel", DAQmx_AI_Coupling, DAQmx_Val_AC);

As per the channel name, since you don't assign names when creating the channels you can pass the physical channel name, which is the one DAQmx assigns internally if not passed. If you have only one channel in the task you can pass an empty string or NULL as the channel name.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(2,670 Views)

Thank you so much Roberto. It seems to be working.

 

But now I have another question. How did you find it?

It is pretty hard to find what I need using the help and the Library Tree. 

 

Best regards

0 Kudos
Message 3 of 4
(2,651 Views)

Well, a little bit of experience made me think that the coupling mode could be a channel attribute, so I opened DAQmxSetChanAttribute function panel and clicked on Attribute field to open the list of attributes: since I couldn't find coupling into Analog Input >> Voltage branch I switched to Analog Input >> General properties and found it into Input Configuration sub-branch.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(2,641 Views)