better help / tutorial on realtime instruments

Hi,
I'm trying to get aquainted with using instruments in a GUI to display signals logged on a realtime target machine. I have attempted to follow matlabs inverted pendulum example but am finding it to be very confusing... I would just like to get a sin wave streamed from my target machine to plot to an axis on a gui as a proof of concept but the only example available is for a complex applicaiton that I am having a hard time understanding. Admitedly, I'm new to using the app designer which isn't helping my comprehension, but I really think there ought to be a clear explaination of the process of implementing a realtime instrument object... Any advice is appreciated!

 Respuesta aceptada

Christopher Bitikofer
Christopher Bitikofer el 19 de Mzo. de 2021

0 votos

Followup, I was able to get the an Instrument object working following some much needed calories and time spent tracing functions in the demo inverted pendulum app...
That said I think there should be a better explaination posted in the documentation walking users through, what a callback function for instruments should do, what the eventData object is, and preformance optimization... in my use case, I need the gui to at least maintain a steady framerate while playing back a signal from the target machine. Right now things are still pretty choppy... I would appreciate a way to set a target framerate...

5 comentarios

Walter Roberson
Walter Roberson el 19 de Mzo. de 2021
You cannot set a target framerate. The only framerate control is "drawnow limitrate, which discards frames beyond 60 frames per second.
That does seem to be the case. I'm finding the framerate performance to be pretty disappointing (it sort of looks like the app hovers at ~20fps but occaisionally lags noticably). My hope was to use a GUI to play a sound and display feedback to a user performing an experiment while interacting with a robot, but if I can't acheive a reliable latency between the target machine and the host, I don't think that trying to have a timer signal originate from the target machine will work...
The alternate approach is probably to let the host PC run the signal using a timer object and send it via an instrument to target... again I need to understand how much latency and how steady the latency between devices is, but I expect that way my GUI could at least run a consistant framerate...
Walter Roberson
Walter Roberson el 20 de Mzo. de 2021
Have you looked at Psychtoolbox ?
I hadn't heard of that toolbox, but it seems pretty useful! Thanks for the idea I'll look into using it.
Jon Lobo
Jon Lobo el 7 de Abr. de 2021
Hi Christopher (and anyone else who might find this useful),
I made an example for this workflow with a simple model and app that I thought might be useful (see attached).
-Jon

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Parallel Computing en Centro de ayuda y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by