﻿# FMI communication steps: advance from returned time, not the requested endpoint

Interpret earlyReturn, eventHandlingNeeded and lastSuccessfulTime separately when coordinating an FMI Co-Simulation communication step.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/simulation-fmi-do-step-returned-time-not-requested-end/
Language: en

## A requested endpoint is an intention

A coupled plant model asks a component to advance across a communication interval, then stamps its output with the requested end time. If the component stopped sooner, the coordinator now combines values from different model times. The defect can survive ordinary success logging. Treat the requested endpoint as an intention and the returned progress as evidence. The coordinator needs a policy for reconciling component times before publishing a supposedly synchronized observation to a controller.

## Read independent return channels

The [step declaration](https://raw.githubusercontent.com/modelica/fmi-standard/v3.0.2/headers/fmi3FunctionTypes.h) exposes separate outputs for event handling, termination, early return and last successful time. They are not synonyms for a single completion flag. The [specification](https://fmi-standard.org/docs/3.0.2/) permits early return only when allowed at instantiation. It also distinguishes an early return from a numerical error. Do not convert every incomplete interval into a recoverable event or suppress an error by labeling it an ordinary short step.

## Even ordinary success needs its returned time

The specification states that lastSuccessfulTime represents internal time for either early-return value. It can differ from the expected endpoint even when the function succeeds without early return, for example because an internal integration scheme cannot land exactly on the requested instant. Therefore, simply checking that early return is false is insufficient. Preserve the reported time and apply the coupling method’s declared synchronization policy rather than silently overwriting the result with a more convenient timestamp.

## Handle an event without assuming time advanced

An allowed early return may report the current communication point itself, such as when an event is detected there. A proposed fixture should exercise this case separately from a shorter positive advance. The coordinator should perform the required event protocol, honor termination and detect an unresolved lack of progress. Blindly retrying the same request can create an endless loop; incrementing time artificially changes the model. No coupled FMU experiment was executed here.

## Retain an alignment trace

Acceptance evidence should include requested start and interval, function status, defined output flags, actual returned time and the coordinator’s next action. Include a normal advance, a permitted early return and a termination request. Verify that downstream output is not assigned to a time the component never reported reaching. Define permissible numerical alignment differences from the coupling method; do not invent a universal tolerance merely to make every trace appear synchronized.

## Time alignment is only part of coupling quality

The [transaction-boundary study](/journal/batchweave-transactional-batches-recovery-resource-boundaries/) explains a neighboring completion problem; [stack reproducibility](/journal/software-stack-reproducibility/) helps retain importer and FMU revisions. A correct alignment trace establishes how progress was interpreted. It does not prove that the communication interval is sufficiently small, the coupling is stable or the model matches a real plant. Those numerical and physical claims require additional convergence checks and independent reference evidence.
