National Instruments NI 6602, NI660, NI 6601, NI 6608 User Manual

DAQ
ni.com/manuals
DeutschFrançais
NI 660x User Manual
NI 6601, NI 6602, and NI 6608 Devices

NI 660x User Manual

December 2009 372119B-01

Support

Worldwide Technical Support and Product Information

ni.com

National Instruments Corporate Headquarters

11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100

Worldwide Offices

Australia 1800 300 800, Austria 43 662 457990-0, Belgium 32 (0) 2 757 0020, Brazil 55 11 3262 3599, Canada 800 433 3488, China 86 21 5050 9800, Czech Republic 420 224 235 774, Denmark 45 45 76 26 00, Finland 358 (0) 9 725 72511, France 01 57 66 24 24, Germany 49 89 7413130, India 91 80 41190000, Israel 972 3 6393737, Italy 39 02 41309277, Japan 0120-527196, Korea 82 02 3451 3400, Lebanon 961 (0) 1 33 28 28, Malaysia 1800 887710, Mexico 01 800 010 0793, Netherlands 31 (0) 348 433 466, New Zealand 0800 553 322, Norway 47 (0) 66 90 76 60, Poland 48 22 328 90 10, Portugal 351 210 311 210, Russia 7 495 783 6851, Singapore 1800 226 5886, Slovenia 386 3 425 42 00, South Africa 27 0 11 805 8197, Spain 34 91 640 0085, Sweden 46 (0) 8 587 895 00, Switzerland 41 56 2005151, Taiwan 886 02 2377 2222, Thailand 662 278 6777, Turkey 90 212 279 3031, United Kingdom 44 (0) 1635 523545
For further support information, refer to the Technical Support and Professional Services appendix. To comment on National Instruments documentation, refer to the National Instruments Web site at the info code
feedback.
ni.com/info and enter
© 2006–2009 National Instruments Corporation. All rights reserved.

Important Information

Warranty

The NI 6601, NI 6602, and NI 6608 devices are warranted against defects in materials and workmanship for a period of one year from the date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace equipment that proves to be defective during the warranty period. This warranty includes parts and labor.
The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period. National Instruments does not warrant that the operation of the software shall be uninterrupted or error free.
A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on the outside of the package before any equipment will be accepted for warranty work. National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty.
National Instruments believes that the information in this document is accurate. The document has been carefully reviewed for technical accuracy. In the event that technical or typographical errors exist, National Instruments reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition. The reader should consult National Instr Instruments be liable for any damages arising out of or related to this document or the information contained in it.
E
XCEPT AS SPECIFIED HEREIN, NATIONAL INSTRUMENTS MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. CUSTOMERS RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL
I
NSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER. NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING
FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS, OR INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. This limitation of
the liability of National Instruments will apply regardless of the form of action, whether in contract or tort, including negligence. Any action against National Instruments must be brought within one year after the cause of action accrues. National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided herein does not cover damages, defects, malfunctions, or service failures caused by owner’s failure to follow the National Instruments installation, operation, or maintenance instructions; owner’s modification of the product; owner’s abuse, misuse, or negligent acts; and power failure or surges, fire, flood, accident, actions of third parties, or other events outside reasonable control.
uments if errors are suspected. In no event shall National

Copyright

Under the copyright laws, this publication may not be reproduced or transm itted in any form, electronic or mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, withou t the prior written consent of National Instruments Corporation.
National Instruments respects the intellectual property of others, and we ask our users to do the same. NI software is protected by copyright and other intellectual property laws. Where NI software may be used to reproduce software or other materials belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restriction.

Trademarks

National Instruments, NI, ni.com, and LabVIEW are trademarks of National Instruments Corporation. Refer to the Terms of Use section on
ni.com/legal for more information about National Instruments trademarks.
Other product and company names mentioned herein are trademarks or trade names of their respective companies.
Members of the National Instruments Alliance Partner Program are business entities independent from National Instruments and have no agency, partnership, or joint-venture relationship with National Instruments.

Patents

For patents covering National Instruments products/technology, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your media, or the National Instruments Patent Notice at ni.com/patents.

WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS

(1) NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF RELIABILITY SUITABLE FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN ANY LIFE SUPPORT SYSTEMS WHOSE FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT INJURY TO A HUMAN.
(2) IN ANY APPLICATION, INCLUDING THE ABOVE, RELIABILITY OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE IMPAIRED BY ADVERSE FACTORS, INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY, COMPUTER HARDWARE MALFUNCTIONS, COMPUTER OPERATING SYSTEM SOFTWARE FITNESS, FITNESS OF COMPILERS AND DEVELOPMENT SOFTWARE USED TO DEVELOP AN APPLICATION, INSTALLATION ERRORS, SOFTWARE AND HARDWARE COMPATIBILITY PROBLEMS, MALFUNCTIONS OR FAILURES OF ELECTRONIC MONITORING OR CONTROL DEVICES, TRANSIENT FAILURES OF ELECTRONIC SYSTEMS (HARDWARE AND/OR SOFTWARE), UNANTICIPATED USES OR MISUSES, OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER (ADVERSE FACTORS SUCH AS THESE ARE HEREAFTER COLLECTIVELY TERMED “SYSTEM FAILURES”). ANY APPLICATION WHERE A SYSTEM FAILURE WOULD CREATE A RISK OF HARM TO PROPERTY OR PERSONS (INCLUDING THE RISK OF BODILY INJURY AND DEATH) SHOULD NOT BE RELIANT SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE. TO AVOID DAMAGE, INJURY, OR DEATH, THE USER OR APPLICATION DESIGNER MUST TAKE REASONABLY PRUDENT STEPS TO PROTECT AGAINST SYSTEM FAILURES, INCLUDING BUT NOT LIMITED TO BACK-UP OR SHUT DOWN MECHANISMS. BECAUSE EACH END-USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM NATIONAL INSTRUMENTS' TESTING PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS PRODUCTS IN COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUATED OR CONTEMPLATED BY NATIONAL INSTRUMENTS, THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING THE SUITABILITY OF NATIONAL INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE INCORPORATED IN A SYSTEM OR APPLICATION, INCLUDING, WITHOUT LIMITATION, THE APPROPRIATE DESIGN, PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION.

Compliance

Electromagnetic Compatibility Information
This hardware has been tested and found to comply with the applicable regulatory requirements and limits for electromagnetic compatibility (EMC) as indicated in the hardware’s Declaration of Conformity (DoC) designed to provide reasonable protection against harmful interference when the hardware is operated in the intended electromagnetic environment. In special cases, for example when either highly sensitive or noisy hardware is being used in close proximity, additional mitigation measures may have to be employed to minimize the potential for electromagnetic interference.
While this hardware is compliant with the applicable regulatory EMC requirements, there is no guarantee that interference will not occur in a particular installation. To minimize the potential for the hardware to cause interference to radio and television reception or to experience unacceptable performance degradation, install and use this hardware in strict accordance with the instructions in the hardware documentation and the DoC
If this hardware does cause interference with licensed radio communications services or other nearby electronics, which can be determined by turning the hardware off and on, you are encouraged to try to correct the interference by one or more of the following measures:
Reorient the antenna of the receiver (the device suffering interference).
Relocate the transmitter (the device generating interference) with respect to the receiver.
•Plug the transmitter into a different outlet so that the transmitter and the receiver are on different branch circuits.
Some hardware may require the use of a metal, shielded enclosure (windowless version) to meet the EMC requirements for special EMC environments such as, for marine use or in heavy industrial areas. Refer to the hardware’s user documentation and
1
for product installation requirements.
the DoC
When the hardware is connected to a test object or to test leads, the system may become more sensitive to disturbances or may cause interference in the local electromagnetic environment.
Operation of this hardware in a residential area is likely to cause harmful interference. Users are required to correct the interference at their own expense or cease operation of the hardware.
Changes or modifications not expressly approved by National Instruments could void the user’s right to operate the hardware under the local regulatory rules.
1
.
1
. These requirements and limits are
1
The Declaration of Conformity (DoC) contains important EMC compliance information and instructions for the user or installer. To obtain the DoC for this product, visit and click the appropriate link in the Certification column.
ni.com/certification, search by model number or product line,

Contents

About This Manual
Conventions ...................................................................................................................vii
Related Documentation..................................................................................................viii
Chapter 1 Introduction
About NI 660x Devices..................................................................................................1-1
Using PXI with CompactPCI.........................................................................................1-1
Getting Started ...............................................................................................................1-2
Installing NI-DAQ Driver Software................................................................1-2
Installing Other Software ................................................................................1-2
Installing the Hardware ...................................................................................1-2
Accessories and Cables..................................................................................................1-3
Chapter 2 Device Overview
Digital I/O ......................................................................................................................2-1
Prescaling.......................................................................................................................2-1
Pad Synchronization ......................................................................................................2-2
Duplicate Count Prevention...........................................................................................2-4
Example Application That Works Correctly (No Duplicate Counting)..........2-5
Example Application That Works Incorrectly (Duplicate Counting) .............2-6
Example Application That Prevents Duplicate Counting ...............................2-6
Enabling Duplicate Count Prevention in NI-DAQmx.....................................2-7
When to Use Duplicate Count Prevention.......................................................2-7
When Not to Use Duplicate Count Prevention................................................2-7
Transfer Rates ................................................................................................................2-8
High Precision Clock (NI 6608) ....................................................................................2-9
Using the OCXO as the SOURCE Counter ....................................................2-9
Using the OCXO as the 10 MHz PXI Backplane Clock.................................2-9
Measuring OCXO Stable Frequency Deviation ..............................................2-11
Calibration .....................................................................................................................2-12
Register-Level Programming Information.....................................................................2-12
© National Instruments Corporation v NI 660x User Manual
Contents
Chapter 3 Signal Connections
Programmable Function Interfaces (PFIs)..................................................................... 3-1
Digital Filtering ............................................................................................................. 3-1
Power-On State.............................................................................................................. 3-3
Pin Assignments ............................................................................................................ 3-3
I/O Connector Pinout..................................................................................................... 3-5
Outputs ..........................................................................................................................3-8
Counters......................................................................................................................... 3-10
Counter n Source Signal ................................................................................. 3-10
Counter n Gate Signal ..................................................................................... 3-12
Counter n Auxiliary Signal ............................................................................. 3-13
Counter n Internal Output Signal.................................................................... 3-14
Hardware Arm Start Triggers ......................................................................... 3-14
Counter Pairs................................................................................................... 3-15
Counter Applications ...................................................................................... 3-15
Real-Time System Integration Bus ............................................................................... 3-16
RTSI Triggers ................................................................................................. 3-16
+5 V Power Source........................................................................................................ 3-17
I/O Signals .....................................................................................................................3-18
Field Wiring Considerations ........................................................................... 3-18
Noise ............................................................................................................... 3-18
Crosstalk..........................................................................................................3-19
Inductive Effects ............................................................................................. 3-20
Transmission Line Effects .............................................................................. 3-22
Counter Source to Counter Out Delay.............................................. 3-12
Appendix A Technical Support and Professional Services
Glossary
Index
NI 660x User Manual vi ni.com

About This Manual

This manual describes the electrical and mechanical aspects of the National Instruments NI 6601, NI 6602, and NI 6608 devices, and contains information about device operation and programming. Unless otherwise noted, text applies to all NI 660x devices. The PCI and PXI implementations are the same in functionality; their primary difference is the bus interface.

Conventions

The following conventions appear in this manual:
<> Angle brackets that contain numbers separated by an ellipsis represent
a range of values associated with a bit or signal name—for example, AO <3. .0>.
» The » symbol leads you through nested menu items and dialog box options
to a final action. The sequence File»Page Setup»Options directs you to pull down the File menu, select the Page Setup item, and select Options from the last dialog box.
This icon denotes a note, which alerts you to important information.
This icon denotes a caution, which advises you of precautions to take to avoid injury, data loss, or a system crash. When this symbol is marked on a product, refer to the Read Me First: Safety and Electromagnetic Compatibility document for information about precautions to take.
bold Bold text denotes items that you must select or click in the software, such
as menu items and dialog box options. Bold text also denotes parameter names.
italic Italic text denotes variables, emphasis, a cross-reference, or an introduction
to a key concept. Italic text also denotes text that is a placeholder for a word or value that you must supply.
monospace Text in this font denotes text or characters that you should enter from the
keyboard, sections of code, programming examples, and syntax examples. This font is also used for the proper names of disk drives, paths, directories, programs, subprograms, subroutines, device names, functions, operations, variables, filenames, and extensions.
© National Instruments Corporation vii NI 660x User Manual
About This Manual

Related Documentation

The following documents contain information that you may find helpful as you read this manual:
NI 660x Specifications—This document contains specifications for the NI 6601, NI 6602, and NI 6608 devices.
DAQ Getting Started guides—These guides describe how to install the NI-DAQ driver software and the DAQ device, and how to confirm that the device is operating properly.
NI-DAQmx Help—This help file contains information about using NI-DAQmx to program National Instruments devices. NI-DAQmx is the software you use to communicate with and control your DAQ device.
Measurement & Automation Explorer Help for NI-DAQmx—This help file contains information about configuring and testing DAQ devices, SCXI devices, SCC devices, and RTSI cables using Measurement & Automation Explorer (MAX) for NI-DAQmx, and information about special considerations for operating systems.
DAQ Assistant Help—This help file contains information about creating and configuring channels, tasks, and scales using the DAQ Assistant.
PXI Hardware Specification Revision 2.1—This document introduces the PXI architecture and describes the electrical, mechanical, and software requirements for PXI.
Note Yo u can download these documents at ni.com/manuals.
NI 660x User Manual viii ni.com
Introduction
This chapter describes the NI 660x devices, lists what you need to get started, and describes optional equipment. If you have not already installed the TIO device, refer to the DAQ Getting Started guides.

About NI 660x Devices

The NI 660x devices are timing and digital I/O devices for use with the PCI bus in PC-compatible computers, PXI chassis, or CompactPCI chassis. The NI 6601 offers four 32-bit counter channels and up to 32 lines of individually configurable, TTL/CMOS-compatible digital I/O. The NI 6602 offers this capability and four additional 32-bit counter channels. The NI 6608 is a functional superset of the NI 6602 device with a high-stability clock called an oven-controlled crystal oscillator (OCXO).
The counter/timer channels have many measurement and generation modes, such as event counting, time measurement, frequency measurement, encoder position measurement, pulse generation, and square-wave generation.
1
The NI 660x devices contain the National Instruments MITE PCI interface. The MITE offers bus-master operation, PCI burst transfers, and high-speed DMA controller(s) for continuous, scatter-gather DMA without requiring DMA resources from your computer. Refer to the Using PXI with CompactPCI section for more information about your NI PXI-660x device.
Device specifications are available in the NI 660x Specifications docu ment, which is available for download from
ni.com/manuals.

Using PXI with CompactPCI

Using PXI-compatible products with CompactPCI products is an important feature provided by PXI Hardware Specification Revision 2.1. If you use a PXI-compatible plug-in module in a CompactPCI chassis, you cannot use PXI-specific functions, but you can still use the basic plug-in device functions. For example, the RTSI bus on a PXI TIO Series device is available in a PXI chassis, but not in a CompactPCI chassis.
© National Instruments Corporation 1-1 NI 660x User Manual
Chapter 1 Introduction
Caution Damage can result if these lines are driven by the sub-bus. NI is not liable for any
damage resulting from improper signal connections.

Getting Started

The specification permits vendors to develop sub-buses that coexist with the basic PCI interface on the bus. Compatible operation is not guaranteed between devices with different sub-buses nor between devices with sub-buses and PXI. The standard implementation for CompactPCI does not include these sub-buses. The PXI TIO Series device works in any CompactPCI chassis adhering to the PICMG 2.0 R3.0 core specification.
PXI-specific features are implemented on the J2 connector of the bus. The PXI device is compatible with any chassis with a sub-bus that does not drive the lines used by that device. Even if the sub-bus is capable of driving these lines, the PXI device is still compatible as long as those pins on the sub-bus are disabled by default and never enabled.
Before installing your DAQ device, you must install the software you plan to use with the device.

Installing NI-DAQ Driver Software

If you are using NI-DAQ 7.1 or later, refer to the DAQ Getting Started guides, which you can download at Started guides offer NI-DAQ users step-by-step instructions for installing software and hardware, configuring channels and tasks, and getting started developing an application.
ni.com/manuals. The DAQ Getting

Installing Other Software

If you are using other software, refer to the installation instructions that accompany your software.

Installing the Hardware

The DAQ Getting Started guides contain non-software-specific information about how to install PCI, PXI, PCMCIA, and USB/IEEE 1394 devices, as well as accessories and cables.
NI 660x User Manual 1-2 ni.com

Accessories and Cables

Table 1-1 lists the accessories and cables available for use with NI 660x devices.
Accessory Description
SH68-68-D1 Shielded 68-conductor cable
R6868 cable 68-conductor flat ribbon cable
BNC-2121 BNC connector block with built-in test features
CA-1000 Configurable connector accessory
SCB-68 Shielded screw connector block
TB-2715 Front-mount terminal block for NI PXI-660x
TBX-68 DIN-rail connector block
CB-68LP Low-cost screw connector block
CB-68LPR Low-cost screw connector block
Chapter 1 Introduction

Table 1-1. Accessories and Cables

© National Instruments Corporation 1-3 NI 660x User Manual
Device Overview
This chapter provides information about NI 660x device functionality.

Digital I/O

The NI 660x devices have a 32-bit DIO port on PFI <0..31>. Digital I/O consists of asynchronous reads and writes to the digital port upon software command. You can individually configure each line for digital input or output. For output, you can individually configure PFI <8..31> for either counter-associated output or digital output. You must specify whether you are using the PFI line for counter I/O or digital I/O only if that line is being used as an output. For input, both counter I/O and digital I/O can share the lines on PFI <0..31>.
For more information about the signals that can be driven onto PFI lines, refer to the I/O Connector Pinout section of this document.
For information about how to implement specific digital I/O functions, refer to the application software documentation.
2

Prescaling

Prescaling allows the counter to count a signal that is faster than the maximum timebase of the counter. The counters on the NI 660x offer 8X and 2X prescaling on each counter (prescaling can be disabled). Each prescaler consists of a small, simple counter that counts to eight (or two) and rolls over. This counter is specifically designed for this application and can count signals that are faster than the general purpose counters. The CtrnSource signal on the general purpose counter will be the divided signal from the simple counter.
© National Instruments Corporation 2-1 NI 660x User Manual
Chapter 2 Device Overview
Figure 2-1 shows an example of prescaling.
External Signal
Prescaler Rollover
(Used as Source
by Counter)
Counter Value
Prescaling is intended for use with two counter period and frequency measurements where the measurement is made on a continuous, repetitive signal. The prescaling counter cannot be read, so you cannot determine how many edges have occurred since the previous roll-over. You can also use prescaling for counting edges if it is acceptable to have an error of up to seven when using 8X prescaling or one when using 2X prescaling.

Pad Synchronization

The NI 660x devices allow synchronization of their PFI lines and RTSI lines at the I/O pads. This is called pad synchronization in this document, and digital synchronization in the NI-DAQmx API. You cannot use digital filtering while enabling this feature.
01

Figure 2-1. Prescaling Example

Pad synchronization is useful when several counters are measuring or operating off the same external signal. For example, suppose counters 0 and 1 are configured for triggered pulse generation and each counter uses the same external trigger (this external signal is connected to PFI 38 on the I/O connector and both counters have PFI 38 selected as their GATE). After the trigger signal propagates through the I/O pad of the ASIC, the time for the signal to reach the GATE of each counter within the ASIC may differ by a few nanoseconds.
This signal is sampled at the counters’ GATEs using the selected SOURCE. Because of different propagation times for the paths to the two GATEs, it is possible for the counters to detect the trigger on different edges on SOURCE. Thus, one counter could see the trigger one SOURCE period after the other. If you want to allow the counters to see the changes in the signal at the same instance, you should use pad synchronization. During pad synchronization, the signal is offset by one clock cycle.
NI 660x User Manual 2-2 ni.com
Chapter 2 Device Overview
Counter
Source
PFI 38
at CTR 0 GATE
PFI 38
at CTR 1 GATE
Sampled
GATE at Ctr0
Sampled
GATE at Ctr1
1/2 Cycles
1/4 Cycle
PFI 38
at Input To ASIC
This feature is useful in applications with two or more counters that are armed by an external start trigger, or that use the same PFI line as a counter control signal. Pad synchronization is only useful if the counters involved are using one of the internal timebases. A counter is using maximum timebase as its source if the synchronous counting mode is enabled for that counter.
Figures 2-2 and 2-3 illustrate how pad synchronization can be useful. These figures assume a 0.5 and a 0.75 SOURCE cycle delay between the PFI 38 input pin, and CTR 0 GATE and CTR 1 GATE, respectively. Figure 2-2 shows counter 0 at the gate edge on PFI 38 one source period before counter 1. Figure 2-3 shows both counters at the gate edge on PFI 38 at the same time.

Figure 2-2. Counter 0 at Gate Edge on PFI 38 One Source Period before Counter 1

© National Instruments Corporation 2-3 NI 660x User Manual
Chapter 2 Device Overview
Counter
Source
PFI 38
at CTR 0 GATE
PFI 38
at CTR 1 GATE
Sampled
GATE at Ctr0
Sampled
GATE at Ctr1
1/2 Cycles
1/4 Cycle
PFI 38
at Input To ASIC
PFI 38
Synchronized at Pad

Figure 2-3. Counters 0 and 1 at Gate Edge on PFI 38 at the Same Time

Duplicate Count Prevention

NI 660x User Manual 2-4 ni.com
Duplicate count prevention (or synchronous counting mode) ensures that a counter returns correct data in applications that are a slow or non-periodic external source. Duplicate count prevention applies only to buffered counter applications such as measuring frequency or period.
For such buffered applications, the counter should store the number of times an external source pulses between rising edges on the Gate signal.
Chapter 2 Device Overview

Example Application That Works Correctly (No Duplicate Counting)

Figure 2-4 shows an external buffered signal as the period measurement Source.
Rising Edge of Gate
Counter detects rising edge of Gate on the next rising edge of Source.
Gate
Source
Counter Value
Buffer
67 12 1
7
2 7
Figure 2-4. Example Application That Works Correctly
On the first rising edge of the Gate, the current count of 7 is stored. On the next rising edge of the Gate, the counter stores a 2 because two Source pulses occurred after the previous rising edge of Gate.
The counter synchronizes or samples the Gate signal with the Source signal. So the counter does not detect a rising edge in the Gate until the next Source pulse. In this example, the counter stores the values in the buffer on the first rising Source edge after the rising edge of Gate.
© National Instruments Corporation 2-5 NI 660x User Manual
Chapter 2 Device Overview

Example Application That Works Incorrectly (Duplicate Counting)

In Figure 2-5, after the first rising edge of Gate, no Source pulses occur. So the counter does not write the correct data to the buffer.
No Source edge, so no value written to buffer.
Gate
Source
Counter Value
Buffer
67 1
Figure 2-5. Example Application That Works Incorrectly

Example Application That Prevents Duplicate Counting

With duplicate count prevention enabled, the counter synchronizes both the Source and Gate signals to the maximum onboard timebase. By synchronizing to the timebase, the counter detects edges on the Gate even if the Source does not pulse. This enables the correct current count to be stored in the buffer even if no Source edges occur between Gate signals. Figure 2-6 shows an example application that prevents duplicate counting.
Counter detects rising Gate edge.
Gate
Source
80 MHz Timebase
7
Counter value increments only one time for each Source pulse.
Counter Value
Buffer
670 1
7
0 7
Figure 2-6. Example Application That Prevents Duplicate Counting
NI 660x User Manual 2-6 ni.com
Even if the Source pulses are long, the counter increments only once for each source pulse.
Normally, the counter and Counter n Internal Output signals change synchronously to the Source signal. With duplicate count prevention, the counter value and Counter n Internal Output signals change synchronously to the maximum onboard timebase.
Notice that duplicate count prevention should only be used if the frequency of the Source signal is one-fourth of the maximum onboard timebase.

Enabling Duplicate Count Prevention in NI-DAQmx

You can enable duplicate count prevention in NI-DAQmx by setting the Enable Duplicate Count Prevention attribute/property. For specific information on finding the Enable Duplicate Count Prevention attribute/property, refer to the help file for the API you are using. Refer to the NI-DAQmx Help for more information.

When to Use Duplicate Count Prevention

Use duplicate count prevention for buffered measurements that use an external CtrnSource signal and the frequency of the signal is less than or equal to one-fourth of the maximum onboard timebase. Use this mode if you are using a low frequency or you expect zero CtrnSource edges between successive edges of the CtrnGate signal.
Chapter 2 Device Overview
Yo u should use duplicate count prevention if the following conditions are true:
•You are making a buffered counter input measurement.
•You are using an external signal (such as PFI x) as the counter Source.
The frequency of the external source is one-fourth of the maximum onboard timebase.
•You can have the counter value and outp with the maximum onboard timebase.
In all other cases, you should not enable duplicate count prevention.
ut to change synchronously

When Not to Use Duplicate Count Prevention

Use duplicate counter prevention only for buffered measurements with an external CtrnSource signal. Do not use it when the CtrnSource signal is greater than one-fourth of the maximum timebase.
© National Instruments Corporation 2-7 NI 660x User Manual
Loading...
+ 42 hidden pages