필터 지우기
필터 지우기

in custom criteria function of simulink test the test.sltest_output is empty

조회 수: 7 (최근 30일)
Stefano Truzzi
Stefano Truzzi 2021년 10월 14일
답변: Dimitri MANKOV 2021년 10월 25일
I am trying to use custom criteria by checking the custom criteria function in the test manager. The goal is to verify a signal acquired during real time testing on Speedgoat reaches two different values during testing.
I cannot access the signal data within the custom criteria function. I have logged the signal in the model, I have the logsout variable in the workspace after the model is executed, in the simulation output panel I added the signal, but the test sltest_simout is empty.
How can I access the data acquired by the real time test hardware within the custom criteria?

답변 (1개)

Dimitri MANKOV
Dimitri MANKOV 2021년 10월 25일
Hi Stefano,
I would recommend logging the data in Simulink Real-Time using the Simuliation Data Inspector (SDI), which would enable you to base your custom criteria function on the following syntax :
% Extract desired run IDs from SDI
runID_List = Simulink.sdi.getAllRunIDs;
runID = runID_List(end);
% Export logged data to workspace
simDataset = Simulink.sdi.exportRun(runID);
% Unpack the data
signal_A = simDataset{1}.Values.Data(:,1);
signal_B = simDataset{1}.Values.Data(:,2);
...
Hope that's helpful!
Best,
Dimitri

카테고리

Help CenterFile Exchange에서 Outputs에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by