Jump to content

continuous analog output?


Recommended Posts

I am looking for suggestions on what would be the simplest way of generating multiple (16) waveform outputs (~60Hz Sine, < 10V amplitude), for which I can change frequency and amplitude 'on the fly'. (without pausing the output to re-program it) NI has a lot of analog output boards, but I'm not sure how to tell if they can be controlled in this way. (all my LabVIEW experience until now has been serial IO and other communications type stuff)

I am guessing that one of the 'static' output cards will not be adequate. The rest of the cards claim 'waveform' output capability which I am fairly certain I will need. I think I need 16bit resolution, so this seems to limit me to the "NI PCI-6733 High-Speed Analog Output - 1 MS/s, 16-Bit, 8 Channels" card.

If I use this card, then I'll need at least two of them, and I am somewhat concerned that this will make it more difficult to accurately control the phase relationships between all the channels.

In the end I plan to amplify the outputs to 120VAC (using HV op amps and isolation transformers) so that I'll have a low current (<3mA) 3 phase power simulation. (since I need such low current the option of using multiple programmable 3 phase power supplies proves to be expensive overkill).

Related to this - I have NEVER written a LabVIEW program to do analog output. Is there anything I need to watch out for to make sure that changes to the output are glitch free? Is DAQmx the way to go?

So - to summarize. I am looking for hardware and software recommendations that will ensure I am able to maintain continuous (but 'adjustable') waveform outputs.


Link to comment

I've done analog output before (I'm currently doing it now), but I have never had to generate an adjusable output waveform, so I may not be able to help much.

As far as the software suggestions, DAQmx and tradidional DAQ are very similar except for the fact that DAQmx has everything sort of combined at a higher level. Some hardware may require you to use DAQmx, while others may be compatible with both Traditional and DAQmx.

Also, I looked through my Traditional and DAQmx DAQ functions and it appears that you can specify the actual waveform to write, not just tell it frequency and amplitude. There are also functions (in DAQmx I know for sure) where you can start a read/write buffer for faster reading and writing. If you use all of this together, and put your write function in a loop, you should be able to wite your waveform (adjustable via your own code) to the output buffer and so long as you're adding enough samples to keep the output buffer filled, theoretically you shouldn't have any glitches or hiccups.

I ran into my problem with DAQmx and my DIO inputs glitching and hiccuping, but that was because my DIO card is static and not buffered. So long as you have a buffered analog output card I think you should be okay.

Once again, like I said, I've never actually written an adjustable DAQ analog output waveform program before, but this is what I would look at if I were given the task.

As far as DAQmx or Traditional, if you're "forced" to use DAQmx like I was, there will be a learning curve in there since it's relatively new and there isn't a whole lot of in-depth information out there on it yet I've found. I'll try to help you out anyway I can based on what I've learned about it so far if you have any questions you want to ask me.

It's early in the morning here, so if any of the above doesn't make sense, feel free to harass me about it. At least I'll be prepared this time unlike when asked what I would do if a system was just plopped into my lap. Haha! ;)

Link to comment

I think you should be ok with changing the update rate and amplitude on one channel. I haven't done this but a quick search throughout the DAQmx examples in my LV70 shows a method for doing this. The problem may arise when you need to adjust this across multiple channels. I think the NI boards use a common clock source for AO generation and as such will limit you to adjusting the update rate on all channels at once.

Here is an old NI example for sinewave output.

Generating a Continuous Analog Output Waveform

I think you can find a similar one for DAQmx. If you need to change the actual output waveform then you can take a look at the function generator example in your LV. This will allow you to output different waveforms based on a selector. The trick here is that if you have update rate limitations then you can "fool" the AO by changing the actual output data and keep the rate the same.

Link to comment

I use two 6733 PCI cards. They are not yet supported by DAQmx so you must use Traditional DAQ. There is a promising example called "Continuous Generation.vi" that says:

Continuous Generation writes values to one or more analog output channels indefinitely, until the generation is cleared.  This is timed signal generation, meaning that a hardware clock is used to control the update rate for fast and accurate timing.  It is also buffered generation, meaning that the data is stored in an intermediate memory buffer before it is written to the analog output channels.

This VI writes new data into the memory buffer while the generation is in progress.  First, it fills the buffer with data, then starts the generation.  After that, it continues to write new data into one half of the buffer while the other half is being generated.


Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.