Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

help about c code for USB 6008

Hi,

    I have c code that worked well with PCI-DIO-32HS card in the past. Now I have a new NIDAQ: USB 6008 card. I want to modify the original c code to port to USB 6008. However, I encounter some problems:
1) PCI-DIO-32HS calls nidaq.h, nidaqex.h. But new USB 6008 only supports nidaqmx.h, right? So I changed the original code to include nidaqmx.h instead. However, I cannot find nidaqex.h after I installed all the dirvers and software for USB 6008. Without it, the code cannot work correctly. What does it use for? How can I fix it?

2) The other problem is that PCI NIDAQ has device code, e.g. my original  PCI-DIO-32HS is 211. Does USB NIDAQ also have? How can I find it?

I am buried in these problems for a couple of days.  Is it impossible to modify the original code to fit USB 6008? Anyone give me some recommendations? Thank you~

Kangmin
0 Kudos
Message 1 of 4
(3,769 Views)

Hi Kangmin,

It sounds like your original C code was programmed using the Traditional NI-DAQ driver.  Both the Traditional NI-DAQ and the DAQmx drivers support the PCI-DIO-32HS card.  The USB 6008, however, is only supported in the DAQmx driver.  Getting the program to work with the USB 6008 will require more work than just importing the nidaqmx library.   You will have to change all the driver function calls in your code from Tradional NI-DAQ to DAQmx.  The Developer Zone article, Transitioning from Traditional NI-DAQ (Legacy) to NI-DAQmx Using ANSI C and NI LabWindows™/CVI, contains a lot of information on what changes you need to make to your program. 

 As for the device codes, you can find them in the Traditional NI-DAQ Function Reference Help file (…Program Files\National Instruments\NI-DAQ\docs\nidaqpc.chm).  Search for Init_DA_Brds in the help file to get a list of device codes for specific devices.  Note that the USB-6008 does not have a device code because these codes only pertain to devices that are supported by the Traditional DAQ driver.   I hope this helps. 



Best Regards

Hani R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,748 Views)
Hi ,Hani

I will go to see that. Hope it works. Thank you~

Kangmin
0 Kudos
Message 3 of 4
(3,741 Views)

hai, could you please send me c-code to access usb-6008.(that may be to access analog or digital channels).i have gone through the c-code but i didn't understand it completely.i want to learn from your c-code.

    Thank you.

0 Kudos
Message 4 of 4
(3,723 Views)