NI-DAQmx .NET Examples

NI-DAQmx 17.1 .NET Class Library Help

Edition Date: June 2017

Part Number: 370473J-01

»View Product Info
Download Help (Windows Only)

When you install the Measurement Studio NI-DAQmx .NET class library, example programs are installed by default. The location of the Microsoft Visual Basic .NET and Visual C# examples are relative to the default installation directory.

Name and Description Default Install Location
AcqMultVoltageSamples_SWTimed

This example demonstrates how to acquire a finite amount of data using a software timer.

Visual C#: Analog In\Measure Voltage\AcqMultVoltageSamples_SWTimed\CS

Visual Basic .NET: Analog In\Measure Voltage\AcqMultVoltageSamples_SWTimed\VB

AcqOneVoltageSample

This example demonstrates how to acquire a single reading from a constant or slowly varying signal.

Visual C#: Analog In\Measure Voltage\AcqOneVoltageSample\CS

Visual Basic .NET: Analog In\Measure Voltage\AcqOneVoltageSample\VB

AcqStrainSamples

This example demonstrates how to perform a strain measurement.

Visual C#: Analog In\Measure Strain\AcqStrainSamples\CS

Visual Basic .NET: Analog In\Measure Strain\AcqStrainSamples\VB

AcqVoltageSamples_ExtClk

This example demonstrates how to acquire a finite amount of data using an external clock.

Visual C#: Analog In\Measure Voltage\AcqVoltageSamples_ExtClk\CS

Visual Basic .NET: Analog In\Measure Voltage\AcqVoltageSamples_ExtClk\VB

AcqVoltageSamples_IntClk

This example demonstrates how to acquire a finite amount of data using an internal clock.

Visual C#: Analog In\Measure Voltage\AcqVoltageSamples_IntClk\CS

Visual Basic .NET: Analog In\Measure Voltage\AcqVoltageSamples_IntClk\VB

AcqVoltageSamples_IntClkAnalogStart

This example demonstrates how to acquire a finite amount of data using the DAQ device's internal clock, started by an analog edge condition.

Visual C#: Analog In\Measure Voltage\AcqVoltageSamples_IntClkAnalogStart\CS

Visual Basic .NET: Analog In\Measure Voltage\AcqVoltageSamples_IntClkAnalogStart\VB

AcqVoltageSamples_IntClkDigRef

This example demonstrates how to acquire a finite amount of data using an internal clock and a digital reference trigger.

Visual C#: Analog In\Measure Voltage\AcqVoltageSamples_IntClkDigRef\CS

Visual Basic .NET: Analog In\Measure Voltage\AcqVoltageSamples_IntClkDigRef\VB

AcqVoltageSamples_IntClkDigStartAndRef

This example demonstrates how to acquire a finite amount of data using an internal clock and a digital start and reference trigger.

Visual C#: Analog In\Measure Voltage\AcqVoltageSamples_IntClkDigStartAndRef\CS

Visual Basic .NET: Analog In\Measure Voltage\AcqVoltageSamples_IntClkDigStartAndRef\VB

AIAOShardTimebaseAndTrig_DSA

This example synchronizes the clocks and trigger on two Dynamic Signal Acquistion (DSA) devices and performs continuous analog input and output. NOTE: This example is intended to show low level synchronization of various devices. DSA and S Series devices now support including channels from multiple devices in a single task. DAQmx automatically synchronizes the devices in such a task. See the DAQmx Help>>NI-DAQmx Device Considerations>>Multidevice Tasks section for further details.NOTE: If you are using PXI DSA devices along with sample clock timebase synchronization, the master device must reside in PXI slot 2.NOTE: This code will not run "as-is" on a multifunction (MIO) DAQ device.

Visual C#: Synchronization\Multi-Device\AIAOShardTimebaseAndTrig_DSA\CS

Visual Basic .NET: Synchronization\Multi-Device\AIAOShardTimebaseAndTrig_DSA\VB

AIContAcquisition

This example demonstrates how to acquire a continuous amount of data using the DAQ device's internal clock. It also shows how to synchronize two devices for different device families (E Series, M Series, and DSA), to simultaneously acquire the data.NOTE: This example is intended to show low level synchronization of various devices. DSA and S Series devices now support including channels from multiple devices in a single task. DAQmx automatically synchronizes the devices in such a task. See the DAQmx Help>>NI-DAQmx Device Considerations>>Multidevice Tasks section for further details.NOTE: PXI 6115 and 6120 (S Series) devices don't require sharing of master timebase, because they auto-lock to Clock 10. For those devices sharing a start trigger is adequate.NOTE: For the PCI-6154 S Series device use the M Series (PCI) synchronization type to synchronize using the reference clock.

Visual C#: Synchronization\Multi-Device\AIContAcquisition\CS

Visual Basic .NET: Synchronization\Multi-Device\AIContAcquisition\VB

AIFiniteAcquisition

This example demonstrates how to acquire a finite amount of analog input data using two DAQ devices' internal clocks. It also synchronizes these devices depending on the device family (E Series, M Series, or DSA) to simultaneously acquire the data.NOTE: This example is intended to show low level synchronization of various devices. DSA and S Series devices now support including channels from multiple devices in a single task. DAQmx automatically synchronizes the devices in such a task. See the DAQmx Help>>NI-DAQmx Device Considerations>>Multidevice Tasks section for further details.NOTE: PXI 6115 and 6120 (S Series) devices don't require sharing of master timebase, because they auto-lock to Clock 10. For those devices sharing a start trigger is adequate.NOTE: For the PCI-6154 S Series device use the M Series (PCI) synchronization type to synchronize using the reference clock.

Visual C#: Synchronization\Multi-Device\AIFiniteAcquisition\CS

Visual Basic .NET: Synchronization\Multi-Device\AIFiniteAcquisition\VB

ConAcqRTDSmps_IntClk_SCXI1102And1581

This example demonstrates how to acquire temperature from an RTD using the internal clock of the DAQ device.This example uses the SCXI 1102 module in conjunction with the SCXI 1581 module.

Visual C#: Analog In\Measure Temperature\ConAcqRTDSmps_IntClk_SCXI1102And1581\CS

Visual Basic .NET: Analog In\Measure Temperature\ConAcqRTDSmps_IntClk_SCXI1102And1581\VB

ConAcqThmSmps_IntClk_SCXI1102And1581

This example demonstrates how to acquire temperature data from a thermistor using the DAQ device's internal clock. This example uses the SCXI 1102 module in conjunction with the SCXI 1581 module.

Visual C#: Analog In\Measure Temperature\ConAcqThmSmps_IntClk_SCXI1102And1581\CS

Visual Basic .NET: Analog In\Measure Temperature\ConAcqThmSmps_IntClk_SCXI1102And1581\VB

ConAcqVoltSmpls_ConfigFilter_SCXI114x

This example demonstrates how to acquire and filter an analog signal using the SCXI-114x.

Visual C#: Analog In\Measure Voltage\ConAcqVoltSmpls_ConfigFilter_SCXI114x\CS

Visual Basic .NET: Analog In\Measure Voltage\ConAcqVoltSmpls_ConfigFilter_SCXI114x\VB

ContAccelSamp_IntClk_AnlgStart

This example demonstrates how to create an analog input acceleration task and perform a continuous acquisition using option IEPE excitation, analog triggering, and overload detection.

Visual C#: Analog In\Measure Acceleration\ContAccelSamp_IntClk_AnlgStart\CS

Visual Basic .NET: Analog In\Measure Acceleration\ContAccelSamp_IntClk_AnlgStart\VB

ContAccelSamp_IntClk_AnlgStart_SCXI

This example demonstrates how to make continuous, hardware-timed acceleration measurements using an SCXI-153x module.

Visual C#: Analog In\Measure Acceleration\ContAccelSamp_IntClk_AnlgStart_SCXI\CS

Visual Basic .NET: Analog In\Measure Acceleration\ContAccelSamp_IntClk_AnlgStart_SCXI\VB

ContAcq0_20mACurrentSamples_IntClk

This example demonstrates how to continuously measure current using an internal hardware clock for timing.

Visual C#: Analog In\Measure Current\ContAcq0_20mACurrentSamples_IntClk\CS

Visual Basic .NET: Analog In\Measure Current\ContAcq0_20mACurrentSamples_IntClk\VB

ContAcqCustomVoltageSamples_9237

This example performs Wheatstone Bridge measurements with offset nulling if desired.

Visual C#: Analog In\Measure Wheatstone Bridge\ContAcqCustomVoltageSamples_9237\CS

Visual Basic .NET: Analog In\Measure Wheatstone Bridge\ContAcqCustomVoltageSamples_9237\VB

ContAcqFreq_IntClk_SCXI1126

This example demonstrates how to acquire frequency data from an SCXI-1126 using the DAQ device's internal clock.

Visual C#: Analog In\Measure Frequency\ContAcqFreq_IntClk_SCXI1126\CS

Visual Basic .NET: Analog In\Measure Frequency\ContAcqFreq_IntClk_SCXI1126\VB

ContAcqLVDTSamples_IntClk_SCXI1540

This example demonstrates how to make a continuous, hardware-timed acceleration measurement using an SCXI-1540 module.

Visual C#: Analog In\Measure Linear Position\ContAcqLVDTSamples_IntClk_SCXI1540\CS

Visual Basic .NET: Analog In\Measure Linear Position\ContAcqLVDTSamples_IntClk_SCXI1540\VB

ContAcqRTDSamples_IntClk

This example demonstrates how to acquire temperature from an RTD using the internal clock of the DAQ device.

Visual C#: Analog In\Measure Temperature\ContAcqRTDSamples_IntClk\CS

Visual Basic .NET: Analog In\Measure Temperature\ContAcqRTDSamples_IntClk\VB

ContAcqRVDTSamples_IntClk_SCXI1540

This example demonstrates how to make a continuous, hardware-timed acceleration measurement using an SCXI-1540 module.

Visual C#: Analog In\Measure Rotary Position\ContAcqRVDTSamples_IntClk_SCXI1540\CS

Visual Basic .NET: Analog In\Measure Rotary Position\ContAcqRVDTSamples_IntClk_SCXI1540\VB

ContAcqSndPressureSamples_IntClk

This example demonstrates how to acquire a continuous set of sound pressure data using the DAQ device's internal clock.

Visual C#: Analog In\Measure Sound Pressure\ContAcqSndPressureSamples_IntClk\CS

Visual Basic .NET: Analog In\Measure Sound Pressure\ContAcqSndPressureSamples_IntClk\VB

ContAcqThermocoupleSamples_IntClk

This example demonstrates how to continuously acquire temperature readings from one or more thermocouples.

Visual C#: Analog In\Measure Temperature\ContAcqThermocoupleSamples_IntClk\CS

Visual Basic .NET: Analog In\Measure Temperature\ContAcqThermocoupleSamples_IntClk\VB

ContAcqVoltageSamples_ExtClkDigStart

This example demonstrates how to continuously acquire analog voltage data using an external clock, started by a digital trigger.

Visual C#: Analog In\Measure Voltage\ContAcqVoltageSamples_ExtClkDigStart\CS

Visual Basic .NET: Analog In\Measure Voltage\ContAcqVoltageSamples_ExtClkDigStart\VB

ContAcqVoltageSamples_IntClk

This example demonstrates how to acquire a continuous amount of data using the DAQ device's internal clock.

Visual C#: Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk\CS

Visual Basic .NET: Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk\VB

ContAcqVoltageSamples_IntClk_SWTrigger

This example demonstrates how to perform an analog software triggered acquisition. The example allows the user to specify the triggering condition and the number of pre-trigger samples to acquire.

Visual C#: Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk_SWTrigger\CS

Visual Basic .NET: Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk_SWTrigger\VB

ContAcqVoltageSamples_IntClk_ToFile

This example demonstrates how to acquire, write to file, and load from disk a continuous amount of analog input data using the DAQ device's internal clock.

Visual C#: Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk_ToFile\CS

Visual Basic .NET: Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk_ToFile\VB

ContAcqVoltageSamples_SWTimed

This example demonstrates how to acquire a continuous amount of data using a software timer.

Visual C#: Analog In\Measure Voltage\ContAcqVoltageSamples_SWTimed\CS

Visual Basic .NET: Analog In\Measure Voltage\ContAcqVoltageSamples_SWTimed\VB

ContAcqVoltageSmpls_IntClkAnalogStart

This example demonstrates how to continuously acquire data using the DAQ device's internal clock and an analog slope start trigger.

Visual C#: Analog In\Measure Voltage\ContAcqVoltageSmpls_IntClkAnalogStart\CS

Visual Basic .NET: Analog In\Measure Voltage\ContAcqVoltageSmpls_IntClkAnalogStart\VB

ContAcqVoltageSmps_IntClk_PauseTrigger

This example demonstrates how to continuously acquire data using DAQ device's internal clock and a digital pause trigger.

Visual C#: Analog In\Measure Voltage\ContAcqVoltageSmps_IntClk_PauseTrigger\CS

Visual Basic .NET: Analog In\Measure Voltage\ContAcqVoltageSmps_IntClk_PauseTrigger\VB

ContAcqVoltSmpls_EveryNSamplesEvent

This example demonstrates how to use Every N Samples events to acquire a continuous amount of data using the DAQ device's internal clock. The Every N Samples events indicate when data is available from DAQmx.

Visual C#: Analog In\Measure Voltage\ContAcqVoltSmpls_EveryNSamplesEvent\CS

Visual Basic .NET: Analog In\Measure Voltage\ContAcqVoltSmpls_EveryNSamplesEvent\VB

ContForceBridgeSampleswCal

This example performs Wheatstone Bridge measurements with offset nulling if desired.

Visual C#: Analog In\Measure Force\ContForceBridgeSampleswCal\CS

Visual Basic .NET: Analog In\Measure Force\ContForceBridgeSampleswCal\VB

ContGenCurrentUpdatesWfm_IntClk

This example demonstrates how to output a continuous number of current samples to an Analog Output Channel using an internal sample clock.

Visual C#: Analog Out\Generate Current\ContGenCurrentUpdatesWfm_IntClk\CS

Visual Basic .NET: Analog Out\Generate Current\ContGenCurrentUpdatesWfm_IntClk\VB

ContGenVoltageWfm_ExtClk

This example demonstrates how to continuously output a periodic waveform using an external clock.

Visual C#: Analog Out\Generate Voltage\ContGenVoltageWfm_ExtClk\CS

Visual Basic .NET: Analog Out\Generate Voltage\ContGenVoltageWfm_ExtClk\VB

ContGenVoltageWfm_ExtClkDigStart

This example demonstrates how to continuously output a waveform using an external sample clock and a digital start trigger.

Visual C#: Analog Out\Generate Voltage\ContGenVoltageWfm_ExtClkDigStart\CS

Visual Basic .NET: Analog Out\Generate Voltage\ContGenVoltageWfm_ExtClkDigStart\VB

ContGenVoltageWfm_IntClk

This example demonstrates how to continuously output a periodic waveform using an internal sample clock.

Visual C#: Analog Out\Generate Voltage\ContGenVoltageWfm_IntClk\CS

Visual Basic .NET: Analog Out\Generate Voltage\ContGenVoltageWfm_IntClk\VB

ContGenVoltageWfmIntClk_AnalogStart

This example demonstrates how to continuously output a periodic waveform using an internal clock and an analog trigger signal.

Visual C#: Analog Out\Generate Voltage\ContGenVoltageWfmIntClk_AnalogStart\CS

Visual Basic .NET: Analog Out\Generate Voltage\ContGenVoltageWfmIntClk_AnalogStart\VB

ContReadDigChan_ExtClk

This example demonstrates how to continuously read values from a digital input channel using an external sample clock.

Visual C#: Digital\Read Values\ContReadDigChan_ExtClk\CS

Visual Basic .NET: Digital\Read Values\ContReadDigChan_ExtClk\VB

ContReadDigChan_PipeSampClkwHshk

This examples demostrates how to interface the NI 6536/7 to a synchonous FIFO.

Visual C#: Digital\Read Values\ContReadDigChan_PipeSampClkwHshk\CS

Visual Basic .NET: Digital\Read Values\ContReadDigChan_PipeSampClkwHshk\VB

ContWriteDigChan_Burst

This example demonstrates how to output a continuous digital waveform using burst handshaking mode.Note: This example program exports the sample clock from the device. To import the sample clock, call theConfigureHandshakingBurstExportClock method instead.

Visual C#: Digital\Generate Values\ContWriteDigChan_Burst\CS

Visual Basic .NET: Digital\Generate Values\ContWriteDigChan_Burst\VB

ContWriteDigChan_PipeSampClk

This examples demostrates how to interface the NI 6536/7 to a synchronous DAC with an output enable signal.

Visual C#: Digital\Generate Values\ContWriteDigChan_PipeSampClk\CS

Visual Basic .NET: Digital\Generate Values\ContWriteDigChan_PipeSampClk\VB

ContWriteDigChan_PipeSampClkwHshk

This examples demostrates how to interface the NI 6536/7 to a synchonous FIFO.

Visual C#: Digital\Generate Values\ContWriteDigChan_PipeSampClkwHshk\CS

Visual Basic .NET: Digital\Generate Values\ContWriteDigChan_PipeSampClkwHshk\VB

ContWriteDigPort_ExtClk

This example demonstrates how to output a continuous digital pattern using an external clock.

Visual C#: Digital\Generate Values\ContWriteDigPort_ExtClk\CS

Visual Basic .NET: Digital\Generate Values\ContWriteDigPort_ExtClk\VB

CountDigEvents

This example demonstrates how to count digital events on a Counter Input Channel. The Initial Count, Count Direction, and Edge are all configurable.This example shows how to count edges on the counter's default source pin, but could easily be expanded to count edges on any PFI, RTSI, or internal signal. Non-buffered event counting can also use a digital pause trigger which could be added to this example by configuring the Trigger object for the Task.

Visual C#: Counter\Count Digital Events\CountDigEvents\CS

Visual Basic .NET: Counter\Count Digital Events\CountDigEvents\VB

CountDigEventsBuffContinuous_ExtClk

This example demonstrates how to count buffered digital events on a Counter Input channel. The initial count, count direction, edge, and sample clock source are all configurable. Edges are counted on the counter's default input terminal (see I/O Connections Overview below for more information), but could easily be modified to count edges on a PFI or RTSI line.Note: For buffered event counting, an external sample clock is necessary to signal when a sample should be inserted into the buffer. Specify the source terminal of the external clock in the clock source text box when you run the example.

Visual C#: Counter\Count Digital Events\CountDigEventsBuffContinuous_ExtClk\CS

Visual Basic .NET: Counter\Count Digital Events\CountDigEventsBuffContinuous_ExtClk\VB

Gen0_20mACurrent

This example demonstrates how to generate a single current value on a single current output channel of a SCXI-1124 module and NI-6238/6239 M-Series devices.

Visual C#: Analog Out\Generate Current\Gen0_20mACurrent\CS

Visual Basic .NET: Analog Out\Generate Current\Gen0_20mACurrent\VB

GenDigPulse

This example demonstrates how to generate a single digital pulse from a counter output channel. The initial delay, high time, low time, and idle state are all software configurable. This example shows how to configure the pulse in terms of time, but can easily be modified to generate a pulse in terms of frequency and duty cycle or ticks.

Visual C#: Counter\Generate Pulse\GenDigPulse\CS

Visual Basic .NET: Counter\Generate Pulse\GenDigPulse\VB

GenDigPulseTrain_ContBuff_ExtClk

This example demonstrates how to generate a continuous buffered sample clocked digital pulse train from a Counter Output Channel. The Frequency, Duty Cycle, and Idle State are all configurable. The default data generated is a pulse train with a fixed frequency but a duty cycle that varies based on the Duty Cycle Max/Min and the signal type. The duty cycle will update with each sample clock edge.

Visual C#: Counter\Generate Pulse\GenDigPulseTrain_ContBuff_ExtClk\CS

Visual Basic .NET: Counter\Generate Pulse\GenDigPulseTrain_ContBuff_ExtClk\VB

GenDigPulseTrain_Continuous

This example demonstrates how to generate a continuous digital pulse train from a counter output channel. The frequency, duty cycle, and idle state are all configurable.This example shows how to configure the pulse in terms of frequency and duty cycle, but it can easily be modified to generate a pulse in terms of time or ticks.

Visual C#: Counter\Generate Pulse\GenDigPulseTrain_Continuous\CS

Visual Basic .NET: Counter\Generate Pulse\GenDigPulseTrain_Continuous\VB

GenDigPulseTrainContinuous_DigStart

This example demonstrates how to generate a continuous digital pulse train from a counter output channel using a digital start trigger. The frequency, duty cycle, and idle state are all configurable.This example shows how to configure the pulse in terms of frequency and duty cycle, but it can easily be modified to generate a pulse in terms of time or ticks.

Visual C#: Counter\Generate Pulse\GenDigPulseTrainContinuous_DigStart\CS

Visual Basic .NET: Counter\Generate Pulse\GenDigPulseTrainContinuous_DigStart\VB

GenDigPulseTrainContinuous_PauseTrigger

This example demonstrates how to generate a continuous digital pulse train from a counter output channel and controlled by an external digital pause trigger. The frequency, duty cycle, and idle state are all configurable.This example shows how to configure the pulse in terms of frequency and duty cycle, but can easily be modified to generate a pulse in terms of time or ticks.

Visual C#: Counter\Generate Pulse\GenDigPulseTrainContinuous_PauseTrigger\CS

Visual Basic .NET: Counter\Generate Pulse\GenDigPulseTrainContinuous_PauseTrigger\VB

GenMultCurrentUpdates_IntClk

This example demonstrates how to output a finite number of current samples to an Analog Output Channel using an internal sample clock.

Visual C#: Analog Out\Generate Current\GenMultCurrentUpdates_IntClk\CS

Visual Basic .NET: Analog Out\Generate Current\GenMultCurrentUpdates_IntClk\VB

GenMultVoltUpdates_IntClk

This example demonstrates how to output multiple voltage updates (samples) to an analog output channel.

Visual C#: Analog Out\Generate Voltage\GenMultVoltUpdates_IntClk\CS

Visual Basic .NET: Analog Out\Generate Voltage\GenMultVoltUpdates_IntClk\VB

GenMultVoltUpdates_SWTimed

This example demonstrates how to output multiple voltage updates (samples) to an analog output channel in a software timed loop.

Visual C#: Analog Out\Generate Voltage\GenMultVoltUpdates_SWTimed\CS

Visual Basic .NET: Analog Out\Generate Voltage\GenMultVoltUpdates_SWTimed\VB

GenMultVoltUpdatesIntClk_DigStart

This example demonstrates how to output multiple voltage updates (samples) to an analog output channel. The generation starts when a digital trigger is received.

Visual C#: Analog Out\Generate Voltage\GenMultVoltUpdatesIntClk_DigStart\CS

Visual Basic .NET: Analog Out\Generate Voltage\GenMultVoltUpdatesIntClk_DigStart\VB

GenVoltageUpdate

This example demonstrates how to output a single voltage update (sample) to an analog output channel.

Visual C#: Analog Out\Generate Voltage\GenVoltageUpdate\CS

Visual Basic .NET: Analog Out\Generate Voltage\GenVoltageUpdate\VB

Meas2EdgeSeparation

This example demonstrates how to measure two edge separation on a counter input channel. The first edge, second edge, minimum value, and maximum value are all configurable. This example measures two edge separation on the counter's default input terminals (see I/O Connections Overview below for more information), but could easily be expanded to measure two edge separation on any PFI, RTSI, or internal signal. Refer to your device documentation to see if your device supports two edge separation measurements.

Visual C#: Counter\Measure 2 Edge Separation\Meas2EdgeSeparation\CS

Visual Basic .NET: Counter\Measure 2 Edge Separation\Meas2EdgeSeparation\VB

Meas2EdgeSeparation_BufCont

This example demonstrates how to perform a continuous number of two edge separation measurements on a counter input channel. The first edge, second edge, minimum value, maximum value, and samples to read are all configurable. This example shows how to perform a two edge separation measurement on the counter's default input terminals (refer to the I/O Connections Overview below for more information), but could easily be expanded to measure two edge separation on any PFI, RTSI, or internal signal.Refer to your device documentation to see if your device supports two edge separation measurements.

Visual C#: Counter\Measure 2 Edge Separation\Meas2EdgeSeparation_BufCont\CS

Visual Basic .NET: Counter\Measure 2 Edge Separation\Meas2EdgeSeparation_BufCont\VB

MeasAngularPositionBufferedCont_ExtClk

This example demonstrates how to measure angular position using a quadrature encoder on a counter input channel. The decoding type, pulses per revolution, z-index enable, z-index phase, z-index value, and sample clock source are all configurable. Position is measured on the counter's default A, B, and Z input terminals (see I/O Connections Overview below for more information).Note: For buffered position measurement, an external sample clock is necessary to signal when a sample should be inserted into the buffer. This is set by the sample clock source.

Visual C#: Counter\Measure Position\MeasAngularPositionBufferedCont_ExtClk\CS

Visual Basic .NET: Counter\Measure Position\MeasAngularPositionBufferedCont_ExtClk\VB

MeasBuffered_SemiPeriodFinite

This example demonstrates how to measure semi-periods on a counter input channel. The minimum value, maximum value, sample mode, and samples per channel are all configurable.This example shows how to measure semi-period on the counter's default input terminal (see I/O Conections Overview below for more information), but can easily be expanded to measure semi-period on any PFI, RTSI, or internal signal by setting the properties on the CIChannel object.Semi-period measurement differs from pulse width measurement in that it measures both the high and the low pulses of a given signal. So for every period, two data points will be returned.

Visual C#: Counter\Measure Period Or Pulse Width\MeasBuffered_SemiPeriodFinite\CS

Visual Basic .NET: Counter\Measure Period Or Pulse Width\MeasBuffered_SemiPeriodFinite\VB

MeasDigFreqBuffCont_ExtClk_ArmStart

This example demonstrates how to continually measure the frequency on a Counter Input Channel with a sample clock and arm start trigger. This example shows how to measure frequency with a counter on any PFI, RTSI, or internal signal.

Visual C#: Counter\Measure Digital Frequency\MeasDigFreqBuffCont_ExtClk_ArmStart\CS

Visual Basic .NET: Counter\Measure Digital Frequency\MeasDigFreqBuffCont_ExtClk_ArmStart\VB

MeasDigFreqBuffCont_LargeRange2Ctr

This example demonstrates how to measure buffered frequency using two counters on a counter input channel. The divisor, maximum and minimum frequency values, and the edge parameter are configurable.This example shows how to measure frequency on the counter's default input terminal (see I/O Connections Overview below for more information), but could easily be expanded to measure frequency on any PFI, RTSI, or internal signal. Additionally, this example could be extended to measure frequency with other measurement methods for different frequency and quantization error requirements.

Visual C#: Counter\Measure Digital Frequency\MeasDigFreqBuffCont_LargeRange2Ctr\CS

Visual Basic .NET: Counter\Measure Digital Frequency\MeasDigFreqBuffCont_LargeRange2Ctr\VB

MeasDigFrequency_LowFreq1Ctr

This example demonstrates how to measure a frequency using one counter on a counter input channel. The starting edge, minimum value and maximum value are all configurable. This example shows how to measure frequency on the counter's default input terminal (see I/O Connections Overview below for more information), but could easily be expanded to measure frequency on any PFI, RTSI, or internal signal. Additionally, this example could be extended to measure frequency with two counters for different frequency and quantization error requirements.

Visual C#: Counter\Measure Digital Frequency\MeasDigFrequency_LowFreq1Ctr\CS

Visual Basic .NET: Counter\Measure Digital Frequency\MeasDigFrequency_LowFreq1Ctr\VB

MeasDigPeriodsBufCon_HighFrq2Ctr

This example demonstrates how to measure periods using two counters on a counter input channel. The measurement time, sample mode, and samples per read are configurable.This example shows how to measure period on the counters default input terminal, (see I/O Connections Overview below for more information), , but could easily be expanded to measure periods on any PFI, RTSI, or internal signal. Additionally, this example could be extended to measure period with other measurement methods for different frequency and quantization error requirements.

Visual C#: Counter\Measure Period or Pulse Width\MeasDigPeriodsBufCon_HighFrq2Ctr\CS

Visual Basic .NET: Counter\Measure Period or Pulse Width\MeasDigPeriodsBufCon_HighFrq2Ctr\VB

MeasGpsTimestamp_BuffFinite

This example demonstrates how to use a finite buffereded task to measure time using a GPS Timestamp Channel. The Synchronization Method, Synchronization Source, Sample Clock Source, and Samples per Channel are all configurable.

Visual C#: Counter\Measure GPS Timestamp\MeasGpsTimestamp_BuffFinite\CS

Visual Basic .NET: Counter\Measure GPS Timestamp\MeasGpsTimestamp_BuffFinite\VB

MeasPulseWidth

This example demonstrates how to measure pulse width on a counter input channel. The edge, minimum value and maximum value are all configurable.This example shows how to measure pulse width on the counter's default input terminal (see I/O Connections Overview below for more information), but could easily be expanded to measure pulse width on any PFI, RTSI, or internal signal.

Visual C#: Counter\Measure Period Or Pulse Width\MeasPulseWidth\CS

Visual Basic .NET: Counter\Measure Period Or Pulse Width\MeasPulseWidth\VB

MeasPulseWidthBuf_SmplClk_Cont

This example demonstrates how to continually measure pulsewidths on a Counter Input Channel using an external sampleclock. The Maximum and Minimum Values, Sample Clock Source, andSamples per Channel are all configurable.This example shows how to measure pulse width on the counter'sdefault input terminal (refer to section IV, I/O ConnectionsOverview, below for more information), but could easily beexpanded to measure pulse width on any PFI, RTSI, or internalsignal.Note: For sample clock measurements, an external sample clock isnecessary to signal when the counter should measure asample. This is set by the Sample Clock Source control.

Visual C#: Counter\Measure Period or Pulse Width\MeasPulseWidthBuf_SmplClk_Cont\CS

Visual Basic .NET: Counter\Measure Period or Pulse Width\MeasPulseWidthBuf_SmplClk_Cont\VB

MeasureGpsTimestamp

This example demonstrates how to use a GPS counter to update the current time.

Visual C#: Counter\Measure GPS Timestamp\MeasureGpsTimestamp\CS

Visual Basic .NET: Counter\Measure GPS Timestamp\MeasureGpsTimestamp\VB

MultiFunctionSyncAI_ReadDigChan

This example demonstrates how to continuously acquire analog and digital data at the same time, synchronized with one another on the same device.

Visual C#: Synchronization\Multi-Function\SyncAI_ReadDigChan\CS

Visual Basic .NET: Synchronization\Multi-Function\SyncAI_ReadDigChan\VB

MultiFunctionSyncAIAO

This example demonstrates how to continuously acquire and generate synchronized analog input and output, started by an external digital start trigger.

Visual C#: Synchronization\Multi-Function\SyncAIAO\CS

Visual Basic .NET: Synchronization\Multi-Function\SyncAIAO\VB

PWMCounterOutput

This example demonstrates how to do Pulse Width Modulation using Analog Input and Counter Output.

Visual C#: Control\General\PWMCounterOutput\CS

Visual Basic .NET: Control\General\PWMCounterOutput\VB

ReadDigChan

This example demonstrates how to read values from one or more digital input channels.

Visual C#: Digital\Read Values\ReadDigChan\CS

Visual Basic .NET: Digital\Read Values\ReadDigChan\VB

ReadDigChan_ChangeDetection

This example demonstrates how to read values from one or more digital input channels, using change detection timing.

Visual C#: Digital\Read Values\ReadDigChan_ChangeDetection\CS

Visual Basic .NET: Digital\Read Values\ReadDigChan_ChangeDetection\VB

ReadDigChan_ChangeDetection_DigFilter

This example demonstrates how to acquire filtered digital input via change detection and digital filtering.

Visual C#: Digital\Read Values\ReadDigChan_ChangeDetection_DigFilter\CS

Visual Basic .NET: Digital\Read Values\ReadDigChan_ChangeDetection_DigFilter\VB

ReadDigChan_ChangeDetection_Events

This example demonstrates how to read values from one or more digital input channels using the digital change detection event.

Visual C#: Digital\Read Values\ReadDigChan_ChangeDetection_Events\CS

Visual Basic .NET: Digital\Read Values\ReadDigChan_ChangeDetection_Events\VB

ReadDigChan_IntClk_DigRef

This example demonstrates how to acquire a finite amount of data (Waveform) using a digital reference trigger.

Visual C#: Digital\Read Values\ReadDigChan_IntClk_DigRef\CS

Visual Basic .NET: Digital\Read Values\ReadDigChan_IntClk_DigRef\VB

ReadDigChan_IntClk_PatternMatchStart

This example demonstrates how to acquire a finite amount of digital data (Waveform) using a pattern match start trigger (i.e. the acquisition begins when a specified pattern has been matched).

Visual C#: Digital\Read Values\ReadDigChan_IntClk_PatternMatchStart\CS

Visual Basic .NET: Digital\Read Values\ReadDigChan_IntClk_PatternMatchStart\VB

ReadDigPort

This example demonstrates how to read a single value from a digital port.

Visual C#: Digital\Read Values\ReadDigPort\CS

Visual Basic .NET: Digital\Read Values\ReadDigPort\VB

ReadDigPort_ExtClk

This example demonstrates how to read values from a digital port using an external sample clock.

Visual C#: Digital\Read Values\ReadDigPort_ExtClk\CS

Visual Basic .NET: Digital\Read Values\ReadDigPort_ExtClk\VB

TdmsAcqVoltageSamples_IntClk

This example demonstrates how to acquire a finite amount while simultaneously streaming that data to a binary file.

Visual C#: Analog In\Measure Voltage\TdmsAcqVoltageSamples_IntClk\CS

Visual Basic .NET: Analog In\Measure Voltage\TdmsAcqVoltageSamples_IntClk\VB

TdmsAcqVoltageSamples_IntClk_LogOnly

This example demonstrates how to acquire and stream data to a binary file.

Visual C#: Analog In\Measure Voltage\TdmsAcqVoltageSamples_IntClk_LogOnly\CS

Visual Basic .NET: Analog In\Measure Voltage\TdmsAcqVoltageSamples_IntClk_LogOnly\VB

TdmsContAcqVoltageSamples_IntClk

This example demonstrates how to acquire a continuous amount while simultaneously streaming that data to a binary file.

Visual C#: Analog In\Measure Voltage\TdmsContAcqVoltageSamples_IntClk\CS

Visual Basic .NET: Analog In\Measure Voltage\TdmsContAcqVoltageSamples_IntClk\VB

TdmsContAcqVoltageSamples_IntClk_LogOnly

This example demonstrates how to acquire and stream data to a binary file in a continuous manner.

Visual C#: Analog In\Measure Voltage\TdmsContAcqVoltageSamples_IntClk_LogOnly\CS

Visual Basic .NET: Analog In\Measure Voltage\TdmsContAcqVoltageSamples_IntClk_LogOnly\VB

WriteDigChan

This example demonstrates how to write values to a digital output channel.

Visual C#: Digital\Generate Values\WriteDigChan\CS

Visual Basic .NET: Digital\Generate Values\WriteDigChan\VB

WriteDigChan_ExtClk

This example demonstrates how to write values to a digital output channel using an external sample clock.

Visual C#: Digital\Generate Values\WriteDigChan_ExtClk\CS

Visual Basic .NET: Digital\Generate Values\WriteDigChan_ExtClk\VB

WriteDigChan_WatchdogTimer

This example demonstrates how to write values to a digital output channel, using a watchdog timer.

Visual C#: Digital\Generate Values\WriteDigChan_WatchdogTimer\CS

Visual Basic .NET: Digital\Generate Values\WriteDigChan_WatchdogTimer\VB

WriteDigPort

This example demonstrates how to write values to a digital output port.

Visual C#: Digital\Generate Values\WriteDigPort\CS

Visual Basic .NET: Digital\Generate Values\WriteDigPort\VB

WAS THIS ARTICLE HELPFUL?

Not Helpful