IEEE 1588 Setup

Configure node for Precision Time Protocol execution

  • Library:
  • Simulink Real-Time / IEEE 1588

Description

Sets up the Precision Time Protocol for the specified transport protocol (Ethernet or UDP). Exposes as outputs the state of the protocol, the delay measurement mechanism, and triggers for sending messages.

The PTP internal block descriptions are for informational purposes only. You cannot use these blocks by themselves in a model. The subsystem mask controls the block parameters. Do not edit the parameters directly.

Ports

Output

expand all

Current state of the protocol state machine. Returns one of:

  • 1 = INITIALIZING — Initializing data set and communication protocol

  • 2 = FAULTY — Occurrence of serious fault

  • 3 = DISABLED — Management message disables the node

  • 4 = LISTENING — Waiting for announce receipt timeout period to expire

  • 5 = PRE_MASTER — Intermediate state before moving to MASTER state after execution of Best Master Clock Algorithm (BMCA)

  • 6 = MASTER — Node is the master PTP clock node

  • 7 = PASSIVE — BCMA designates node as passive

  • 8 = UNCALIBRATED — Intermediate state before moving to SLAVE state after execution of BMCA

  • 9 = SLAVE — Node is a slave node

For more information, see IEEE® Std 1588-2008 Clause 9.2.5.

Value of Delay measurement mechanism. Returns one of:

  • 1 = Request-response

  • 2 = Peer-delay

Value of synchronization trigger, true every Sync interval

Value of announce trigger, true every Announce interval

Value of delay request trigger, true every Min delay or pdelay request interval

Parameters

expand all

General

From the list, select a unique number to identify the Ethernet board. Select the same Device ID as the one that you selected for the protocol configuration block.

Programmatic Use

Block Parameter: ID

The network protocol for communicating messages. Select one of Real-Time UDP and Raw Ethernet.

Programmatic Use

Block Parameter: protocol

IP address of Ethernet card, or node, represented by the PTP Setup block.

Programmatic Use

Block Parameter: IpAddress

Value that changes the PTP clock.

Programmatic Use

Block Parameter: time_inc

Enter the PCI bus number for the Ethernet card.

Programmatic Use

Block Parameter: PciBus

Enter the PCI slot number for the Ethernet card.

Programmatic Use

Block Parameter: PciSlot

Time Properties

Source of PTP clock signal. Select one of:

  • Precise System Time — Synchronization of system time without hardware timestamp

  • Tick Counter — Synchronization of tick counter read without hardware timestamp

  • Ethernet board — Clock on PTP Ethernet board

Programmatic Use

Block Parameter: time_source

Specify origin point of the PTP timescale. Select one of:

  • PTP (1970-01-01 — Precision Time Protocol standard epoch, starting January 1, 1970.

  • GPS (1980-06-01) — Global Positioning System standard epoch, starting June 1, 1980.

  • NTP (1900-01-01) — Network Time Protocol standard epoch, starting January 1, 1900.

  • Specify — Selecting this value makes the Arbitrary timescale epoch (yyyy mm dd hh) parameter visible.

Programmatic Use

Block Parameter: timescale

Specify origin point for PTP timescale, in year, month, day, and hour.

When Timescale (epoch) is Specify, Arbitrary timescale epoch (yyyy mm dd hh) is visible.

Programmatic Use

Block Parameter: epoch

Method of measuring link delays. Select one of Request-response and Peer-delay.

In a PTP network, you must configure all nodes to use the same link delay measurement mechanism.

For more information, see IEEE Std 1588-2008 Clause 7.5.4.

Programmatic Use

Block Parameter: delay_measure

Enter the base sample time or a multiple of the base sample time.

Programmatic Use

Block Parameter: sample_time

When you select this check box, you cannot allocate the PTP Ethernet card that this block represents as a master PTP clock.

In Slave only mode, the values of the advanced parameters (Priority 1, Clock class, Clock accuracy, and Priority 2) are set to their highest values. When the parameters have these settings, the Best Master Clock Algorithm (BMCA) cannot choose the node as best master clock unless all of the other nodes have the same configuration. If the BMCA selects a Slave only node as best clock, the node remains in the LISTENING state.

Programmatic Use

Block Parameter: slave_only

Time Intervals

The period, in seconds, of an Announce message transmitted by a node in master state.

For more information, see IEEE Std 1588-2008 Clause 9.5.8.

Programmatic Use

Block Parameter: announce_interval

The period, in seconds, of a Sync message transmitted by a node in master state.

For more information, see IEEE Std 1588-2008 Clause 9.5.9.

Programmatic Use

Block Parameter: sync_interval

Period of delay request message or of peer-delay request message transmitted by a node in the slave state. When the delay measurement mechanism is Request-response, the block transmits delay request messages. When the mechanism is Peer-delay, it transmits peer-delay request messages.

For more information, see IEEE Std 1588-2008 Clauses 9.5.11 and 9.5.13.

Programmatic Use

Block Parameter: min_pdelay_req_interval

Specifies the number of announce intervals a node not in the master state has to wait without receiving an announce message before the node enters the master state.

For more information, see IEEE Std 1588-2008 Clause 9.2.6.11.

Programmatic Use

Block Parameter: announce_receipt_timeout

Advanced

Specify the domain number of the PTP network to which the node belongs.

A Simulink® Real-Time™ PTP node can belong to only one PTP domain at a given time. If the node receives a PTP message with a different domain number, it ignores it. For more information, see IEEE Std 1588-2008 Clause 7.1.

When you select the Show advanced configuration parameters check box, Domain number is visible.

Programmatic Use

Block Parameter: domain_num

The current UTC offset, in seconds.

If you specify a nonzero value, that value is considered valid. The UTCOffsetValid flag is set to true. Otherwise, the flag is set to false. For more information, see IEEE Std 1588-2008 Clause 7.2.3.

When you select the Show advanced configuration parameters check box, Current UTC offset is visible.

Programmatic Use

Block Parameter: utc_offset

Specify an integer value in the range 0–255. When the value is 0, the node has the highest priority. When it is 255, the node has the lowest priority.

To assess the quality of two PTP clocks, the Best Master Clock Algorithm compares the following parameters, in order:

  1. Priority 1

  2. Clock class

  3. Clock accuracy

  4. Priority 2

If a parameter for one PTP clock has a smaller value than that parameter for the other clock, the algorithm selects the clock with the smaller value as the best clock. If all four parameters are equal for both clocks, the algorithm compares the MAC addresses of the nodes.

For more information, see IEEE Std 1588-2008 Clause 7.6.2.2.

When you select the Show advanced configuration parameters check box, Priority 1 is visible.

Programmatic Use

Block Parameter: priority1

Specify a nonreserved integer value in the range 0–255. If Clock class is less than 128, the node cannot enter the SLAVE state. If Clock class is less than 128 and the node is not selected as the best clock, the node enters the PASSIVE state.

If you specify a reserved integer value, the block produces an error during model update. For more information, see IEEE Std 1588-2008 Clause 7.6.2.4. For a list of reserved and nonreserved Clock class values, see IEEE Std 1588-2008 Table 5.

When you select the Show advanced configuration parameters check box, Clock class is visible.

Programmatic Use

Block Parameter: clock_class

Specify a nonreserved integer value in the range 0–254.

For more information, see IEEE Std 1588-2008 Clause 7.6.2.5. For a list of reserved and nonreserved Clock accuracy values, see IEEE Std 1588-2008 Table 6.

When you select the Show advanced configuration parameters check box, Clock accuracy is visible.

Programmatic Use

Block Parameter: sample_time

Specify an integer value in the range 0–255. When the value is 0, the node has the highest priority. When it is 255, the node has the lowest priority.

For more information, see IEEE Std 1588-2008 Clause 7.6.2.3.

When you select the Show advanced configuration parameters check box, Priority 2 is visible.

Programmatic Use

Block Parameter: priority2

Introduced in R2015b