{
  "node": {
    "id": "block:native-parameter-writer",
    "type": "Block",
    "label": "Scoped parameter writer",
    "properties": {
      "id": "native-parameter-writer",
      "name": "Scoped parameter writer",
      "kind": "studio",
      "summary": "Writes a stored parameter of one declared child at accepted samples, then executes that child with the updated parameter.",
      "behavior": "Writes a stored parameter of one declared child at accepted samples, then executes that child with the updated parameter. Trial evaluations read the held output without mutating state.",
      "ports": [
        {
          "name": "in0",
          "direction": "input",
          "unit": "—",
          "description": "Value; real scalar."
        },
        {
          "name": "in1",
          "direction": "input",
          "unit": "—",
          "description": "New parameter value; real scalar."
        },
        {
          "name": "in2",
          "direction": "input",
          "unit": "—",
          "description": "Write enabled; bool scalar."
        },
        {
          "name": "out0",
          "direction": "output",
          "unit": "—",
          "description": "Scaled; real scalar."
        },
        {
          "name": "out1",
          "direction": "output",
          "unit": "—",
          "description": "Applied parameter value; real scalar."
        },
        {
          "name": "out2",
          "direction": "output",
          "unit": "—",
          "description": "Write accepted; bool scalar."
        }
      ],
      "parameters": [
        {
          "key": "sampleTimeS",
          "label": "Sample period",
          "unit": "s",
          "default": 1,
          "description": "Positive period between accepted updates; outputs hold between updates."
        },
        {
          "key": "tables[0]",
          "label": "Initial held output",
          "unit": "—",
          "default": [
            0
          ],
          "description": "Output held before the first accepted update, with one value per output lane."
        },
        {
          "key": "nested",
          "label": "Declared child operation",
          "unit": "—",
          "default": "Adjustable gain",
          "description": "The locally owned target operation. Its parameters, initial state, and typed ports are configured explicitly."
        }
      ],
      "equations": [
        "On an enabled write: stored parameter ← new value",
        "Execute the declared child using the stored parameter; retain that parameter while writes are disabled",
        "For a gain child: y = stored gain × input"
      ],
      "example": {
        "title": "Scoped parameter writer worked example",
        "text": "Input 3 and an enabled gain write of 5 produce output 15. Later samples retain gain 5 when the write flag is false.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-parameter-writer",
        "label": "Open Studio example",
        "inputs": [
          {
            "port": "in0",
            "label": "Value",
            "value": 3,
            "unit": "—"
          },
          {
            "port": "in1",
            "label": "New parameter value",
            "value": 5,
            "unit": "—"
          },
          {
            "port": "in2",
            "label": "Write enabled",
            "value": 1,
            "unit": "—"
          }
        ],
        "checks": [
          {
            "port": "out0",
            "label": "Scaled",
            "atS": 0,
            "value": 15,
            "unit": "—",
            "tolerance": 1e-08
          },
          {
            "port": "out1",
            "label": "Applied parameter value",
            "atS": 0,
            "value": 5,
            "unit": "—",
            "tolerance": 1e-08
          },
          {
            "port": "out2",
            "label": "Write accepted",
            "atS": 0,
            "value": 1,
            "unit": "—",
            "tolerance": 1e-08
          }
        ]
      },
      "limits": [
        "One explicitly configured gain, bias, or discrete-integrator gain is writable. There is no arbitrary external-block lookup, global parameter mutation, or structural reconfiguration.",
        "Writes occur before the child executes at the accepted sample. Child memory persists across writes. A failed child evaluation commits neither the parameter nor child memory.",
        "The write port carries the numeric parameter value; no unit conversion is performed. A discrete child advances once per wrapper invocation using its declared period."
      ],
      "references": [
        "control-dataflow"
      ],
      "availability": {
        "status": "released",
        "label": "Available in Lemonergy Studio",
        "detail": "The bundled example is available in the production release verified on 28 October 2026. The parameters and examples here are synthetic teaching fixtures, not a characterized cell or a validated operating limit."
      },
      "evidence": [
        "docs/glossary/native-block-verification.json"
      ],
      "sourceRepository": "Lemonergy Studio public contract",
      "sourceRevision": "verification-2026-10-27",
      "caseIds": [
        "native-native-parameter-writer"
      ],
      "exampleTraces": [
        {
          "id": "native-parameter-writer",
          "url": "https://lemonergy.com/learn/glossary/api/traces/native-parameter-writer.json?v=080bfb5bce69",
          "title": "Scoped parameter writer recorded example",
          "exampleId": "block-native-parameter-writer",
          "source": "Executed synthetic Lemonergy Studio example",
          "recordedOn": "2026-10-28",
          "points": 3,
          "channels": 3,
          "omittedChannels": 0,
          "interpolation": "step",
          "solver": {
            "method": "dormand-prince-45",
            "reason": "no-continuous-states"
          }
        }
      ],
      "type": "native-parameter-writer",
      "implementationId": "native-parameter-writer",
      "url": "https://lemonergy.com/learn/glossary/blocks/native-parameter-writer/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/native-parameter-writer/",
      "sourceFile": "block-library.json",
      "reviewed": "2026-10-27",
      "releaseEvidence": {
        "environment": "production",
        "status": "verified",
        "revision": "e76cadfc203e15eb41f3478d8b1044a5b851953d",
        "verifiedOn": "2026-10-28",
        "exampleUrls": [
          "https://design.lemonergy.com/cosim.html?example=block-native-parameter-writer"
        ]
      }
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/native-native-parameter-writer/0",
      "type": "usesBlock",
      "source": "workflow:native-native-parameter-writer",
      "target": "block:native-parameter-writer",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Scoped parameter writer",
        "type": "native-parameter-writer",
        "role": "Writes a stored parameter of one declared child at accepted samples, then executes that child with the updated parameter. Trial evaluations read the held output without mutating state.",
        "settings": [
          "Use the block reference for settings and connections.",
          "Bundled example verified on the production release of 28 October 2026."
        ]
      }
    }
  ],
  "outgoing": [
    {
      "id": "edge:cites/block:native-parameter-writer/reference:control-dataflow",
      "type": "cites",
      "source": "block:native-parameter-writer",
      "target": "reference:control-dataflow",
      "properties": {
        "sourceFile": "block-library.json",
        "scope": "Scientific or mathematical background; implementation scope is stated by the block contract"
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:native-native-parameter-writer",
      "type": "Workflow",
      "label": "Scoped parameter writer worked example",
      "properties": {
        "id": "native-native-parameter-writer",
        "title": "Scoped parameter writer worked example",
        "kind": "studio",
        "summary": "Writes a stored parameter of one declared child at accepted samples, then executes that child with the updated parameter.",
        "steps": [
          "Review the interface, units and model limits.",
          "Open the Studio example and run its bundled model.",
          "Compare outputs with the numerical checks; change one input and run again."
        ],
        "example": "Input 3 and an enabled gain write of 5 produce output 15. Later samples retain gain 5 when the write flag is false.",
        "observe": "Inspect the output channels and checks on the block reference page.",
        "limits": "One explicitly configured gain, bias, or discrete-integrator gain is writable. There is no arbitrary external-block lookup, global parameter mutation, or structural reconfiguration. Writes occur before the child executes at the accepted sample. Child memory persists across writes. A failed child evaluation commits neither the parameter nor child memory. The write port carries the numeric parameter value; no unit conversion is performed. A discrete child advances once per wrapper invocation using its declared period.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-parameter-writer",
        "label": "Open Studio example",
        "evidence": [
          "docs/glossary/native-block-verification.json"
        ]
      }
    },
    {
      "id": "reference:control-dataflow",
      "type": "Reference",
      "label": "Synchronous Data Flow",
      "properties": {
        "title": "Synchronous Data Flow",
        "authors": [
          "Edward A. Lee",
          "David G. Messerschmitt"
        ],
        "year": 1987,
        "url": "https://ptolemy.berkeley.edu/publications/papers/87/index.htm",
        "publisher": "Proceedings of the IEEE, 75(9), 1235–1245",
        "type": "Research article",
        "scope": "Background on actor firing and explicit dataflow. The sampled conditional semantics documented here are Lemonergy design choices, not a claim of a complete SDF implementation.",
        "accessed": "2026-10-27"
      }
    }
  ]
}
