From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-04-2006 06:24 AM
01-05-2006 03:54 PM
Hello krishna,
I would recommend looking for examples in the Example Finder. To do this in LabWindows/CVI, go to Help >> Find Examples. You will want to look in the Hardware Input and Output >> DAQmx >> Analog Generation folder. You modify any of these examples so that they meet your needs.
There are additional examples posted in the example code library of the Developer Zone section of ni.com. If you search for "analog output cvi daqmx" you get a very relevant hit:
NI-DAQmx: Continuous Multi-Channel Analog Output Example in CVI
01-06-2006 11:40 PM
HI Laura
Thanks for your valuable response.
One more issuse please reply for the same.
We had NI PCI-6723 card and we are not able to generate analog outputs signals simultaneously for different channels with different data.
01-09-2006 04:21 PM
Hello Krishna,
I believe I have found a more relevant example for what you are trying to do here. It generates a different waveform for each channel. The thing to be aware of is that you need to assemble your data array carefully so that each channel gets the waveform you need it to. The example that I linked to uses "non-interleaving" to prioritize the samples in the array. So if you have 4 channels and a buffer size of 1000 points, each channel gets 250 of those points. To learn more about this look under the DAQmxWriteAnalogF64 function in the NI-DAQmx C Reference Help. I have quoted your options here:
Interleaved samples prioritize samples before channels, such that the array lists the first sample from every channel in the task, then the second sample from every channel, up to the last sample from every channel.
Channel 0—Sample 1 |
Channel 1—Sample 1 |
Channel 2—Sample 1 |
Channel 0—Sample 2 |
Channel 1—Sample 2 |
Channel 2—Sample 2 |
... |
Channel 0—Sample N |
Channel 1—Sample N |
Channel 2—Sample N |
Non-interleaved samples prioritize channels before samples, such that the array lists all samples from the first channel in the task, then all samples from the second channel, up to all samples from the last channel.
Channel 0—Sample 1 |
Channel 0—Sample 2 |
... |
Channel 0—Sample N |
Channel 1—Sample 1 |
Channel 1—Sample 2 |
... |
Channel 1—Sample N |
Channel 2—Sample 1 |
Channel 2—Sample 2 |
... |
Channel 2—Sample N |
01-11-2006 10:28 AM - edited 01-11-2006 10:28 AM
Hello Laura F.
Once again Thanks for your valuable reaponse.
Now I solved my problem completely by arranging my data array for different channels.
One more problem is that My data array is like this :-
Float64 data[100];
For the first channel Dev1/ao0 my data is
for(i=0;i<50;i++)
data[i] = 10;
For the Second channel Dev1/ao1 my data is
for(i=0;i<50;i++)
data[i] = 20;
Now my Execution Sequence is like below :-
Message Edited by krishna_ak on 01-11-2006 10:29 AM
01-11-2006 05:23 PM
Hello krishna,
Did you try using the DAQmxWrite while the task is running once you need to update your array data?
By default, analog output tasks are setup to allow regeneration, which means that you write data to your buffer, start your task, and then the device will continuously output this data from the buffer. It will loop back to the beginning of the buffer once you reach the end of the buffer. However, if you use the DAQmxWrite function after the task has been started you will put new data into the buffer. You need to be aware that glitching may occur. Please see the NI-DAQmx Help file for more information on glitching considerations. Once you have put the new data in the buffer, it will continuously generate that data until you update the buffer again. If, instead, you would prefer never to allow the data to regenerate, you can use the function DAQmxSetRegenMode. This way, you will have to continuously send data into the buffer to be outputted.
Using either of these methods, you can avoid having to start the task again.
Please read the sections about regeneration and glitching in the NI-DAQmx Help (Start >> Programs >> National Instruments >> NI-DAQ).
Also, just for your information, if you do not use the ClearTask and only the StopTask, you would only need to use DAQmxWrite and then StartTask to start outputting data again, because the task information will still be in memory. You can avoid the other configuration steps.
Hope this helps!
Laura
01-17-2006 07:55 AM
HI Laura,
Thanks for your valuable response and my application is working after implementing ur suggestions.
One more question
01-18-2006 11:32 AM
07-05-2007 01:11 PM
07-06-2007 06:24 PM
Hi Francis,
It sounds like what you are looking for is a way to determine the correct
number of samples to read to ensure that you are getting integer number of
cycles.
Here is an example of these calculations:
Say you are planning on generating two waveforms with frequencies of 20 kHz and
30 kHz at a sampling rate of 100 kHz.
You will need 5 samples to get a single cycle for the 20 kHz waveform and 3.33
samples to get a single cycle for the 30 kHz waveform.
Alternatively you could take 10 samples and get an integer number of waveforms
for both waveforms.
If you apply this algorithm to your output frequencies you should be able to
determine the proper number to use for the number of samples.