Documentation

slrtpingtarget

Test communication between development and target computers

Syntax

link_status = slrtpingtarget
link_status = slrtpingtarget(target_object)
link_status = slrtpingtarget(target_computer_name)
[link_status connection_info] = slrtpingtarget(___)
[link_status connection_info] = slrtpingtarget(___, 'info')
[link_status connection_info] = slrtpingtarget(___, 'reset')

Description

example

link_status = slrtpingtarget without an argument tests at a low level whether the development computer and the default target computer can communicate using the settings for that target computer. If a data channel is open between the development and target computers, the function leaves it open.

example

link_status = slrtpingtarget(target_object) tests whether the development computer and the target computer represented by target_object can communicate using the settings stored in target_object. If a data channel is open between the development and target computers, the function leaves it open.

example

link_status = slrtpingtarget(target_computer_name) tests whether the development computer can communicate with target computer target_computer_name using the settings for that target computer. If a data channel is open between the development and target computers, the function leaves it open.

Calls to [link_status connection_info] = slrtpingtarget(___) have the same behavior as slrtpingtarget(target_object).

example

[link_status connection_info] = slrtpingtarget(___, 'info') uses the information/control channel to return information about the Simulink® Real-Time™ connection between the development and target computers. If a data channel is open between the development and target computers, the function leaves it open.

example

[link_status connection_info] = slrtpingtarget(___, 'reset') uses the information/control channel to close an open communication channel between the development and target computers and then returns link status and connection information.

Examples

collapse all

link_status = slrtpingtarget
link_status =

success
target_object = slrt('TargetPC1');
link_status = slrtpingtarget(target_object)
link_status =

success
link_status = slrtpingtarget('TargetPC1')
link_status =

failed
[link_status connection_info] = slrtpingtarget('info')
link_status =

success

connection_info =

10.10.10.100
target_object = slrt('TargetPC1');
[link_status connection_info] = ...
     slrtpingtarget(target_object, 'info')
link_status =

success

connection_info =

Disconnected
[link_status connection_info] = slrtpingtarget('TargetPC1', 'info')
link_status =

failed

connection_info =

'fail: Target machine did not respond.'
[link_status connection_info] = slrtpingtarget('reset')
link_status =

success

connection_info =

Disconnected

Input Arguments

collapse all

Name property of a particular target computer environment object. The default name is 'TargetPC1'.

Example: 'TargetPC2'

Data Types: char

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

Output Arguments

collapse all

If you call ping without a second argument:

  • If communication is possible, connection_info is empty.

  • If communication is not possible, connection_info contains an error message.

If you call ping with a second argument of 'info':

  • If the connection is active, connection_info reports the development computer network address to which the target computer is connected.

  • If the connection is not active, connection_info contains 'Disconnected'.

  • If communication is not possible, connection_info contains an error message.

If you call ping with a second argument of 'reset':

  • If communication is possible, connection_info contains 'Disconnected'.

  • If communication is not possible, connection_info contains an error message.

Introduced in R2014a

Was this topic helpful?