Main Content

Target.ptpd

Target Computer PTP Daemon

Since R2020b

Description

A Target.ptpd object represents the RTOS PTP daemon that runs on a target computer and provides access to methods and properties related to the PTP daemon.

The object provides access to methods and properties that:

  • Start and stop the PTP daemon.

  • Configure the PTP daemon startup command.

  • Enable auto start of the PTP daemon.

  • Retrieve status information about the PTP daemon.

Function names are case-sensitive. Type the entire name. Property names are not case-sensitive. You do not need to type the entire name if the characters you type are unique for the property.

Creation

A Target.ptpd object is created when you create a Target object by using the slrealtime command. After you create and connect to the Target object, you can access the Target.ptpd object. This example creates and connects to Target object tg, and then starts the PTP daemon on the target computer.

tg = slrealtime('TargetPC1');
connect(tg);
start(tg.ptpd);

Properties

expand all

When AutoStart is enabled, after the target computer boots, the RTOS PTP daemon starts by using the command specified in the Target.ptpd object Command property.

Example: 0

The default value for the Command property is a command string that starts the RTOS PTP daemon with enable multiple daemons (-L), devctl() support (-K), and receiving the distributed clock (-g). To change from receiving the clock to sending the clock, stop the PTP daemon, change the command string, and start the PTP daemon. To enable hardware time stamp and achieve best clock synchronization, bind the PTP daemon to an Ethernet i210 interface by using the -b switch. For more information about PTP commands, see the QNX Neutrino documentation.

Example: 'ptpd -L -K -g'

Object Functions

startStart the PTP daemon on the target computer
stopStop the PTP daemon on the target computer
statusView the PTP daemon status on the target computer

Examples

collapse all

The Target.ptpd.Command and Target.ptpd.AutoStart properties configure operation of the PTP daemon.

  1. Create a Target object and connect to the target computer. Creating a Target object creates a child Target.ptpd object. Connecting to the target computer provides access to the Target.ptpd object.

    tg = slrealtime('TargetPC1');
    connect(tg);
  2. View the Target.ptpd object Command property value.

    tg.ptpd.Command
    ans =
    
        'ptpd -L -K -g'
  3. View the Target.ptpd object AutoStart property value.

    tg.ptpd.AutoStart
    ans =
    
      logical
    
       0
  4. Configure Target.ptpd object Command property value for sending the distributed clock and AutoStart property value for auto start.

    stop(tg.ptpd); % ensure that the daemon is stopped
    tg.ptpd.Command = 'ptpd -L -K -G';
    tg.ptpd.AutoStart = 1;
    start(tg.ptpd); % start daemon with new values

Version History

Introduced in R2020b