Synchronize Two Counters using a Dummy AI and an Arm Start Trigger
Overview
This example shows you how to synchronize two counter inputs using a dummy analog input and an arm start trigger. This is useful for E and M series cards where you do not have a third counter to use for synchronization of the others.
Downloads
Filename: synch-2counters-dummyai.vi
Requirements: View
I. Description:
This example shows you how to synchronize two counter inputs using a dummy analog input and an arm start trigger. This is useful for E and M Series cards where you do not have a third counter to use for synchronization of the others. The dummy analog input is basically an analog input task that is created but the data is not being read or used. This is done because you can use the aiSampleClock of this analog input to synchronize the two counter tasks.
II. Instructions for Running:
1. Select the Physical Channel for the First and Second Counters as well as for the Dummy AI that you will be using on your device.
2. Select the ai/SampleClock that you would like to use for synchronizing the counter tasks.
3. Select the Trigger Source and Software Trigger Line for your device. These two inputs should share a pin on the device and this can be verified by checking the Device Pinouts of the device. (The default for most E and M Series devices is Port1/Line0).
III. Block Diagram Steps:
1. Create a Counter Input channel.
2. Call the DAQmx Timing VI (Sample Clock) to configure the external sample clock timing parameters such as Sample Mode and Sample Clock Source. The Sample Clock Source determines when a sample will be inserted into the buffer. The 100kHz, 20MHz, and 80MHz timebases cannot be used as the Sample Clock Source. The Edge parameter can be used to determine when a sample is taken.
3. Use the DAQmx Trigger property node to configure a Digital Edge Arm Start Trigger. The Trigger Edge determines if a rising or falling edge will start the counter. The Trigger Source determines the location of the Arm Start Trigger.
4. Call the Start VI to arm the counter. The counter will begin counting edges when the Arm Start Trigger occurs.
5. Writes a signal to Port1/line0 which is routed to PFI0. PFI0 is being monitored by the ArmStart Trigger from Step 3. This begins the acquisition for the two counter tasks.
6. For continuous measurements, the counter will continually read all available data until the Stop button is pressed on the front panel.
7. Call the Clear Task VI to clear the Task.
8. Use the popup dialog box to display an error if any.
IV. Connections Overview:
Make sure the Pinouts for your particular device shows that PFI0 and Port1/line0 share a pin or the software trigger will not work. For further connection information, refer to your hardware reference manual.
Requirements
Filename: synch-2counters-dummyai.vi
Software Requirements
Application Software: LabVIEW Base Development System 7.1
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO)
Driver: NI-DAQmx 8.7.2
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
