Documentation

xPCTargetPC.Ping

Test communication between development and target computers

Syntax

public bool Ping()
public string Ping('info')
public string Ping('reset')

Description

Class: xPCTargetPC Class

Method

Namespace: MathWorks.xPCTarget.FrameWork

Syntax Language: C#

public bool Ping() tests at a low level the connection between the development and target computers. This method returns a Boolean value. If a data channel is open between the development and target computers, Ping() leaves it open.

public string Ping('info') returns human-readable information about the connection between the development and target computers. If a data channel is open between the development and target computers, Ping('info') leaves it open.

If the target computer is connected, Ping('info') uses the information/control channel to return a string of the form:

'xPCTargetversion hex_address Connected'

In this string:

  • version — Version of the Simulink® Real-Time™ kernel that is running on the target computer. For example, the function returns xPCTarget6.6 for kernel version 6.6.

  • hex_address — Hexadecimal representation of the development computer network address to which the target computer is connected. The hexadecimal digits are reversed from the digits of the network address. For example, 0x640a0a0a represents the network address 10.10.10.100.

    When the target computer is not connected to a development computer, hex_address is a random hexadecimal number.

If the target computer is not connected to a development computer, Ping('info') returns a string of the form:

'xPCTargetversion hex_address Disconnected'

public string Ping('reset') uses the information/control channel to close an open communication channel between the development and target computers and returns a string of the form:

'xPCTargetversion hex_address Disconnected'

Introduced in R2011b

Was this topic helpful?