Effacer les filtres
Effacer les filtres

Fread com device too slow

5 vues (au cours des 30 derniers jours)
Jason Riley
Jason Riley le 23 Jan 2021
Commenté : Jason Riley le 28 Jan 2021
So I am currently using matlabd to read continuously from a device set um on COM4.
the device is streaming 5 32Bit Ints @4kHz. If i acquire data for say 4 seconds i appear to be waiting a further 7 or 8 seconds for the fread() function to catch up. any thoughts on how to speed this up as this delay is problematic when trying to acquire multiple scans, i am waiting longer than i am scanning.

Réponses (1)

Vimal Rathod
Vimal Rathod le 28 Jan 2021
  1 commentaire
Jason Riley
Jason Riley le 28 Jan 2021
i don't see solutions in these only commentries, could you be more specific when you say use these solutions? these appear as discussions without answers.
I know uaing standard usb serial data readers that i can run at ful speed, but matlab seems slower.
here is the specific code:
set(app.obj1, 'ReadAsyncMode','continuous');
while (done==0)
if app.obj1.BytesAvailable>0
while app.obj1.BytesAvailable>0
currently the device streams 5x32bit numbers at 4kHz. if i scan for 2 seconds, i currently wait 4-5s for the buffer to catch up. Given using other streaming programs i have 0 wait time, i assume there is some paraemter which needs to be set in matlab to make this run faster? but as to what, i find no answers in your suggested reading.

Connectez-vous pour commenter.


En savoir plus sur Startup and Shutdown dans Help Center et File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by