LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generate a sine wave using USB-6008

Hello:

 

I'm using a NI USB-6008, and I'm trying to generate a 0-2V, amplitude = 1, offset= 1, frequency range: 0-150Hz sine wave. I checked the datasheet it shows that this write box can generate this kind of signal. If I use DAQ Assist, there will be an error because this white box cannot generate a minus voltage. I found the way in the accessory to solve the problem but I don't understand where I can change the amplitude and the frequency range is also very small (using oscilloscope). Actually I cannot understand the meaning of each block well. Could you please have a look at this file and help me to generate this kind of signal? Thanks a lot.

 

Kind Regards

 

Jeff

0 Kudos
Message 1 of 11
(8,157 Views)

Check out my post here

 

there is a property node to use.

Tim L.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 2 of 11
(8,151 Views)

Dear Sir:

 

Thanks for your kind reply. I think it can work well but the whole block diagram looks so complicated. Could you please send me a file to have a look? I'm a new learner of Labview so I cannot understand every block well. For example: I cannot find the DAQmax-Channel block.

 

What I need is only to generate a small signal using USB-6008. If I can do this, I do not need to buy another device to do so. Could you please have a look at my attached file and tell me how to change the frequency range and amplitude? Actually I have found the way to change the offset.

 

Many thanks

 

Jeff

0 Kudos
Message 3 of 11
(8,140 Views)

The example you copied will already do what you want.  The one called Cont Gen Voltage Wfm-Int Clk-Variable Rate.vi will allow you to change the frequency on the fly.

 

If you don't understand these blocks, look for tutorials like this.  These VIs are actually VERY simple, (not complicated,) you just need to learn the basics and then you will understand the code.  DAQmx requires a bit of a learning curve.  Study the tutorials, then try writing some of your own code to practice and you will get it.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 11
(8,127 Views)

Dear Sir:

 

Thanks for your suggestion and now I have generated that signal yet. The only problem of the waveform output is there seems not enough samples so if the frequency is higher, the waveform is not very smooth. Could you please check my file and tell me the solution. Cheers.

 

Kind Regards

 

Jeff

0 Kudos
Message 5 of 11
(8,102 Views)

Sure, the solution is to add a DAQmx Timing.vi after you create the task but before you start it.  This VI will allow you to affect the DAQ timing by changing the number of samples and the sample rate.  Frequency will equal #SAMPS / RATE.  Look again at the example I mentioned above and you will see the timing VI in use.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 6 of 11
(8,090 Views)

Another hint for DAQ beginners.  Use the DAQ Assistant and set all your parameters with the wizard.  Then, right-click the DAQ Assistant block and select 'Open Front Panel'.  The Assistant will change into its underlying DAQmx code that you can learn from and modify...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 7 of 11
(8,088 Views)

Dear Sir:

 

Thanks very much sir. I have solved this problem. I used a simulate signal to put the parameter of amplitude, frequency and offset in.  But the another question is that there are not enough samples shown in the oscilloscope.  What I want is using USB-6008 to generate a pure sine wave and the bandwidth is 0-150Hz. If the frequency is below 50Hz, the waveform seems pure but if the frequency is high, harmonics will happen. Could you tell me how to solve this problem using Labview? Or it's only the limitaion of that white box?

 

Kind Regard

 

Jeff

0 Kudos
Message 8 of 11
(8,083 Views)

Adding a DAQmx timing function will just create an error with the 6008. The analog output is strictly software timed. As you can see from the spec, the max update rate is only 150S/s. Trying to generate a 150Hz sine wave is totally unrealistic. You must have read the wrong datasheet.

0 Kudos
Message 9 of 11
(8,081 Views)

Dear Sir:

 

Thanks very much for your explaination. Now I use another more powerful white box instead.

 

Kind Regards

0 Kudos
Message 10 of 11
(8,069 Views)