LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate an analog bipolar pulse

So I decided I was going to use my AI to track my output and thus only my outputs need to be synched with each other, and only my inputs need to be synched with each other.  I thought this was a good plan, but copy and pasting code didn't allow me to have multichannel input/output.  Instead, DAQmx Write complains that it's reserved.  I've saved my code down to 8 this time (sorry about the last).  If you have any advice on multichannel input/output that would be great.

Thanks,
Kat

 

Download All
0 Kudos
Message 11 of 14
(727 Views)

KMiu,

You can definitely setup multiple analog outputs and multiple analog inputs for your card, but all the channels that you want to use will need to be grouped into either the same analog input or output task.  The reason for this is that all of the inputs are multiplexed to the same analog to digital converter and all the outputs are multiplexed from the same digital to analog converter.

When you create a task for multiple channels, the multiplexer actually switches between the various channels in a specified order.  Having separate tasks would not only make enforcing this switch order impossible, but would require windows to call into the same resource more than once, which Windows cannot do.

You can easily modify a written task to work for multiple channels with a few minor adjustments.  You can either add 'Create Channel' VIs to the existing task for new physical channels, or you can change the specified physical channel from say 'Dev0/ai0' to 'Dev0/ai0:5'   This syntax will actually read six channels (0,1,2,3,4, and 5).

Give this a go and see if it works.

Elijah Kerry
NI Director, Software Community
0 Kudos
Message 12 of 14
(714 Views)

Thanks Elijah,

What I want to do though is output different waveforms.  Do I need to build an array of tasks and feed it to the sample clock?  I'm slightly confused.

I'm also using 2 PCI 6221 cards for a total of 4 outputs.  This seems to have something close to what I want, thought the output functions are all the same

http://zone.ni.com/devzone/cda/epd/p/id/5197

But when I run it I get this error: -89125 at DAQmx Write.  No registered trigger lines could be found between the deices in route.

I'm too inexperienced with LABview to understand the logical steps of setting this up.

0 Kudos
Message 13 of 14
(707 Views)
KMiu,

You'll need two tasks, one for all the analog outputs on each card. 

If you're new to LabVIEW there are numerous resources that will help you get started.  I recommend checking out the examples that ship with LabVIEW.  You can find them in the Example Finder (Help >> Find Examples).

Drill down to Hardware Input and Output >> DAQmx >> Analog Generation >> Voltage.  I recommend checking out 'Cont Gen Voltage Wfm-Int Clk.vi.'  This example demonstrates how to output a continuous periodic waveform using an internal sample clock.

Let me know if you have any questions or problems with this example.

Elijah Kerry
NI Director, Software Community
0 Kudos
Message 14 of 14
(684 Views)