Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

simple analog output using USB 6009

I don't know if I should start a different message but I intend to continue to build a stand alone application for a windows 10 computer, to control a power supply with an analog wave.  As you said Keven, this application outputs a wave with a period of 10 to 30 seconds so the frequency instability seems irrelevant.

Now I'm trying to build a project with my vi.  I'm using LV help to assist me, but it is slow going as I interpret the "how to" as it pertains to my project.

Any advice here or  tutorials showing how to build a project, so I can create a stand alone executable, would be great.  I'll attach my updated vi.  I'm open to suggestions.


Download All
0 Kudos
Message 11 of 19

@Kevin_Price wrote:

Re: timing stability

  ... 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. ...

-Kevin P

I carried the phase input over from an example.  I don't really know how to use it. As I understand phase, it is the relative position of one wave to another (in degrees).  it is used in the sub vi that generates the various wave forms.  I thought it was a value passed to the next iteration when continuous output was selected.

Can you show me an example?



0 Kudos
Message 12 of 19

I hope I'm not too eager with this simple project but it was good to get input from Keven as well as displaying my efforts and their results.  I know I have a lot to learn about LabVIEW  but this little project got my feet wet. I now have an executable, and an installation file.  The .exe runs on mine,  But will run on another?  The hardware may not be the best fit.  My 6009 cannot produce an offset greater than1 volt and the amplitude is fixed at 5.  I think a USB module with +/- 10 volts would do better.

Since I'm using LV 2014, so my executable file is probably a dinosaur but Ill attach the exe. I don't think the installer will go it's 500 MB.  If anyone can run this it would be good to know!😅


0 Kudos
Message 13 of 19

I'm afraid I steered you wrong b/c I wasn't as familiar with the waveform generation functions as I thought.  I was assuming you were using the point-by-point generation functions, but I didn't remember those correctly either.  I made a *very* simple example, here are some further notes:


1. I used the point-by-point generation square wave function that's designed for generating 1 point at a time


2. This function outputs a single scalar.  I created a waveform from it so that the chart's x-axis would track with actual time rather than with sample #.  This is important b/c the main thing I wanted to illustrate is that you can change the loop timing between points on the fly (simulating the timing variability under windows) and see that the square wave is pretty much unaffected.  This is the self-compensation effect I referred to before.


3. I found that 'phase' only referred to *initial* phase and that there was a separate 'time' input.   The 'time' input is the one to update with new values each iteration.


4. I tweaked a couple properties of the chart.  Notably, right-click the plot  in the legend and note the "Interpolation" style.  I sometimes use this "abrupt transition" style to display my data that's meant as a sampled output b/c it more closely resembles what the real-world signal is doing.


5. While running, try changing your loop timing with the "msec multiple" slider.  You'll see that the square wave pattern remains unchanged, and is not sensitive to variations in software timing.



-Kevin P

0 Kudos
Message 14 of 19

Hi Keven, I managed to generate an executable file with LV and I'm excited to try it at work where I have access to a programable power supply as well as a windows 10 computer so I can verify if it will run the .exe.

Unfortunately, Keven, I cannot open your example because your version is newer than mine (2014).  This brings me to a question I've been wanting to ask the community .  I have access to LV 2017 (through my employer), but all of their apps are written with 2014 so I simply stayed with it.  I know that one can save a .vi to a previous version.  I just saw on youtube, an example of the new graphic environment NXG and it looks kind of cool.  What does the community say about running the latest version, (in my case, 2017)?

One more question, I participated (a long while ago), in the on line LV CORE 1, 2, and 3.  3 was the theater lighting project which I thought was very cool.  Indeed I really liked the core exorcises but I think since it was paid for I should have access to it any time i want it.  Just IMHO

Finally, This opportunity to get assistance on the community is GREAT!

Gene (GLLV)

0 Kudos
Message 15 of 19

First, I saved my example back to LV 2014.


Second, I think you should start moving toward 2017.   Sooner or later, lack of support and compatibility will force your hand anyway, and LV 2014 is already officially not compatible with Win 10.  



-Kevin P

Message 16 of 19

Oops, I saved back to 2014, but didn't *attach* it.  Here you go.



-Kevin P

0 Kudos
Message 17 of 19

This is good to know!  We (Skyre Inc) started way back before win 10 and didn't work with it for a long while.

So I'm loading 2017 and dreading the outcome.  keeping everything crossed etc.


I was blissfully unaware that there were so many different(?) wave functions, it seems like a lot of variations on a theme.  Now I have even more to discover.


0 Kudos
Message 18 of 19

Thanks Keven for the sample I have questions.  But I'll hold off till I can do a little studying.  I like your offset using the Build Waveform.  But when I started looking at the time element my eyes glassed over and I became stupefied.

I can see there is a lot more to discover so Ill just keep on it.


0 Kudos
Message 19 of 19