12-09-2011 03:05 AM - edited 12-09-2011 03:07 AM
I have a NI USB-9162 connected with a NI-9234 correctly configured and installed under OpenSUSE 11.3. This is the ldaq output:
>lsdaq -------------------------------- Detecting National Instruments DAQ Devices Found the following DAQ Devices: NI USB-9234: "Dev1" (USB0::0x3923::0x72B5::0164852A::RAW) --------------------------------
I'm developing a simple application to acquire the vibration values of an oject connected with an accelerometer.
I start from the acquireNScans-AnlgStart.c example from the NIDaqMxBase 3.4.5 documentation.
Unfortunately the program fails and produces the following error:
"DAQmxBase Error -200428: Value passed to the Task/Channels In control is invalid."
Then I realize that the NI9234 doesn't support analog and digital triggers so I decided to try with the acquire1Scan.c (one scan without trigger):
int main(int argc, char *argv[]) { // Task parameters int32 error = 0; TaskHandle taskHandle = 0; char errBuff[2048]={'\0'}; // Channel parameters char chan[] = "Dev1/ai0"; float64 min = -10.0; float64 max = 10.0; // Timing parameters uInt64 samplesPerChan = 1; // Data read parameters float64 data; int32 pointsToRead = 1; int32 pointsRead; float64 timeout = 10.0; DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle)); DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL)); DAQmxErrChk (DAQmxBaseStartTask(taskHandle)); DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByChannel,&data,samplesPerChan,&pointsRead,NULL)); printf ("Acquired reading: %f\n", data);
Also this program fails and gives this error:
DAQmxBase Error -200077: <err>Requested value is not a supported value for this property. (Timing Mode)
How can I acquire at least a single data value from the accelerometer from this devices using the NIDaqMxBase API?
Solved! Go to Solution.
12-09-2011 03:49 PM
Hi giaulo,
The examples that you tried to run are not compatible with your device.
The 9234 does not support analog triggering so the "acquireNScans-AnlgStart.c" examples will not work.
It is also unable to do a single point acquistion since is built on a delta-sigma ADC architecture. Here is a knowledgebase article explaining the limitation:
KB 4SU94SH7: Does DSA Hardware Support Single Point Acquisition?
This is the reason why the "acquire1Scan.c" doesn't work.
You will need to run an example that does a buffered acquisition. "acquireNScans.c" would be a good one to look at. Be aware for all of these examples, the default input range is +/-10V. The 9234 can only input +/-5V, so there will need to be some modifications. Also since you are trying to read from an accelerometer, IEPE excitation will likely be needed. I've attached an example that is based off of "contAcquireNChan.c" example that correctly sets the range and enables excitation for that device.
12-14-2011 08:06 AM
Thank you! Now I'm able to acquire data.