Documentation

SimulinkRealTime.utils.getConsoleLog

Retrieve the log that the kernel writes to the target computer screen

Syntax

console_log = SimulinkRealTime.utils.getConsoleLog
console_log = SimulinkRealTime.utils.getConsoleLog(line_number)
console_log = SimulinkRealTime.utils.getConsoleLog(target_object, ___)
console_log = SimulinkRealTime.utils.getConsoleLog(target_name, ___)

Description

example

console_log = SimulinkRealTime.utils.getConsoleLog returns the text lines that the default target computer displayed on its screen.

If the computer displayed more than 500 lines, the function returns the last 500 lines.

example

console_log = SimulinkRealTime.utils.getConsoleLog(line_number) returns the text lines that the default target computer displayed on its screen, starting from line_number.

  • If the computer displayed more than 500 lines after line_number, the function returns the last 500 lines.

  • If line_number is greater than the number of lines that the target computer displayed, the function returns an empty vector.

example

console_log = SimulinkRealTime.utils.getConsoleLog(target_object, ___) returns the text lines that the target computer represented by target_object displayed on its screen.

example

console_log = SimulinkRealTime.utils.getConsoleLog(target_name, ___) returns the text lines that target computer target_name displayed on its screen.

Examples

collapse all

Reads log for default computer starting from line 0.

console_log = SimulinkRealTime.utils.getConsoleLog
console_log =

1×13 struct array with fields:

sequence
attrib
text
console_log(1)
ans =

struct with fields:

sequence: 0
attrib: 0
text: 'Starting up with 1 CPU'

Reads log for default computer starting from line 5.

console_log = SimulinkRealTime.utils.getConsoleLog(5)
console_log =

1×8 struct array with fields:

sequence
attrib
text
console_log(1)
ans =

struct with fields:

sequence: 5
attrib: 0
text: 'Download finished'

Reads log for target computer represented by target_object, starting from line 5.

console_log = ...
    SimulinkRealTime.utils.getConsoleLog(target_object, 5)
console_log =

1×8 struct array with fields:

sequence
attrib
text
console_log(1)
ans =

struct with fields:

sequence: 5
attrib: 0
text: 'Download finished'

Reads log for target computer 'TargetPC1', starting from line 50.

console_log = SimulinkRealTime.utils.getConsoleLog('TargetPC1', 50)
console_log =

1×0 empty struct array with fields:

sequence
attrib
text

Input Arguments

collapse all

Object that represents the target computer. Before calling this function, make sure that you start the target computer with the Simulink® Real-Time™ kernel and apply the required Ethernet link settings.

Example: tg

Example: 'TargetPC1'

Data Types: char

Target computer message line number, starting from 0.

  • If the computer printed more than 500 lines after line_number, the function returns the last 500 lines.

  • If line_number is greater than the number of lines that the target computer printed, the function returns an empty vector.

Example: 5

Output Arguments

collapse all

The function returns the console log as a vector of structures consisting of the following fields:

  • sequence — The line number in the log, counting from the last time that the target computer restarted.

  • attrib — Whether the message was an error (2), a warning (1), or an informational message (0).

  • text — The line text, as the target computer printed it to the screen.

Introduced in R2017a

Was this topic helpful?