Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

PXI 6341 - DAQ-DIO read/write examples in NIMHDDK (Measurement Hardware Driver Development Kit


i am developing PXI 6341 DAQ DIO Read/Write functions.

i like to support similar ones in DAQmx interfaces:




i am looking into 



Digital Input
dioex1.cpp—Single-point on-demand digital input and output on ports 0, 1, and 2
dioex2.cpp—Finite hardware-timed digital input                                                                       <<<<<<<<<<<<<<<<<<<<
dioex3.cpp—Finite hardware-timed digital input with change detection
dioex4.cpp—C ontinuous hardware-timed digital input with optimized DMA
Digital Output
dioex5.cpp—C ontinuous hardware-timed digital output with regeneration                               <<<<<<<<<<<<<<<<<<<<<
dioex6.cpp—C ontinuous hardware-timed digital output with the Watchdog Timer


We have  three exmaples for Digital Inout and two for Output as above.


i am thinking of using

(1) DIO_Write - dioex5.cpp
(2) DIO_Read – dioex2.cpp 0r dioex4.cpp


Can anyone confirm or give some comments?



0 Kudos
Message 1 of 6

What operating system are you using? From what you described, if you are unable to use the DAQmx driver, it looks like you are going in the right direction with those particular C++ examples in the NI-MHDDK. Have you tried implementing any of the functions already? Let us know if you run into difficulty.

National Instruments
0 Kudos
Message 2 of 6

OS - Linux - Fedora 15.


i think i was looking at wrong examples - again i am tring to accomplish setBits and resetBits of NI 6341 24 DIO lines.


i believe the correct example i should be using is




Appreciate if this can be confirmed.


i am in the middle of impelementing - dio fuctions: setBits(), resetBits(), ReadPort().


thank you,

su jung,


0 Kudos
Message 3 of 6

On X Series devices, dioex1.cpp performs Single-point on-demand digital input and output on ports 0, 1, and 2. If this is what you are looking to do, this is the correct example. I have included the Readme for the NI-MHDDK below for your reference.


Any other information you can give me about your system would help us determine if this is the correct example you should be using. 

National Instruments
0 Kudos
Message 4 of 6



i find below in the example dioex1.


Would you expaline what does the setTristate true mean?  i noticed that it resets upon exit.


when do you set true or set false?


   // Create subsystem helpers
   tBoolean tristateOnExit = kTrue;
   nNISTC3::dioHelper dioHelper(device.DI, device.DO, status);
   dioHelper.setTristate(tristateOnExit, status);


      if (_tristate || _exampleStatus.isFatal())
         nMDBG::tStatus2 status;
         reset(NULL, 0, status);  <<<<

0 Kudos
Message 5 of 6



I've included a link to a community webpage for the Driver Development Kit. This forum has active members who work with this software. I would recommend posting here!



National Instruments
0 Kudos
Message 6 of 6