Description
Description-Separate-1Overview
The example demonstrates how to trigger a counter and analog input simultaneously using DAQmx and Arm Start triggers.
Description:
This example utilises an Arm Start trigger on the Gate of a counter to trigger a counter and one or more analog inputs.
Steps to implement or execute code
To implement this example (Assuming that you use counter 0 and the analog input 0):
- Place a DAQmx Create Virtual Channel VI to create your counter and analog task.
- Use the DAQmx Timing VI to define your sampling mode, sample rate and clock source.
- On the counter task, place a DAQmx Trigger Property Node.
- Expand the Property Node to show ArmStart.DigEdge.Source, ArmStart.DigEdge.Edge and ArmStart.TrigType.
- Set their values as follows:
- ArmStart.DigEdge.Source to the gate of ctr0.
- ArmStart.DigEdge.Edge to Rising.
- ArmStart.TrigType to Digital Edge.
- In parallel, place a DAQmx Trigger VI in the analog task.
- Configure it for a Start Digital Edge trigger type.
- Connect The Source input to ArmStart.DigEdge.Source.
- Connect the Edge input to ArmStart.DigEdge.Edge.
- Start both tasks with the DAQmx Start Task VI.
- use a Flat Sequence Structure to ensure that both tasks start at the same time.
- For each task, place a While Loop consisting of a DAQmx Read VI to acquire your data.
- After each While Loop, place a DAQmx Stop VI and DAQmx Clear VI to stop and clean up the tasks.
To execute this example:
- Install the required software.
- Connect the DAQ hardware that supports the counter and analog input features.
- Confirm the connection with the NI Measurement & Automation Explorer (MAX).
- Open the VI and run it.
Requirements
Software:
LabVIEW 2012 or compatible
NI-DAQmx 16.0 or compatible
Hardware:
cDAQ with C series Counter Input Module and analog input module or compatible DAQ devices.


**This document has been updated to meet the current required format for the NI Code Exchange.**
Description-Separate-2