LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx: how to generate two different signals using a single block

Solved!
Go to solution

Hello, 
I'm very new to NI DAQ and based on the examples given by NI, I was able to read and write analog signals as I wanted.

However, the examples were only for a single channel, and I was having problems using multiple channels.

Multiple signals block.png

 

Currently, what I want to do is use a physical module that has multiple channels and have them each generate different current signals.

As you can see in the block diagram, I've used 2D DBL N Channels, N samples to generate signals.

Now, (I'm using two channels) I want one channel to send signal to my actuator valve and one connected to my read block that's directly below my write block.

The problem is that I'm not familiar with using the 2D "control block" for multiple channels.

 

Multiple signals.png

 

So basically the part that I've indicated in red.

I simply assumed that the left column of the was the value for the channel number and the right column is the current signal value.

However, it seems that this is a time step as it keeps on creating a very frequently changing from one value to another.

 

What I want was e.g., 0.02A going to the control valve, and 0.01A going to my waveform chart (read by my voltage read module connected to 100 ohm resistance).

Is there a proper way to set my control block (either a correct way of inputting the values or changing the block) for achieving this?

 

Thank you.

 

0 Kudos
Message 1 of 2
(1,011 Views)
Solution
Accepted by gathanokos

From DAQmx help, 

data contains a 2D array of samples to write to the task. Each row corresponds to a channel in the task. Each column corresponds to a sample to write to each channel. The order of the channels in the array corresponds to the order in which you add the channels to the task.

 

You can use a for loop with indexed output to specify different values for separate channels, as shown in Multiple Channel Analog Output with Dynamically Updated Waveform Attributes

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 2
(999 Views)