Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling usb x series 6353 with ANSI C?

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.

0 Kudos
Message 1 of 13
(3,541 Views)

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/

Cameron
0 Kudos
Message 2 of 13
(3,519 Views)

So how do I exactly use a C program to communicate with my NI device? Do I use LabWindows or are there other options?

0 Kudos
Message 3 of 13
(3,512 Views)
From your initial question, it sounded like you already had C experience.

LabWindows/CVI is a C IDE that takes out some of pain of doing text programming but it certainly is not the only option. There's a rumor that a company called microsoft has a C compiler that is kind of popular.
0 Kudos
Message 4 of 13
(3,509 Views)

Yes, I have some basic experience in C. So if I want to communicate with my USB device, I should use LabWindows?

0 Kudos
Message 5 of 13
(3,506 Views)

Or Gnu, Borland, Microsoft, etc. You can also consider LabVIEW and you don't need to mess around with any text.Smiley Wink

0 Kudos
Message 6 of 13
(3,503 Views)

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?

0 Kudos
Message 7 of 13
(3,482 Views)

You have to create both an analog in and analog out task.

 

Have you looked at the examples that come with LabWindows/CVI?

0 Kudos
Message 8 of 13
(3,480 Views)

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?

0 Kudos
Message 9 of 13
(3,476 Views)
I don't have CVI right now and you don't specify which one. Does the project have a uir file where you set the value from a gui?
0 Kudos
Message 10 of 13
(3,472 Views)