07-03-2015 11:12 PM
Hi there,
I was using traditional DAQ to write N analog samples to 1 channel for long time, I can output any number of samples to the same channel in traditional DAQ. But after I switch to the DAQmx, and I am using a timing to control the output of AO samples, I observed that it only allows the even number of samples.
For the first try, I setup the following program
In this case, no matter if the number of samples is odd or even, the code runs without any problem. However, if I use the sampling clock as belows
The code runs without error if the number of samples is even but it fails if I use odd number of samples. The error returned as
error: -200692
DAQmx Write (Analog 1D DBL 1Chan NSamp).vi:1780002<append>
<B>Property: </B>SampQuant.SampPerChan
<B>Corresponding Value: </B>1233
<B>Property: </B>NumChans
<B>Corresponding Value: </B>1
Does anyone has any idea what's going on here? Thanks
07-04-2015 08:35 AM
07-04-2015 12:56 PM
Wouldn't you want to use single sample instead of NSamp if you only want a single sample?
07-04-2015 05:48 PM - edited 07-04-2015 05:50 PM
@natasftw wrote:
Wouldn't you want to use single sample instead of NSamp if you only want a single sample?
Thanks for the reply. I need to send multiple samples instead, ranged from 1000 to 9605 depending on the an input parameters. The reason why I need to use the sample clock is I need to use an external clock to control the sample output in future but for testing, I am trying to use the interal onboard clock instead.
One application I am trying to develop is to output 1000 samples at the rate of 1000 per second so each sample will be outputed at the interval of 1ms, using onboard clock doesn't assure this very well. I need to control it with external clock.
07-06-2015 09:01 PM
@mikeporter wrote:
So it looks like you are trying to do buffered output. I would suggest you start with one of the examples and let it demonstrate how do to it correctly.
Mike...
I try those examples one by one and when I use the time clock, i got the error when the number of sample is odd. The error shown in previous thread is actually what I got from labview while the code fail to run. I don't have how to fix that issue from the hint of those error message. Someone suggests to use even number of samples instead, yes, it works but it doesn't fix my problem since in my case, I have to control the number of sample to be precise.
07-06-2015 09:27 PM - edited 07-06-2015 09:29 PM
Have you told us what device you are using?
The error message clearly states "Number of samples per channel to write multiplied by the number of channels in the task cannot be an odd number for this device.
Adjust the number of samples per channel to write or the number of channels in the task so that their product is an integer multiple of two."
Whatever reason, the device can't be set for an odd number of samples. So trying to force it to do that is not going to work
Since is says the number of cahhnels times the number of samples multipled together can't be odd, what if you create a second dummy output channel that outputs the same waveform even though you never use it. Now 2x odd will always by even.
07-06-2015 09:38 PM
@RavensFan wrote:
Have you told us what device you are using?
The error message clearly states "Number of samples per channel to write multiplied by the number of channels in the task cannot be an odd number for this device.
Adjust the number of samples per channel to write or the number of channels in the task so that their product is an integer multiple of two."
Whatever reason, the device can't be set for an odd number of samples. So trying to force it to do that is not going to work
Since is says the number of cahhnels times the number of samples multipled together can't be odd, what if you create a second dummy output channel that outputs the same waveform even though you never use it. Now 2x odd will always by even.
Thanks. I am using (PCI)6713. I just curious why it does not require the multplication to be 2x in my first example (not using time clock) but ti doesn have that requirement for the second example on the same device. I think I misunderstand something but I want to know what's the difference between first and second example regarding the number of samples used.