10-22-2008 05:44 AM
i have one ni6733 card. i want to output a waveform of particular frequency. After few cycles frequency of waveform has to be changed repeatedly without any delay. Frequency range varies from 0.1 Hz to 10 Hz.
i am new to NI6733 card, so don't have much idea about it. I am planning to use double-buffered scheme for waveform generation. Timing is critical here.
Please give function sequence(if possible).
Solved! Go to Solution.
10-28-2008 06:37 AM
Hi Rj7,
I would suggest looking at the DAQmx examples in the example finder in LabVIEW as these will give you a good start on how to develop your code ( Help->Find Example). In terms of developing what you want to do, I have attached an example code that will generate a Sine wave at a particular frequency. You would need to build your waveform as shown in the attached image in order to output the varying frequencies. The image shows two cycles of a sine wave being generated and put together but one after another.
Please let me know how you get on.
Thanks,
10-28-2008 06:46 AM
Hi Sorry, That VI doesn't work. Use this one.
10-29-2008 06:15 AM
thanx for your valuable feedback.
but, sorry, i forgot to mention that i am doing programming in Visual C++.
i m not using LabView.
also i need to generate Ramp signals along with different sine waves one after another.
Please help...
10-29-2008 07:50 AM
Hi rj7,
Here is a link to some of the online help that details how to develop DAQmx applications in C/C++. As far as generating the Sine waves, I would have thought that you could generate an array of values to the AO output. In order to generate the varying frequency sine waves, I think the only real way to do this is unfortunately, quite complicated.
You would need a sine function that generates a single sine wave at the rate you specify. So for example if you want a 1Hz wave at 1000 Hz rate. I would suggest generating a sinewave cycle with a thousand data points. If you want a 2Hz wave, generate 500 data points with the same sine function. Again, you only want to produce one cycle so that the frequency will increase but not shift the phase. After this has been done, string all the waves (in Arrays) together and output them from the AO.
I know that is pretty complicated but I don't know of a function in C that will generate waveforms of varying frequency that can be outputted to the DAQmx.
Please let me know if you require any further help,
10-31-2008 03:29 AM
Hi Andrew,
thanx for your quick and prompt response.
I tried to modify buffer contents, what u told, in double-buffering waveform generation mode and I m able to generate Ramp signal with varying amplitude and frequency. Is there any minimum and maximum limit on buffer size when using double-buffering???
I am still working for sine wave also but its time-taking.
If you have some other way to generate sine wave then please tell me.
Also sine wave generated using NIDAQMakeBuffer function is unipolar. how can I make it bipolar??
waiting for ur reply....
thanx again.
11-04-2008 09:03 AM
Hi rj7,
As far as I am aware there is no limit on buffer size, though I would have thought that if you make it enormous, your code may start to slow down your pc. Again this is unlikely to occur unless you are buffering literally millions of datapoints.
I shall look at the NIDAQMakeBuffer function.
Thanks,
11-12-2008 04:46 AM