﻿# FMI setters: a matching data type does not make a variable writable

Gate FMI writes by causality, variability and current execution mode, especially when an editor exposes fixed parameters or observed local state.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/simulation-fmi-setter-causality-variability-mode-gate/
Language: en

## A numeric editor can expose an illegal operation

A twin control panel displays every numeric variable and adds an edit box because the library provides a compatible setter. The panel now offers writes to fixed parameters after initialization and to observed internal state. Neither follows from numeric type compatibility. Build editing permission from the variable’s semantic role and the current execution mode, then distinguish editable controls from inspectable values before a user can submit a change.

## Read role and variability independently

The [variable schema](https://raw.githubusercontent.com/modelica/fmi-standard/v3.0.2/schema/fmi3Variable.xsd) declares causality and variability independently of the storage type. The [specification](https://fmi-standard.org/docs/3.0.2/) then defines their meaning and allowed combinations. A parameter, input, output and local variable can share a representation while exposing different responsibilities. Parsing an accepted attribute name is not sufficient semantic validation. Retain these attributes in the importer’s variable table and consult the instantiated interface’s state-machine rules before enabling a write path.

## Fixed and tunable do not mean the same thing

A fixed value no longer changes after initialization has been exited. A tunable parameter has defined update boundaries, such as Event Mode where used or communication points for applicable interfaces. It is not freely mutable during arbitrary computation. Likewise, initialized local variables are not a generic input channel. An importer must not promise direct arbitrary state editing simply because it can observe a value through a getter and serialize it into the setter’s argument type.

## Propose a mode-aware editor fixture

A proposed fixture should expose a fixed parameter, a tunable parameter and an input, retaining their declarations. Attempt changes at documented legal boundaries, and verify that the application blocks unsupported requests before issuing them. Record the current mode and intended transition with every accepted change. Include an observation-only value so the interface cannot accidentally classify every visible number as writable. No FMU or graphical editor was executed for this article.

## Do not hide a reset behind a parameter edit

If a desired change requires reinitialization or a different model export, present that as a separate operation with an explicit state consequence. Silently rebuilding the component can discard accumulated state while the dashboard appears to perform an ordinary live adjustment. Acceptance should compare the requested edit, permitted mode, actual operation and resulting lifecycle transition. A successful numeric readback alone cannot show that the system preserved the continuation semantics promised to the operator.

## Separate legal assignment from model calibration

The [Mitsuba parameter guide](/journal/fg2-mitsuba-scene-parameter-update-propagation/) addresses propagation after a permitted edit; [stack reproducibility](/journal/software-stack-reproducibility/) supports retaining exported declarations. Here acceptance establishes a legal FMI write path. It does not show that the selected parameter is physically plausible, calibrated or safe for a real plant. Those judgments require domain evidence after the software can state precisely which value changed, in which mode and with which lifecycle consequence.
