LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I output voltage using nidaqmx-base for linux

I have been trying to write a very simple program to output a square wave voltage. I have Labview 7.1 running on Red Hat and am using a PCI-6221 board. The output device is BNC 2110. I have attached the code that I have so far which produces the following error:

number of channels of task does not match number of channels in data. I tried using both a 1D array and a 2D array for my data wire leading to the Daqmx base write subvi but neither of these methods worked. Any advice?

Thanks
Maggie.
0 Kudos
Message 1 of 3
(2,781 Views)
Hello Maggie:

I think you should change your "DAQmxBase Write" polymorphic VI to single channel multiple sample.

I hope this helps.

0 Kudos
Message 2 of 3
(2,766 Views)
Maggie,

I think the main cause of the error is that you are starting the task before filling the output buffer. You'll need to perform a DAQmx Base Write before calling DAQmx Base Start. If you think about it, it does not make much sense to tell the card to start outputting data without telling it what to output. Please see the following example for one possible method of performing continuously variable output:

/usr/local/lv71/examples/daqmxbase/dynamic/ao/Cont Gen Voltage Wfm-Int Clk-On-Board Regeneration.vi

This VI writes data to said buffer, starts the generation, then waits until the user presses the stop button. If you want to disable regeneration, try

Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi

This VI allows you to continuously write data to the buffer.

Finally, did you know that DAQmx is now available for Linux? This is the same driver we use on Windows and it supports more of the features of your hardware. You can download it here:

http://digital.ni.com/softlib.nsf/websearch/453DFA704F18861C862570CB00637ADD

If you decide to switch to DAQmx, the same examples are located in:

/usr/local/natinst/LabVIEW-8.0/examples/DAQmx/Analog Out/Generate Voltage.llb

You can also find them in the example finder.

Hope this helps,



Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 3 of 3
(2,757 Views)