Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How to input voltage from NI-DAQmx PCI-6071e using Visual C++?

Solved!
Go to solution
Hello, I'm an undergraduate freshman doing a team project for school and I'm completely stuck. The on-campus lab has allowed us to use their NI-DAQmx PCI-6071e card, and the school provides Visual Studio 2008 for free. We're trying to input voltage levels from the card in Visual C++, but we have no idea what code to use. Additionally, we can't afford to buy Measurement Studio Professional (or Standard, for that matter). Can someone please explain how to read the voltage levels? Example code would be highly appreciated.
0 Kudos
Message 1 of 6
(5,289 Views)
Solution
Accepted by topic author rbwilli
There is a sequence of function calls that need to be made to create a task.  This document goes over the steps necessary to include in a task.  When you install the DAQmx driver, examples are also installed and can be found as described here.  There will need to be a few changes made to the ANSI C examples to use in Visual C++ that are described here.  Hopefully this helps!
Regards,


h_baker
National Instruments
Applications Engineer
Message 2 of 6
(5,263 Views)

Hello,

 

Is it possible that your school might have an academic site license for LabVIEW, or other NI software?  What school do you go to?

 

Regards,

Vineet

0 Kudos
Message 3 of 6
(5,218 Views)

Thanks, h_baker; that did it! A few things for the record:

 

  • We thought we were supposed to read the voltage levels digitally, but apparently they were analog. So using the ANSI C example for analog voltage input (we used continuous acquire, internal clock) was just what we needed.
  • The document you referenced explaining how to run ANSI C examples in Visual Studio here worked, but required some flexible interpretation for use with Visual Studio 2008 and NI-DAQmx drivers. If anyone is having trouble getting it to work in this situation, just let me know and I'll explain what we did.

 

It's so nice to see the data finally...thanks again! 🙂 

0 Kudos
Message 4 of 6
(5,202 Views)

Vineet,

 

We do indeed have LabVIEW, but for this project we're trying to write a program specifically for C/C++. (We go to Drexel University, by the way.) Anyway, h_baker's response seems to have cleared things up for us for now. Have a good one!

0 Kudos
Message 5 of 6
(5,200 Views)

Hello,

 

Oh, I seeI'm glad you got it working in C++ thenIt's always nice to see that data for the first time. 🙂

 

 

Regards,

Vineet

0 Kudos
Message 6 of 6
(5,170 Views)