Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Actual rate using ni6143 with the on-demand method based on aiex2.cpp

Solved!
Go to solution

Dear Senior Engineers,

I got a problem using ni6143 with the on-demand method based on the file "aiex2.cpp" provided on the website. It is about the actual rate of sampling. It is said on the data sheet that the ni6143 could have the ability of acquiring data with the speed of 250kHz per channel, meaning that each data could be acquired in 4e-6 second. Then here is my question: if I use all the 8 channels (each at 250kHz), does it mean that I have to use 8[channels]*4e-6[seconds]=32e-6[seconds] to get a set of data (one data in each channel), or I can use only 4e-6[seconds] to get it? I use the on-demand method based on aiex2.cpp for the testing experiment. Inorder to check out what exactly is the rate of sampling, I use the digital I/O to set a signal at high before on-demand acquiring, and set it low when the data acquiring is finished. It shows on the oscillograph that the actual time for acquiring a set of data (one data in each channel) when I use 8 channels (each at 250kHz) is about 32e-6[seconds], which means that the device is acquiring data one channel by one channel, not simultaneously. I want to know whether there is any parameter I have to set with the registers, or the on-demand method could not acquire data with 8 channels simultaneously. My code is exactly the same with the file "aiex2.cpp".

Thanks for help.

0 Kudos
Message 1 of 7
(7,964 Views)

Hello Lircry,

 

The NI 6143 is advertised as 250KSamples/second/channel.  This means that the on-board clocks on the board are able to trigger each ADC on the board to acquire at a rate of 250KSamples/second and each ADC will be sampling simultaniously with the other ADC's configured for the measurement.

 

That said, it's impossible to achieve these rates using the on-demand method.  Instead of an on-board clock triggering the measurement, a register access is doing the job.  A register access of course takes time.  Then reading the data from the FIFO takes time (remember, the example reads the data before telling the next measurement to happen).

 

What are you trying to accomplish?

 

Thanks,

Steven T.

0 Kudos
Message 2 of 7
(7,940 Views)

Thank you very much for your reply 🙂

 

I am trying to write a program to control a 7-axies motion system. The servo-period of this system is 200us, and I need to sample 5 times for each channel to reduce noise within a servo-period. If the on-demand method could not be used for simultaniously sampling at 250KHz, could you give me a suggestion for solution?

 

Thanks again.

0 Kudos
Message 3 of 7
(7,917 Views)

Since you need a faster rate than you can achieve with the on-demand access.  You should use aiex1.cpp.  It demonstrates how to configure the on-board clocks to trigger the acquisitions on all ADCs at the same time.  The rate is configurable, so you can change it to meet your needs.

 

Is there a reason why you can't use this mode?

 

Thanks,

Steven T.

0 Kudos
Message 4 of 7
(7,908 Views)

Thanks again for your kind and patient reply Smiley Happy

 

Actually I am now trying to ues the mode described in aiex1.cpp. But the example just teaches me how to acquire data with a fix number of samples. If I want to use it in a servo-period system that runs continuously, meaning that I need to acquire a set of data in every servo-period, what should I change in the codes?

 

Many thanks,
Lircry

0 Kudos
Message 5 of 7
(7,905 Views)
Solution
Accepted by topic author Lircry

Hello Licry,

 

Yes, the example only shows how to acquire a fixed number of samples.  One of the function calls that sets up the acquisition will allow you to set the hardware to continuously acquire...

 

aiNumberOfSamples(theSTC, numberOfSamples, kFalse); //false for finite, true for continuous

 

So you can set this to kTrue to make the acquisition continuous.  In order for the task to keep running, your application needs to be able to access the data FIFO fast enough so that it does not overflow.

 

Secondly, every continuous acquisition must end sometime.  When your loop has acquired all the data that the application want, it must issue some commands to stop the acquisition.  The STC manual details the steps that can be taken to stop a continuous acquisition.

 

http://www.ni.com/pdf/manuals/340934b.pdf (check section 2.4.3.3)

 

Steven T.

0 Kudos
Message 6 of 7
(7,890 Views)

Thank you very much! I have settled down this problem finally. Smiley Happy

0 Kudos
Message 7 of 7
(7,839 Views)