Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to reading Analog Voltage data using C++ (NiDAQmx)

Solved!
Go to solution

I am facing the following issue while reading Analog Voltage data NIDAQ using

API :DAQmxReadAnalogF64 

Failed with Error: -200077,

Error Text: Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: DAQmx_SampQuant_SampPerChan
Requested Value: 1
Maximum Value: 8589934590
Minimum Value: 2

 

Steps I followed are:

1. Created a task object using DAQmxCreateTask

2. Created a voltage Channel using DAQmxCreateAIVoltageChan

3. Configured sample clock using DAQmxCfgSampClkTiming

4. Read values using DAQmxReadAnalogF64 

 

On step 4 this error occurs. Am I missing any steps?

Parameters given to the function are

numSampsPerChan = -1, timeout = 1.000000, fillMode = 0, arraySizeInSamps = 1 

0 Kudos
Message 1 of 2
(921 Views)
Solution
Accepted by kiran_t

Just guessing from your clues:

 

I suspect the problem gets "set up" in step 3 but becomes apparent (and is then thrown) in step 4.

 

This sounds like an error where you configured SampClkTiming for Finite Sampling with a sample quantity of 1.  The error message is telling you that the minimum # of samples in a task with a hardware sample clock is 2.  (After all, the whole purpose of a hardware clock is to precisely control the interval *between* samples.  The interval "between* 1 single sample is a meaningless idea.  Like, "what's the sound of a single hand clapping?")

 

Solution: set the sample quantity to 2 or more.  You can always choose to ignore samples you don't care about....

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 2 of 2
(861 Views)