Retrieve the log that the kernel writes to the target computer screen
retrieves the log from the
console_log = SimulinkRealTime.utils.getConsoleLog(
target_name, for lines equal to or greater than the
sequence number. If the
target_name is omitted, the
function returns the console log of the default
target computer (for
'TargetPC1'). If the
sequence_number is omitted, the function returns lines
from the default sequence (for example,
0). If no lines have
such a sequence number, the function returns an empty array.
console_log is an array of structures, one per line
of text in the console. Each structure has the following fields:
sequence: Absolute sequence number of the console
line, after target reboot.
attrib: The type of message the line
0 - normal messages
1 - warning messages
2 - error messages
text: The text of the console line. The text does
not include a line termination character (for example,
Get the console log for the default target computer starting from sequence
console_log = SimulinkRealTime.utils.getConsoleLog % if the default target computer is TargetPC1, % this function is equivalent to: % console_log = SimulinkRealTime.utils.getConsoleLog('TargetPC1',0)
console_log = 1×13 struct array with fields: sequence attrib text
ans = struct with fields: sequence: 0 attrib: 0 text: 'Starting up with 1 CPU'
Get the console log for a target computer selected with a target object, starting from a specific sequence number.
tg = slrt; console_log = SimulinkRealTime.utils.getConsoleLog(tg,5)
console_log = 1×8 struct array with fields: sequence attrib text
ans = struct with fields: sequence: 5 attrib: 0 text: 'Download finished'
sequence_number— Target computer console log sequence number
0(default) | integer
The target computer log sequence number indicates the line number from the
beginning of last reboot, starting from
0. This number
does not necessarily match the line number displayed on the screen or
observed at the buffer.
console_log— Lines printed to target computer screen
The function returns the console log as a vector of structures consisting of the fields: