Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I getting DAQmxErrorSamplesNotYetAvailable, -200284 trying analog input under Mac OS X

I am trying to do basic analog input on a Mac (10.3.9) using NIDAQmxBase 2.0. The PCI card is 6251.

At first, I tried to use acquireNScans-AnlgStart.c sample code, but it gave an error regarding the trigger source, DAQmxErrorInvalidAnalogTrigSrc, -200265. For some reason, "/Dev1/PFI0" or "PFI0" is not valid. It requires "APFI0".

Now I get DAQmxErrorSamplesNotYetAvailable -200284 from the DAQmxBaseCfgAnlgEdgeStartTrig call.

I tried a different sample code acquireNScans.c, which just collects data and skips the triggering, but it gives the same error on calling DAQmxBaseReadAnalogF64. (I put the trigger pulse itself into the analog input channel for this test.)
0 Kudos
Message 1 of 7
(3,348 Views)
Hello mauricev,

The error -200284 may be caused by your timeout expiring before all of your specified samples are acquired.  The Common Error Codes and the Why Do I get Error -200284 discuss this particular error. 

Post again if these KB's don't answer your question or if you have any follow up questions.

Regards,
Micaela N
National Instruments
0 Kudos
Message 2 of 7
(3,337 Views)
I don't think it make sense about the timeout. The pulse is sent once every second, for a total of 10 times during the timeout period of 10 seconds.

In addition, I now see that the error appears only if I try to trigger. If I don't trigger and simply collect immediately after calling DAQmxBaseStartTask , I collect an array of "nan".

I think what is happening is simply that PCI card isn't seeing any signal at all, but I don't know why.

Message Edited by mauricev on 07-11-2006 06:36 PM

0 Kudos
Message 3 of 7
(3,326 Views)
Hello mauricev,

Can you see your device in the DAQmx Base List Devices Utility?  And can you use the NI Datalogger to log a short set of data?  This will help us ensure that the problem is contained within the code. 

What are the samplesPerChan and the sampleRate you are using in your application, in the example program they were hard-coded to be 1000 and 10000?  You may have already thought of this, but it's worth saying.  The DAQmxBaseReadAnalogF64 call is blocking, it will not return anything until all of the samplerPerChan requested have been acquired or the timeout has occurred.  So if you have a combination of samplesPerChan and sampleRate that is larger than or in some causes equal to 10 sec, you will get a timeout error.

Post again if you are still having trouble and we'll keep working.

Regards,
Micaela
Micaela N
National Instruments
0 Kudos
Message 4 of 7
(3,313 Views)
First, I was able to easily collect data in the logger program. I had integers and floats out of sync in the example program I modified since I was shifting between DAQmxBaseReadAnalogF64 and DAQmxBaseReadBinaryI16. Now with DAQmxBaseReadAnalogF64 using floats and printing floats, I am getting valid values. (My sampling rate is 1000 and I am collecting 1000 samples.)

However, I tried to add back the analog trigger using DAQmxBaseCfgAnlgEdgeStartTrig, and the original error message, DAQmxErrorSamplesNotYetAvailable, -200284, has returned. It seems that this error is occuring because the card is not seeing the analog trigger plugged into the PFI0 BNC of the BNC-2090 and I don't know why. The oscilloscope triggers fine from it. I tried playing with the voltage between 2-6 volts and changing the duration from 1 ms to 2 ms. I have triggerlevel set to 1, but it's not clear what means. I also tried changing DAQmx_Val_RisingSlope to DAQmx_Val_FallingSlope, but it still gives this error. As soon as I take away DAQmxBaseCfgAnlgEdgeStartTrig, I can collect normally, but of course, the data appears randomly along the array since it's not synced to the trigger.

Can the logger program be rigged to wait for a trigger?

Message Edited by mauricev on 07-12-2006 07:59 PM

0 Kudos
Message 5 of 7
(3,307 Views)
Hello mauricev,

Ah, you are using the BNC-2090.  Some of the BNC-2090 pins do not directly correspond to the M-Series pins.  This KnowledgeBase compares the pinouts of the BNC-2090 and the M-Series boards.  In your case, you are triggering off of APFI0 which maps to the EXTREF connector on the BNC-2090. 

Let me know if you still see the same error after trying the EXTREF connector.

Regards,
Micaela N
National Instruments
0 Kudos
Message 6 of 7
(3,290 Views)
It is working great. Smiley Happy Thanks for all your help.
0 Kudos
Message 7 of 7
(3,280 Views)