09-02-2013 05:44 PM
Hey folks, I'm wondering how to control this usb device using ANSI C. I want to be able to generate a voltage between 0-10 volts from the analog output which goes into the analog input to be read using ANSI C.
09-03-2013 03:29 PM
The DAQmx driver interfaces with NI's DAQ hardware and provides support for LabVIEW, .NET, and C. You can download the DAQmx driver, which includes the C API, at the following location:
http://joule.ni.com/nidu/cds/view/p/id/4240/lang/en
I recommend looking through the following documents to understand how to use the driver:
Using NI-DAQmx in Text Based Programming Environments
http://www.ni.com/white-paper/5409/en/
Getting Started with NI-DAQmx: Main Page
http://www.ni.com/white-paper/5434/en/
Also, NI offers an integrated C development environment, LabWindows/CVI. More information about this IDE can be found through the link below:
http://www.ni.com/lwcvi/
09-03-2013 08:47 PM
So how do I exactly use a C program to communicate with my NI device? Do I use LabWindows or are there other options?
09-03-2013 09:32 PM
09-03-2013 10:34 PM
Yes, I have some basic experience in C. So if I want to communicate with my USB device, I should use LabWindows?
09-03-2013 11:51 PM
Or Gnu, Borland, Microsoft, etc. You can also consider LabVIEW and you don't need to mess around with any text.
09-04-2013 04:06 PM
So I am trying to control it, but I have no clue on how to use LabWindows do control my USB device.
What I want to do is generate a voltage from the AO which is connected to an AI through a wire, this way both the analog output/input ports have the same voltage.
How do I exactly do tihs? Do I create a task and then create a AO voltage channel and also create a AI voltage channel, or do I just need to create a AO voltage channel since the AI and Ao are wired together?
09-04-2013 04:11 PM
You have to create both an analog in and analog out task.
Have you looked at the examples that come with LabWindows/CVI?
09-04-2013 05:07 PM
Yes I have.
So I would need to create 2 tasks. One DAQmxCreateTask function for the AO and another for the AI?
And then from there create voltage channels for both AI and AO? How can I exactly control the amount of voltage I want going through the ports? On the examples there's a variable called DAQmx_Val_Volts, where does this come from?
09-04-2013 05:25 PM