Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Change Detection Considerations When Using DMA

Primary Software: Driver Software>>NI-DAQmx
Primary Software Version: 8.0
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: Digital I/O (DIO)>>High-Speed>>PCI-6534

Problem:
I am running the NI-DAQmx example for change detection on a device with a digital port of 8 bits.  In some cases I only get an update after my generating device's digital lines have changed state 4 times, and in other cases I receive the NI-DAQmx error -200284.  The lines to be detected are changing, so why are the changes not being detected?

Solution:
This is caused because the application is configured with direct memory access (DMA) enabled.  DMA transfers from PCI data acquisition devices to the DAQmx memory space only take place when 32 bits of data have accumulated. This means that if the change detection task takes in a single (8-bit) port and detects in either port format or line format, the data acquired upon that change will not show up in LabVIEW until 32 total changes have been detected.

Either 32 changes have to be detected before the DMA transfer will take place, OR interrupts must be used instead of DMA.  The default setting is for the device to use DMA, but you can specify in your code to use interrupts.  For information about how to do this, please refer to KnowledgeBase 34FGAFVM linked below.

If you want to use DMA to transfer data, but the detected changes are somewhat infrequent, set the timeout of the DAQmx Read to be longer than you anticipate 32 change detections to occur.

Related Links:
KnowledgeBase [3KP9R6BH]:  Which NI DIO Devices Support Change Detection?
KnowledgeBase [3EHDN4QT]:  What Is Change Detection and How Does It Work On The 653x DIO Boards?
KnowledgeBase [2YMAJ2B9]:  The Difference Between Change Detection or Change Notification in Traditional NI-DAQ and NI-DAQmx
KnowledgeBase [34FGAFVM]:  How do I Configure the Data Transfer Mechanism (Interrupt or DMA) in DAQmx and Traditional DAQ?

Attachments:





Report Date: 12/21/2005
Last Updated: 08/02/2007
Document ID: 3SKA1UX1

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit