Hello all,
for a project I need to acquire measurement data from a current (Hall-)sensor via MatLab.
To achieve this target I chose a Stemlab 125-14 as the datasheet for the slow analog input pins states that there is the possibility for 100kS/s.
Yesterday I set up my redpitaya and tried to gather the input voltage with MatLab, altered by a Potentiometer from 0-3.3V.
The problem I encountered is that I was able to achieve a maximum of 20(!) samples per second (with the most minimalistic matlab code possible), which is far away from the sample rate I need to achieve for the project (I would need at least a few thousand kS/s).
My guess is that the query function (volts1 = str2num(query(tcpipObj,'ANALOG:PIN? AIN1'))) in the MatLab code takes too long to read enough samples during a certain time period.
Is there any way to increase the sample rate per second? It seems like you are able to start an acquisition which writes the values to a buffer (which can then be read) by using SCPI commands.
I think this is what I need to do, but I just found commands for the fast RF input but not slow analog inputs (which I need to use).
Sorry for these questions but I already googled/researched a lot and can't find any helpful information regarding this problem.
Hope you can help me with this.
Thanks!
TS
Increase Samples/Second for slow Analog Input
-
- Posts: 5
- Joined: Mon Oct 14, 2019 3:26 pm
Re: Increase Samples/Second for slow Analog Input
Update on how I came closer to my goal (in case anyone got the same problem):
I wrote an UDP-Server in C which is running on the RedPitaya and constantly reading the AI and sending the data in chunks to an UDP-socket.
At the same time, my MatLab program is receiving the datagrams from the UDP socket in realtime.
With this workaround I can get around 10-16kS/s which is not enough for my project yet but still much better than 20 samples per second.
I wrote an UDP-Server in C which is running on the RedPitaya and constantly reading the AI and sending the data in chunks to an UDP-socket.
At the same time, my MatLab program is receiving the datagrams from the UDP socket in realtime.
With this workaround I can get around 10-16kS/s which is not enough for my project yet but still much better than 20 samples per second.
-
- Posts: 2
- Joined: Sun May 31, 2020 9:21 pm
Re: Increase Samples/Second for slow Analog Input
Well, the problem may no lay at the network connection. I am trying to read values from the slow analog inputs into RAM with a C++ program and I allocate all memory needed before the sampling loop begins. Still, I get only about 18 kS/s and proportionally less when reading from multiple inputs.
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 118 guests