Get the xPC Target (Simulink Real-time) message log to the host computer

1 次查看(过去 30 天)
With the new xPC Target interface, the message log of all the system actions is smaller (9 lines to 6 lines) and scrolls through important things. I do not have easy access to the xPC system to connect a keyboard to it so I can scroll (PG UP) through the log. Is it possible to retrieve that text message log onto the host computer so I can review it? My simulation periodically updates the text log on the xPC with valuable information. Also, I am not looking for the 'xpctargetspy' command. That doesn't allow me to interact with the xPC system to scroll up the message log.

回答(1 个)

Dimitri MANKOV
Dimitri MANKOV 2024-9-2
Hi Thomas,
In MATLAB R2020a and earlier, you can use the following command to retrieve the entire target console log:
SimulinkRealTime.utils.getConsoleLog
In MATLAB R2020b and later, the target console log can be accessed either directly in the Simulink Real-Time Explorer, or by using the following commands:
tg = slrealtime;
slog = slrealtime.SystemLog(tg);
slog.messages
I hope this is helpful!
Dimitri

Community Treasure Hunt

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

Start Hunting!

Translated by