Specify input coupling mode
The Coupling property is visible only if the device you are using supports coupling and the value can be changed. Coupling can be DC or AC. If Coupling is DC, the input is connected directly to the amplifier. If Coupling is AC, a series capacitor is inserted between the input connector and the amplifier.
When AC coupling is selected, the DC bias component of the measured signal is filtered out of the waveform by the hardware. This is typically used with dynamic signals such as audio. When DC coupling is selected, the complete signal including the DC bias component is measured. This is typically used with slowly changing signals such as temperature or voltage readings.
A series capacitor is inserted between the input connector and the amplifier.
The input is connected directly to the amplifier.
The default is set to AC for
National Instruments® devices that use the NI-DAQmx interface and support AC coupling
National Instruments DSA cards using the Traditional NI-DAQ interface
Note: The Traditional NI-DAQ adaptor will be deprecated in a future version of the toolbox. If you create a Data Acquisition Toolbox™ object for Traditional NI-DAQ adaptor beginning in R2008b, you will receive a warning stating that this adaptor will be removed in a future release. See the supported hardware page at www.mathworks.com/products/daq/supportedio.html for more information.
In all other cards, the default is set to DC.
In the session-based interface, create a session and add an analog input channel.
s = daq.createSession('ni'); ch = addAnalogInputChannel(s,'Dev4', 'ai1', 'Voltage')
Change the coupling type to DC:
ch.Coupling = 'DC';
In the legacy interface, create the analog input object ai for a National Instruments board, and add a hardware channel to it.
ai = analoginput('nidaq','Dev1'); addchannel(ai,0);
You can return the coupling modes supported by the board with the Coupling field of the daqhwinfo function.
out = daqhwinfo(ai); out.Coupling
ans = 'AC,DC'
Configure the channel contained by ai to use dc-coupling:
ai.Channel.Coupling = 'DC'; ai.Channel.Coupling