Missing documentation for slrealtime.Instrument methods?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Leonardo Ricupero
il 13 Giu 2022
Commentato: Stefanie Schwarz
il 25 Ott 2023
Hello,
I'm trying to evaluate a setup for real time testing. I've found useful information on this link, where it is shown how to leverage python scripting to run a slrealtime application and get the acquired signals from the real time HW.
The script runs fine, but in an attempt to extend it for our purposes, I'm struggling to find some documentation on some of the methods used in such script. For example:
instrument.getBufferedData % no doc for getBufferedData method
and:
instrument.BufferData=true % no docs for BufferData property
The purpose is to be able to get signal values in real time in order to take actions during the execution of a test case.
Thanks in advance for any help!
Leonardo
0 Commenti
Risposta accettata
Pablo Romero
il 9 Gen 2023
You can find more information about the getBufferedData method and the BufferData property at Gets data from the real-time application instrument buffer - MATLAB getBufferedData (mathworks.com).
Please notice that the main purpose of the buffered data mode is providing support for external languages via the MATLAB Engine API that do not support callbacks. Using buffered data mode is not strictly required when manipulatin real-time data within MATLAB.
3 Commenti
Hui Xiao
il 8 Set 2023
slrealtime.Instrument object don't have a public propertiey BufferedData, so I am still confused on how to enable the buffered data mode.
Stefanie Schwarz
il 25 Ott 2023
Hi Hui, there is a typo in the 'getBufferedData' our documentation. It should be:
Instrument.BufferData = true;
('BufferData', not 'BufferedData').
We apologize for this and will fix the typo in the future MATLAB documentation.
Più risposte (1)
Marcel Schoch
il 16 Set 2022
I have not found any documentation neither, but after having played around with the various options to get data in realtime, I've noticed the following:
Getting realtime data with the callback method
I've made somewhat mixed experience with using a callback method, especially in an app, it consumed a lot of resources and the callback is called very irregularely. It also made my application very slow, because it is called multiple times per second, and there does not seem to be any control over the call frequency.
instrument = slrealtime.Instrument('path_to_model.mldatx');
instrument.addSignal(path, 1);
inst.connectCallback(@(o,e)thisisacallback(o,e)); % adding a callback method
instrument.AxesTimeSpan = 10;
instrument.AxesTimeSpanOverrun = 'wrap';
tg.addInstrument(instrument);
Getting realtime data with getBufferedData
The following code works very well, instrument.getBufferedData() and datas(...) takes only very little time to execute. I prefer this solution as I have control over when data is read out.
instrument = slrealtime.Instrument('path_to_model.mldatx');
instrument.addSignal('path_to_signal', 1);
tg.addInstrument(instrument);
instrument.BufferData = true; % set buffered to true
% read out data:
datas = instrument.getBufferedData();
data = datas('path_to_signal:1');
Maybe this helps a bit.
0 Commenti
Vedere anche
Categorie
Scopri di più su Target Computer Setup in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!