07-27-2011 06:42 AM
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
07-27-2011 08:02 AM
there is a property node to use.
Tim L.
07-27-2011 08:19 AM
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
07-27-2011 08:55 AM
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.
07-28-2011 03:53 AM
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
07-28-2011 08:42 AM
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.
07-28-2011 08:47 AM
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...
07-28-2011 09:49 AM
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
07-28-2011 09:53 AM
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.
07-28-2011 02:13 PM
Dear Sir:
Thanks very much for your explaination. Now I use another more powerful white box instead.
Kind Regards