{
  "node": {
    "id": "block:native-enabled-triggered-submodel",
    "type": "Block",
    "label": "Enabled and triggered kernel",
    "properties": {
      "id": "native-enabled-triggered-submodel",
      "name": "Enabled and triggered kernel",
      "kind": "studio",
      "summary": "Tracks every trigger edge, including while disabled, and executes only enabled edges; disabled edges are never replayed.",
      "behavior": "Tracks every trigger edge, including while disabled, and executes only enabled edges; disabled edges are never replayed. Outputs are held between accepted samples; numerical evaluation does not commit hidden state.",
      "ports": [
        {
          "name": "in0",
          "direction": "input",
          "unit": "—",
          "description": "Value; real scalar."
        },
        {
          "name": "in1",
          "direction": "input",
          "unit": "—",
          "description": "Enabled; bool scalar."
        },
        {
          "name": "in2",
          "direction": "input",
          "unit": "—",
          "description": "Trigger; bool scalar."
        },
        {
          "name": "out0",
          "direction": "output",
          "unit": "—",
          "description": "Integral; real scalar."
        },
        {
          "name": "out1",
          "direction": "output",
          "unit": "—",
          "description": "Invocations this sample; u32 scalar."
        }
      ],
      "parameters": [
        {
          "key": "sampleTimeS",
          "label": "Sample period",
          "unit": "s",
          "default": 1,
          "min": 0,
          "description": "Positive interval between accepted control samples. Outputs hold between these instants."
        },
        {
          "key": "params[0]",
          "label": "Trigger edge",
          "unit": "—",
          "default": 0,
          "description": "0 rising; 1 falling; 2 either edge."
        },
        {
          "key": "params[1]",
          "label": "Reset on enable",
          "unit": "—",
          "default": 0,
          "description": "0 retain child memory; 1 reset on enable transition."
        },
        {
          "key": "nested",
          "label": "Child operation",
          "unit": "—",
          "default": "Discrete integrator",
          "description": "One configurable native computation operation. Its declared input/output types must match the wrapper."
        },
        {
          "key": "tables[0]",
          "label": "Initial held outputs",
          "unit": "—",
          "default": [
            0
          ],
          "description": "Initial values for all child output lanes, in output order. For independent elements, supply one value per element."
        }
      ],
      "equations": [
        "fire = enabled && selectedTriggerEdge",
        "Track previousTrigger on every sample, including disabled samples"
      ],
      "example": {
        "title": "Enabled and triggered kernel worked example",
        "text": "Default editable example at the first accepted sample (t = 0 s). Child operation: discrete integrator. The output checks below are execution oracles for this example.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-enabled-triggered-submodel",
        "label": "Open Studio example",
        "inputs": [
          {
            "port": "in0",
            "label": "Value",
            "value": 2,
            "unit": "—"
          },
          {
            "port": "in1",
            "label": "Enabled",
            "value": 1,
            "unit": "—"
          },
          {
            "port": "in2",
            "label": "Trigger",
            "value": 1,
            "unit": "—"
          }
        ],
        "checks": [
          {
            "port": "out0",
            "label": "Integral",
            "atS": 0,
            "value": 2,
            "unit": "—",
            "tolerance": 1e-08
          },
          {
            "port": "out1",
            "label": "Invocations this sample",
            "atS": 0,
            "value": 1,
            "unit": "—",
            "tolerance": 1e-08
          }
        ]
      },
      "limits": [
        "Control executes on an explicit sampled clock. Continuous states, history/delay kernels, residual equations, and event-source children are not supported.",
        "The wrapper contains one original computation operation; arbitrary multi-block submodels are not supported.",
        "A sampled child advances once per invocation using its own declared period. Repeated calls share the same outer timestamp and do not advance physical time.",
        "A trigger edge seen while disabled is consumed and is not replayed when enable becomes true."
      ],
      "references": [
        "control-statecharts"
      ],
      "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-enabled-triggered-submodel"
      ],
      "exampleTraces": [
        {
          "id": "native-enabled-triggered-submodel",
          "url": "https://lemonergy.com/learn/glossary/api/traces/native-enabled-triggered-submodel.json?v=a89548bf0511",
          "title": "Enabled and triggered kernel recorded example",
          "exampleId": "block-native-enabled-triggered-submodel",
          "source": "Executed synthetic Lemonergy Studio example",
          "recordedOn": "2026-10-28",
          "points": 3,
          "channels": 2,
          "omittedChannels": 0,
          "interpolation": "step",
          "solver": {
            "method": "dormand-prince-45",
            "reason": "no-continuous-states"
          }
        }
      ],
      "type": "native-enabled-triggered-submodel",
      "implementationId": "native-enabled-triggered-submodel",
      "url": "https://lemonergy.com/learn/glossary/blocks/native-enabled-triggered-submodel/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/native-enabled-triggered-submodel/",
      "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-enabled-triggered-submodel"
        ]
      }
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/native-native-enabled-triggered-submodel/0",
      "type": "usesBlock",
      "source": "workflow:native-native-enabled-triggered-submodel",
      "target": "block:native-enabled-triggered-submodel",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Enabled and triggered kernel",
        "type": "native-enabled-triggered-submodel",
        "role": "Tracks every trigger edge, including while disabled, and executes only enabled edges; disabled edges are never replayed. Outputs are held between accepted samples; numerical evaluation does not commit hidden 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-enabled-triggered-submodel/reference:control-statecharts",
      "type": "cites",
      "source": "block:native-enabled-triggered-submodel",
      "target": "reference:control-statecharts",
      "properties": {
        "sourceFile": "block-library.json",
        "scope": "Scientific or mathematical background; implementation scope is stated by the block contract"
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:native-native-enabled-triggered-submodel",
      "type": "Workflow",
      "label": "Enabled and triggered kernel worked example",
      "properties": {
        "id": "native-native-enabled-triggered-submodel",
        "title": "Enabled and triggered kernel worked example",
        "kind": "studio",
        "summary": "Tracks every trigger edge, including while disabled, and executes only enabled edges; disabled edges are never replayed.",
        "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": "Default editable example at the first accepted sample (t = 0 s). Child operation: discrete integrator. The output checks below are execution oracles for this example.",
        "observe": "Inspect the output channels and checks on the block reference page.",
        "limits": "Control executes on an explicit sampled clock. Continuous states, history/delay kernels, residual equations, and event-source children are not supported. The wrapper contains one original computation operation; arbitrary multi-block submodels are not supported. A sampled child advances once per invocation using its own declared period. Repeated calls share the same outer timestamp and do not advance physical time. A trigger edge seen while disabled is consumed and is not replayed when enable becomes true.",
        "url": "https://design.lemonergy.com/cosim.html?example=block-native-enabled-triggered-submodel",
        "label": "Open Studio example",
        "evidence": [
          "docs/glossary/native-block-verification.json"
        ]
      }
    },
    {
      "id": "reference:control-statecharts",
      "type": "Reference",
      "label": "Statecharts: A visual formalism for complex systems",
      "properties": {
        "title": "Statecharts: A visual formalism for complex systems",
        "authors": [
          "David Harel"
        ],
        "year": 1987,
        "doi": "10.1016/0167-6423(87)90035-9",
        "url": "https://www.weizmann.ac.il/math/harel/sites/math.harel/files/users/user50/Statecharts.pdf",
        "type": "Research article",
        "scope": "Background on explicit states and events. Lemonergy bounded control blocks are not a complete Statecharts implementation.",
        "accessed": "2026-10-27",
        "publisher": "Science of Computer Programming, 8(3), 231–274"
      }
    }
  ]
}
