This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

SimulinkRealTime.utils.getTargetSystemTime

Gets the current value of the target computer system clock

Syntax

date_vector = SimulinkRealTime.utils.getTargetSystemTime
date_vector = SimulinkRealTime.utils.getTargetSystemTime(target_object)

Description

example

date_vector = SimulinkRealTime.utils.getTargetSystemTime returns the system time of the default target computer as a date vector. The target computer must be running and in communication with the development computer.

example

date_vector = SimulinkRealTime.utils.getTargetSystemTime(target_object) returns the system time of the specified target computer as a date vector.

Examples

collapse all

Return the system time of the default target computer as a date vector.

date_vector = SimulinkRealTime.utils.getTargetSystemTime
date_vector =

  Columns 1 through 4

        2015          11           4          14

  Columns 5 through 6

          37          34

Return the system time of target computer 'TargetPC1' as a date vector.

target_object = SimulinkRealTime.target('TargetPC1');
date_vector = ...
     SimulinkRealTime.utils.getTargetSystemTime(target_object)
date_vector =

  Columns 1 through 4

        2015          11           4          14

  Columns 5 through 6

          39          45

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

Output Arguments

collapse all

Date and time as returned by the datevec function

Example: [2015, 11, 5, 14, 15, 0]

Data Types: double

Introduced in R2016a