Page 1 of 1

Very slow data acquisition

Posted: Mon Mar 20, 2017 10:29 pm
by michael_tec
Hi community!

I want to use the 2 high speed ADCs to simultaneously acquire samples from the 2 high speed inputs. After acquiring e.g. 16384 samples I want to set a few GPIOs and sample again. It is important that the time gap between those 2 shots is very small.

My first approach was using the SCPI application. I tested the provided Matlab example script and got the sampled data. I modified the script and inserted a loop where i sampled 10 times in a row. I made sure to not include the pause for filling the sample buffer. The problem is that each acquisition of 16384 samples needs approximately 1 second.

My guess was that matlab, the network communication or the conversion from string to numeric data was the bottleneck. So I tried the example program in C (Examples/C/acquire_trigger_software.c ). Unfortunately this program isn't really faster. Of course i removed the pause(1) and also the command line output.

Finally I tried the acquire tool in Test/acquire/acquire.c. Unlike the other two programs this was very fast.

Why is there such a high difference in speed? Is there a way to speed up the scpi server approach because that would be my favourite if it's fast enough?

Thanks in advance!

Re: Very slow data acquisition

Posted: Fri Mar 24, 2017 7:24 pm
by redpitaya
Hi,
SCPI works a bit slower since there is lots of data copying done inside the SCPI server and interpretation as you mentioned, but the APIs should not be slower than acquire.c example. It would make sense to investigate which function takes so much time to execute and try to figure out why this happens . At the moment we are working on improved version of FPGA acquisition module to support some missing features that will also improve APIs and after that we also plan to improve SCPI speed.
kind regards, Red Pitaya team