LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Independent control of 2 Analog Out signals

Solved!
Go to solution

Hi All,

 

LabVIEW 2015 SP1 (needs to run on Windows XP, Windows 7, Windows 10).

Windows (various)

USB-6212

 

I need to be able to control the 2 Analog Out channels on the DAQ independently.

I searched through the previous posts on this forum for an answer, and there is a workaround (generate 2 different waveforms, over the same period, and drive them both at the same time, aka not independently).

 

What I noticed is that LabVIEW users have been asking for independent control of the 2 analog outputs since at least 2001.

The solution, above, is a moderately useful work-around.

 

My question, is NI working on a real solution?

It's been at least 18 years that users have been asking for a solution...

 

Thoughts?

 

Thanks,

Jeff

 

0 Kudos
Message 1 of 15
(3,094 Views)

Why is the current solution not the "real" solution?

 

When you want to change one waveform and not the other, you just build your data so that it continues with the original parameters of the one signal, and uses the new parameters of the second signal built into an array that you write to the analog DAQmx Write function.

0 Kudos
Message 2 of 15
(3,054 Views)
Solution
Accepted by topic author DMJeff

You hardware has a multiplexed DAC, so the channels are not independent. You could easily use two AO cards to achieve what you're asking for if you don't want to simply write your program to independently change the data going to the write. I prefer to have all of my AO in one place anyway (easier to track down bugs) so the "workaround" is a non-issue for me.

Message 3 of 15
(3,038 Views)

@DMJeff wrote:

My question, is NI working on a real solution?


I can't speak to what NI is working on, but you're definitely not going to see it in the M or X Series lines since those boards all use the STC 2 and 3 architectures, which only have a single AO timing engine.  (The USB M Series boards actually use some other cheaper timing chip I think if I recall correctly...)  There would be no way to retroactively add timing engines to them, so your only hope would be for a new DAQ board to be released with the feature.

 

That said, if you're willing to spend a lot more, NI has released a few boards that support multiple asynchronous AO tasks.  The PXIe-4463 DSA card (which uses NI-DAQmx) and the PXIe-54x3 arbitrary waveform generators (which use the NI-FGEN driver) are the ones I'm aware of, though there may be more released since I last looked into it.

Message 4 of 15
(3,030 Views)

The same holds true for AI on most DAQ boards -- only 1 timing engine available to the AI subsystem.  You can't sample some channels at one rate and others at another rate.

 

Since AI usage is probably quite a bit higher than AO for NI's user base, the fact that AI still has the same limitation suggests to me that, no, they probably aren't working on making such support a general feature of their multi-function boards.

 

I expect it'll continue to be true that if you want to run 2 independent hw-clocked AO signals, you'll need 2 distinct devices.

 

That said, you may also want to consider exploring the cDAQ platform as alternate path forward.  You'd still need 2 distinct AO modules to get independent hw-clocked AO signals, but you'd also be able to sync them together (via their shared chassis) in other situations where *that's* called for.  That's more of a hassle with 2 USB multi-function devices.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 5 of 15
(3,014 Views)

@croohcifer wrote:

That said, if you're willing to spend a lot more, NI has released a few boards that support multiple asynchronous AO tasks.  The PXIe-4463 DSA card (which uses NI-DAQmx) and the PXIe-54x3 arbitrary waveform generators (which use the NI-FGEN driver) are the ones I'm aware of, though there may be more released since I last looked into it.


cDAQ would be another option.  Many of those chassis will allow for multiple AO tasks.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 15
(3,013 Views)

Hi RavensFan,

 

Good question.

 

I have an application that drives a motor, and collects data.  All working well.

The priority is to drive the motor, and the data collection can lead to calculations, hard drive writes, and other assorted stuff that may cause delays (probably more likely in the past, but still a concern), but the motor has to keep running.

So, I calculate an AO waveform, download it to the DAQ to repeat endlessly, and move on to do more stuff on the computer.

If the computer gets delayed for any reason, the DAQ carries on happily driving the motor, which is what I need.

 

Now, when I want to change what the motor is doing, I have to tell the DAQ to stop, then send a new waveform to the DAQ, and tell it to start repeating again.  And that works great.

 

With the addition of a second motor, at either the same setting or a different setting, I can download waveforms for each motor (padded to have a consistent frequency).  But, if I want to stop just one motor, I calculate that waveform as a bunch of 0's, but I have to stop both motors in order to download the new waveforms (drive AO0 at frequency, and drive AO1 at zero, for example).

 

I'd like to just say, stop AO1 (or AO0), and then start it again when ready.

 

Reading other posts, it seems that with the DAQ I have, it is more of an electronics limitation with just a single AO timer on the DAQ.

Since I have a number of identical installed motor drive stations, I'll have to deal with this stop and go thing.

 

Thanks for the thoughtful reply,

Jeff

0 Kudos
Message 7 of 15
(2,984 Views)

Hi Johntrich,

 

More detail about what I'm doing in another reply.

 

Thanks for the explanation about the DAQ output limitation.

I'll consider the dual DAQ solution, but I'll likely update a version of the LabVIEW VI to do the parallel outputs and deal with the short-term stops on the motor I would rather keep running.

 

Thanks,

Jeff

 

0 Kudos
Message 8 of 15
(2,982 Views)

@DMJeff wrote:

I have an application that drives a motor, and collects data.  All working well.

The priority is to drive the motor, and the data collection can lead to calculations, hard drive writes, and other assorted stuff that may cause delays (probably more likely in the past, but still a concern), but the motor has to keep running.

So, I calculate an AO waveform, download it to the DAQ to repeat endlessly, and move on to do more stuff on the computer.

If the computer gets delayed for any reason, the DAQ carries on happily driving the motor, which is what I need.


This is sounding like something that should be handled by a cRIO.  Then you could put your motor controls in an FPGA and just give it updates as needed.  Each output could be completely independent.  This will also avoid issues with Windows hanging up since you will be running on an RT OS and/or FPGA.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 15
(2,920 Views)

@crossrulz wrote:

 

cDAQ would be another option.  Many of those chassis will allow for multiple AO tasks.

Which cDAQ chassis are you referencing?  I've never come across one that had multiple AO timing engines...  Maybe the new cRIOs with DAQmx support more than one HW-timed AO task, but I don't think any cDAQs do.

0 Kudos
Message 10 of 15
(2,909 Views)