Documentation search search close
CONTENTS
https://www.speedgoat.com/help/slrt/page/icon_documentation.jpg
v10.0.1.x for R2026a
View other versions

IO821 - Time Reference

IO821 - Time Reference — Configure the IO821 I/O module to trigger your model

Library

Simulink Real-Time - Speedgoat

Description

The time reference block enables you to configure the IO821 I/O module to trigger your model. It can also report the current time and date as well as status information.

Ports

The Time Reference driver block provides a set of output ports which can all be disabled to optimize the execution time.

More details about the execution time can be found in the "Dialog fields" section.

Output
Active Ref

Shows the number of the reference table entry which is currently selected by the module.

Sync State

Shows if the internal clock is in a synchronized state. This state is also indicated by the green LED on the front of the module. The module is synchronized when both the time and the pps inputs of an enabled reference table entry are considered valid.

Holdover State

Shows if the internal clock is in a holdover state. This state is also indicated by the orange LED on the front of the module. The module is in a holdover state when the time and/or pps inputs have been lost for a certain time and the module is running on its internal clock.

Alarm State

Shows if the module is in an alarm state. This state is also indicated by the red LED on the front of the module. The module can be in an alarm state for any of the following reasons: Frequency Error, Software Error, 1 PPS is not in specification, Hardware Error.

Time Datenum/Time Array

Represents the current date and time down to a resolution of 1 second read from the IO821 in MATLAB's datenum format (see 'doc datenum') Alternatively, an array output format can be selected, displaying the timing information in a [YYYY,MM,DD,hh,mm,ss] format.

Time Subsec/Time Usec of Year

Represents the fraction of the current second read from the IO821 with a resolution of 5 ns. Can take values from 0.000000000 to 0.999999995. When the array output format is selected, this output gives the value of the number microseconds of the current year.

GPI0 Trig Datenum/GPI0 Trig Array

Outputs the latest timestamp value received on the GPI0 Input. Displayed in either MATLAB datenum or time array format. (Refer to the "Time Datenum/Time Array" section above).

GPI0 Trig Subsec/GPI0 Trig Usec

Outputs the subsec/microseconds of the current year value of the latest GPI0 timestamp value.

GPI1 Trig Datenum/GPI1 Trig Array

Outputs the latest timestamp value received on the GPI1 Input. Displayed in either MATLAB datenum or time array format. (Refer to the "Time datenum/Time Array" section).

GPI1 Trig Subsec/GPI1 Trig Usec

Outputs the subsec/microseconds of the current year value of the latest GPI1 timestamp value.

Parameters

Main
PCI Slot (-1: auto-search)

There are two approaches for mapping this block to a specific I/O module installed in your target machine. All modules of the same type must be configured using the same method.

  • Auto-Search: with the default value -1 the I/O module will be automatically located in the target machine. If you have multiple modules of the same type, you must use explicit addressing.

  • Explicit Addressing: to explicitly define the logical address of the I/O module in the target machine, you can provide the PCI bus and slot numbers as a vector: [bus, slot]. To determine these numbers, run the following command in the MATLAB command window:

    speedgoat.getIoInterfaces("TargetName", "mySpeedgoat", "Advanced", true)

    Note that the PCI address can change whenever an I/O module is added or removed.

IO821 Module Identifier

This setting is currently not used because only one IO821 per target machine is supported.

Generate Periodic Interrupt

If this is enabled, the IO821 generates a precise periodic interrupt. The model settings must be adapted to run on the "Speedgoat IO821 INT" instead of the "Timer". When this option is enabled, the interrupt is present as a 5 V square wave on the External HW Sync Output pin, where the rising edge indicates the interrupt. This can be used to trigger an external system to run on the same sample rate as the Simulink Real-Time model.

Period in Nanoseconds

Defines the time period between two consecutive interrupts in integer nanoseconds. An interrupt every ts seconds is generated by setting the period in nanoseconds to 1e9.

Duty Cycle in %

Defines the percentage value of the generated square wave signal based on the selected interrupt. Accepted values range from 5 to 95 %.

Periodic Interrupt Lead Time [s]

This value in seconds delays the first spike of the periodic interrupt, triggering the model start. If the IO821 is selected as interrupt source for the model, this can be used to ensure that the entire initialization, for example, of external hardware, can happen before the model is started.

Show Synchronization State

If enabled, a boolean output port is added to the driver block. It shows if the internal clock is in a synchronized state. This state is also indicated by the green LED on the front of the module. The module is synchronized when both the time and the 1 PPS inputs of an enabled reference table entry are considered valid. See the Input References tab below. Keep in mind that up to 25 µs are added to the model execution time when this feature is enabled. Without any output ports it executes in less than 1 µs.

Show Holdover State

If enabled, a boolean output port is added to the driver block. It shows if the internal clock is in a holdover state. This state is also indicated by the orange LED on the front of the module. The module is in holdover state when there are no valid timing inputs or GNSS available for phase-locking and the crystal oscillator is "freewheeling". Bear in mind that up to 7 ms are added to the model execution time when this feature is enabled. Without any output ports it executes in less than 1 µs.

Show Alarm State

If enabled, a boolean output port is added to the driver block. It shows if the module is in an alarm state. This state is also indicated by the red LED on the front of the module. The module may be in an alarm state for any of the following reasons: Frequency Error, Software Error, 1 PPS is not specified, Hardware Error. Bear in mind that up to 10 ms are added to the model execution time when this feature is enabled (this includes getting the current time as well). Without any output ports it executes in less than 1 µs.

Show Current Time

If enabled, two output ports of type double are added to the driver block. They represent the current time reported by the module when the IO821 Time Reference block is executed. 'Time datenum' represents the date and time in MATLAB's datenum format (see 'doc datenum'). The values are always rounded down to the next whole second. 'Time subsec' represents the fraction of the current second with a resolution of 5 ns. It ranges from 0.000000000 to 0.999999995. Bear in mind that up to 25 µs are added to the model execution time when this feature is enabled (this includes getting the sync state as well). Without any output ports it executes in less than 1 µs.

Current Time Output Format

This option defines the format of the current time output. Either [YYYY,MM,DD,hh,mm,ss]/microseconds of year or MATLAB datenum/subsec can be selected.

Time Zone and DST Offset in Hours

This parameter defines the combined offset from UTC, including both time zone and daylight saving time. It is used for setting the initial module time and for representing the time on the output ports.

Initial Module Time [datenum]

This parameter can be used to set the module's time and date using MATLAB's datenum format. The datenum function can be used here for convenience. The setting is applied when the model execution is started. If the value is zero, the module is not updated.

Activate GPI0 Edge Detection

This activates the Edge detection feature on GPI 0. Whenever a change of the voltage level on the input according to the selected signal edge occurs, the timestamp value can be read out at the GPI0 block output.

Activate GPI1 Edge Detection

This activates the Edge detection feature on GPI 1. Whenever a change of the voltage level on the input according to the selected signal edge occurs, the timestamp value can be read out at the GPI1 block output.

Edge Detection Output Format

This option defines the format of the edge detection timestamp outputs. Either [YYYY,MM,DD,hh,mm,ss]/microseconds of year or MATLAB datenum/subsec can be selected.

GPI0 Signal Edge

Arms the edge detection on GPI 0 on either rising or falling edge.

GPI1 Signal Edge

Arms the edge detection on GPI 1 on either rising or falling edge.

Enable GPO2 HW Trigger

This Checkbox enables the Hardware Trigger on the GPO2 Pin. Note that this feature only works if the IO821 is used as an interrupt source.

GPO2 HW Trigger Lead Time [s]

This value in seconds controls the time of the HW Trigger on GPO2. At the given value in seconds, the HW Trigger produces a rising edge burst with a 5 seconds high state time, before returning to low state.

Enable GPO3 HW Trigger

This Checkbox enables the Hardware Trigger on the GPO3 Pin. Note that this feature only works if the IO821 is used as an interrupt source.

GPO2 HW Trigger Lead Time [s]

This value in seconds controls the time of the HW Trigger on GPO2. At the given value in seconds, the HW Trigger produces a rising edge burst with a 5 seconds high state time, before returning to low state.

Enable IRIG Output

If enabled, the IO821 outputs an IRIG AM and IRIG DCLS signal on the respective output pins.

IRIG Output Lead Time [s]

This value in seconds delays the start of the IRIG AM output. This can be used to ensure that the entire initialization, for example, of external hardware, can happen before the hardware receives any timing information.

IRIG Expression

This dropdown defines the IRIG expression format.

Control Field Configuration

This dropdown defines the IRIG control field configuration.

Input Reference

This tab contains the configuration of the module's input reference table. The IO821 will always use the entry where both the time and the 1 PPS reference are considered valid. If this is true for more than one entry, the driver chooses the entry with the highest priority (lowest number).

Enable

Defines if the entry is enabled. It will not be selected otherwise.

Priority

Defines the priority of the entry. A value of '1' is the highest priority. Do not use the same number twice.

Time Ref

Defines which input reference is used for time and date. Only 'GNSS' provides complete date information including the year. 'Initial Module Time' refers to the parameter on the main tab. If this is not enabled, the setting at model start will fail.

1PPS Ref

Defines which timing input is used for phase-locking the internal crystal oscillator.

Show Active Reference

If enabled, an output port is added to the driver block, which represents the table entry number which is currently selected by the module.

[Caution]Caution

Bear in mind that up to 7 ms are added to the model execution time when this feature is enabled. Without any output ports, the model executes in less than 1 us.