Skip to content

When to "get" Clocks and Clocked Variables #2079

@MarioHarter

Description

@MarioHarter

Hello FMI Designers,

I am wondering when calls to fmi3GetClock and fmi3GetTYPE (for clocked variables) are supposed to / allowed to happen. I am only considering CoSim FMUs here.

My confusion comes from the Event Mode code example (https://fmi-standard.org/docs/3.0.2/#_event_mode), which calls recordVariables right before entering Event Mode and does not call recordVariables while in Event Mode. From the standard I read:

setting and getting of clocked variables is only allowed during Event Mode when their respective Clocks are active
(...)
During Step Mode, clocked variables can not be set or get because Clocks are only active during Event Mode.

My questions are:

  1. Is the placement of recordVariables in the Event Mode example an oversight, or was it intentional because that example does not consider clocked variables?
  2. Is my assumption correct that the calls to recordVariables and applyDiscreteInputs in the example implicitly include clocks?

The question came up when I wondered if/how I could do a simple "triggered clock echo", in the sense of triggering an input clock and getting a ticking output clock at the same timestamp.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions