Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

simple analog output using USB 6009

I want to generate a triangle wave to control a programable power supply.  I want a triangle waveform of various frequency and amplitude such as, 1 cycle every minute to 1 cycle every 20 minutes. I want to set a time for repeating the cycles continuously for hours.  ex. 1 cycle every 15 minuities for 6 hours.

The Triangle Waveform .vi looks like it is exactly what.  It has offset frequency and amplitude.  Similarly, the DAQ assistant will control my 6009.

My request is how do I put these together to make a functioning control for a power supply?  I don't want someone to code this vi I want to learn how to.  I have LabView 2014 sp1 and DAQmx 17.6 Thanks to the community forum multifunctional DAQ.

Can someone help me with a general outline or plan?

I am  returning to LabView after several years, I can use labView and I'm sure that I can do this but I need a point or two in the right direction.

btw if this post belongs in a different place please let me know.

GeneL

0 Kudos
Message 1 of 19
(1,454 Views)

There are a lot of shipping examples ("Help menu -> Find Examples -> Hardware...") that can help get you started.  Study them, read the context help for the DAQmx functions, and *especially* be sure to follow the "detailed help" links.

 

Save a new copy under a modified name in a folder of your own, then experiment with making little modifications one at a time.

 

There's a widely recommended article named, "Learn 10 Functions in DAQmx..." that's worth some serious attention.   (Looks like this has been supplemented with a video narration of, presumably, the same material.

 

Very generally, with your expressed desire to learn, I would highly recommend that you use regular DAQmx functions rather than rely on the DAQ Assistant by the time you are completing your app.  If you want to start with the Assistant, fine, but plan to outgrow it as soon as you can.  Kinda like training wheels, which help only until you know what you're doing, after that they really get in the way.

 

There's a lot more info scattered about the site here, though sometimes it can be tough to narrow the results down to exactly what you need.

 

When you get stuck or confused, you can ask questions here.  Be sure to take time to describe what you're doing clearly and post relevant code and data.  Basically, help us (be able to) help you.

 

 

-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 2 of 19
(1,423 Views)

chapter 3 in my ongoing saga.  Thanks Kevin, your suggestion is spot on.  Reviewing the  article "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications" This info

rang a lot of bells.  Unfortunately I have discovered 1 or 2 new facts.  1 - my 6009 can't read TCs or 2  I still have problems with MAX 17.6.  I can read a battery, but not TCs in any ai port!

My question now is, what is the best way to remove and reload NI software?  NI package manager?  Is there a different way, short of reformatting my entire drive? I would almost rather buy a new computer!

 

Gene

 

0 Kudos
Message 3 of 19
(1,375 Views)

The USB-6009 probably isn't well suited for raw, unconditioned thermocouple connections and measurements.  But that's not the same thing as "totally incapable."  You should be able to get *something* even if you then deem it "not good enough."

 

I found this article that seems like a pretty good starting point.  For now, I don't know of any reason to think you need to uninstall / reinstall DAQmx.

 

 

-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 4 of 19
(1,372 Views)

Once again Kevin you hit the nail on the head  While I didn't find anything that specifically said don't use a 6009 for TCs I find that the analog in channels read o to 5 volts just fine so Thanks again!

Gene

0 Kudos
Message 5 of 19
(1,364 Views)

Hi All,

I have been looking at many DAQmx examples trying to get back into LV.  This analog out task is a good one for me to try.  As I explained previously I need to output a triangle wave that will be used to control the output of a programmable power supply.  It seems that the triangle waveform .vi with offset, frequency and amplitude is exactly what I’m looking for.  That said I am not having much luck implementing it.  I’ve started with a continuous output.vi example and incorporated the triangle vi, but I get is an error.

 

I understand that I am trying to write too much data but I don’t know how to separate it out to make the loop function smoothly.

Can someone help me resolve this issue?  At this point I will be happy to see this output a waveform so I can further evaluate the function and make it run for a variable time period.  To reiterate, I very much intend to learn (as opposed to just copy), but I am stuck here.  btw - the search NI for error, returns no result!

0 Kudos
Message 6 of 19
(1,314 Views)

What the error's telling you is that (at least) one of your voltage values exceeds the output range you configured when setting up the task.  Now granted, it exceeds the upper limit by only a fraction of a millivolt, but I guess DAQmx wants you to know about it anyway.

 

An easy fix would be to use the "In Range and Coerce" function on your data array.  Set the lower and upper limits the same as the task.  That function will trim away the trivial amount your sample data exceeded 5.000000 volts.

 

 

-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).
0 Kudos
Message 7 of 19
(1,307 Views)

Hi all, I have a .vi and a .docx attached, that shows the block diagram and a picture of the slow triangle wave form that I've been trying to develop.  This is essentially 3 or 4 examples combined to make a usable vi for my power supply control.  It isn't exactly what I wanted but it will do.

Keven you said:


 


@Kevin_Price wrote:

 

 

... "An easy fix would be to use the "In Range and Coerce" function on your data array.  Set the lower and upper limits the same as the task.  That function will trim away the trivial amount your sample data exceeded 5.000000 volts.

 

 

-Kevin P


I definitely want to know how to do that! 🙄

I now wish to make an executable file so I can run it on a laptop.  I know I need  the LabVIEW Runtime on said laptop but which one do I use? 

Thanks for all your help Keven!

Gene

 


 

Download All
0 Kudos
Message 8 of 19
(1,285 Views)

just a note about the stability of the frequency.  I increased the frequency to 10 Hz and viewed the waveform on the scope.  It is not very stable.  Moreover, the offset remains when I stop the program. so I'm going to have to figure out how to set the 6009 output to 0 when the program stops

Gene

0 Kudos
Message 9 of 19
(1,279 Views)

Re: timing stability

   It's well-known around here that software-based timing schemes under Windows can not be counted on for regular timing.  But it ought to work out ok for your real app where you have a minute per cycle or more.

   I recommend you step back for a moment and feed your calculated value to a waveform chart instead of real hardware -- it's just easier to experiment that way.  Next, when generating your triangle wave 1 pt at a time, you should be calculating the 'phase' input based on your total elapsed time (and the waveform frequency and the initial phase.)  Using total elapsed time this way will help your waveform self-correct the little timing anomalies Windows will send your way.

 

Re: voltage offset holds last value

   Many DAQ device AO's do this.  In some apps (like motion control) it's important to ramp toward 0 smoothly.  But in your case with a power supply, I suspect it'll be ok to simply jump straight to 0.  All it takes is one more call to DAQmx Write after your loop and before you stop the task.

 

 

-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).
0 Kudos
Message 10 of 19
(1,252 Views)