{
  "schemaVersion": 1,
  "metadata": {
    "format": "plcsim.fbd-program",
    "exportedAt": "2026-06-17T00:00:00.000Z",
    "language": "FBD",
    "nodeCount": 7,
    "connectionCount": 5
  },
  "editorGraph": {
    "id": "graph-emergency-level-alarm",
    "language": "FBD",
    "version": 1,
    "viewport": {
      "x": 0,
      "y": 0,
      "zoom": 1
    },
    "nodeDefinitions": [
      {
        "id": "def-in",
        "blockType": "IN",
        "displayName": "Input",
        "stateful": false,
        "inputPorts": [],
        "outputPorts": [
          {
            "id": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": null
          }
        ]
      },
      {
        "id": "def-or",
        "blockType": "OR",
        "displayName": "OR",
        "stateful": false,
        "inputPorts": [
          {
            "id": "in1",
            "name": "IN1",
            "direction": "IN",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": 1
          },
          {
            "id": "in2",
            "name": "IN2",
            "direction": "IN",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": 1
          }
        ],
        "outputPorts": [
          {
            "id": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": null
          }
        ]
      },
      {
        "id": "def-sr",
        "blockType": "SR",
        "displayName": "SR",
        "stateful": true,
        "inputPorts": [
          {
            "id": "s",
            "name": "S",
            "direction": "IN",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": 1
          },
          {
            "id": "r",
            "name": "R",
            "direction": "IN",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": 1
          }
        ],
        "outputPorts": [
          {
            "id": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": null
          }
        ]
      },
      {
        "id": "def-out",
        "blockType": "OUT",
        "displayName": "Output",
        "stateful": false,
        "inputPorts": [
          {
            "id": "in",
            "name": "IN",
            "direction": "IN",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": 1
          }
        ],
        "outputPorts": []
      }
    ],
    "nodes": [
      {
        "id": "node-0001",
        "definitionId": "def-in",
        "label": "Level_High",
        "position": {
          "x": 80,
          "y": 80
        },
        "ports": [
          {
            "id": "node-0001:q",
            "nodeId": "node-0001",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "node-0002",
        "definitionId": "def-in",
        "label": "Level_Low",
        "position": {
          "x": 80,
          "y": 190
        },
        "ports": [
          {
            "id": "node-0002:q",
            "nodeId": "node-0002",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "node-0003",
        "definitionId": "def-in",
        "label": "Manual_Reset",
        "position": {
          "x": 80,
          "y": 360
        },
        "ports": [
          {
            "id": "node-0003:q",
            "nodeId": "node-0003",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "node-0004",
        "definitionId": "def-or",
        "label": "Alarm_OR",
        "position": {
          "x": 330,
          "y": 135
        },
        "ports": [
          {
            "id": "node-0004:in1",
            "nodeId": "node-0004",
            "definitionPortId": "in1",
            "name": "IN1",
            "direction": "IN",
            "signalType": "BOOL"
          },
          {
            "id": "node-0004:in2",
            "nodeId": "node-0004",
            "definitionPortId": "in2",
            "name": "IN2",
            "direction": "IN",
            "signalType": "BOOL"
          },
          {
            "id": "node-0004:q",
            "nodeId": "node-0004",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "node-0005",
        "definitionId": "def-sr",
        "label": "Alarm_Latch",
        "position": {
          "x": 570,
          "y": 210
        },
        "ports": [
          {
            "id": "node-0005:s",
            "nodeId": "node-0005",
            "definitionPortId": "s",
            "name": "S",
            "direction": "IN",
            "signalType": "BOOL"
          },
          {
            "id": "node-0005:r",
            "nodeId": "node-0005",
            "definitionPortId": "r",
            "name": "R",
            "direction": "IN",
            "signalType": "BOOL"
          },
          {
            "id": "node-0005:q",
            "nodeId": "node-0005",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "node-0006",
        "definitionId": "def-out",
        "label": "Level_Alarm",
        "position": {
          "x": 830,
          "y": 250
        },
        "ports": [
          {
            "id": "node-0006:in",
            "nodeId": "node-0006",
            "definitionPortId": "in",
            "name": "IN",
            "direction": "IN",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "comment-0001",
        "type": "comment",
        "position": {
          "x": 315,
          "y": 430
        },
        "data": {
          "text": "Аварийная сигнализация уровня: Level_High OR Level_Low устанавливают защёлку. Manual_Reset сбрасывает аварию, но при активной аварии SR снова удерживает выход Level_Alarm.",
          "width": 520,
          "height": 100
        }
      }
    ],
    "connections": [
      {
        "id": "edge-0001",
        "sourceNodeId": "node-0001",
        "sourcePortId": "node-0001:q",
        "targetNodeId": "node-0004",
        "targetPortId": "node-0004:in1",
        "signalType": "BOOL"
      },
      {
        "id": "edge-0002",
        "sourceNodeId": "node-0002",
        "sourcePortId": "node-0002:q",
        "targetNodeId": "node-0004",
        "targetPortId": "node-0004:in2",
        "signalType": "BOOL"
      },
      {
        "id": "edge-0003",
        "sourceNodeId": "node-0004",
        "sourcePortId": "node-0004:q",
        "targetNodeId": "node-0005",
        "targetPortId": "node-0005:s",
        "signalType": "BOOL"
      },
      {
        "id": "edge-0004",
        "sourceNodeId": "node-0003",
        "sourcePortId": "node-0003:q",
        "targetNodeId": "node-0005",
        "targetPortId": "node-0005:r",
        "signalType": "BOOL"
      },
      {
        "id": "edge-0005",
        "sourceNodeId": "node-0005",
        "sourcePortId": "node-0005:q",
        "targetNodeId": "node-0006",
        "targetPortId": "node-0006:in",
        "signalType": "BOOL"
      }
    ]
  }
}