{
  "schemaVersion": 1,
  "metadata": {
    "format": "plcsim.fbd-program",
    "exportedAt": "2026-06-17T00:00:00.000Z",
    "language": "FBD",
    "nodeCount": 5,
    "connectionCount": 3
  },
  "editorGraph": {
    "id": "graph-main",
    "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-xor",
        "blockType": "XOR",
        "displayName": "XOR",
        "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-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": "Position_A",
        "position": {
          "x": 80,
          "y": 90
        },
        "ports": [
          {
            "id": "node-0001:q",
            "nodeId": "node-0001",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "node-0002",
        "definitionId": "def-in",
        "label": "Position_B",
        "position": {
          "x": 80,
          "y": 210
        },
        "ports": [
          {
            "id": "node-0002:q",
            "nodeId": "node-0002",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "node-0003",
        "definitionId": "def-xor",
        "label": "XOR",
        "position": {
          "x": 340,
          "y": 150
        },
        "ports": [
          {
            "id": "node-0003:in1",
            "nodeId": "node-0003",
            "definitionPortId": "in1",
            "name": "IN1",
            "direction": "IN",
            "signalType": "BOOL"
          },
          {
            "id": "node-0003:in2",
            "nodeId": "node-0003",
            "definitionPortId": "in2",
            "name": "IN2",
            "direction": "IN",
            "signalType": "BOOL"
          },
          {
            "id": "node-0003:q",
            "nodeId": "node-0003",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "node-0004",
        "definitionId": "def-out",
        "label": "Sensor_Mismatch",
        "position": {
          "x": 610,
          "y": 150
        },
        "ports": [
          {
            "id": "node-0004:in",
            "nodeId": "node-0004",
            "definitionPortId": "in",
            "name": "IN",
            "direction": "IN",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "comment-0001",
        "type": "comment",
        "position": {
          "x": 80,
          "y": 340
        },
        "data": {
          "text": "Контроль рассогласования двух датчиков положения. Position_A и Position_B должны иметь одинаковое состояние. Блок XOR выдаёт TRUE только когда сигналы отличаются: один датчик TRUE, второй FALSE. В этом случае включается диагностический выход Sensor_Mismatch.",
          "width": 620,
          "height": 120
        }
      }
    ],
    "connections": [
      {
        "id": "edge-0001",
        "sourceNodeId": "node-0001",
        "sourcePortId": "node-0001:q",
        "targetNodeId": "node-0003",
        "targetPortId": "node-0003:in1",
        "signalType": "BOOL"
      },
      {
        "id": "edge-0002",
        "sourceNodeId": "node-0002",
        "sourcePortId": "node-0002:q",
        "targetNodeId": "node-0003",
        "targetPortId": "node-0003:in2",
        "signalType": "BOOL"
      },
      {
        "id": "edge-0003",
        "sourceNodeId": "node-0003",
        "sourcePortId": "node-0003:q",
        "targetNodeId": "node-0004",
        "targetPortId": "node-0004:in",
        "signalType": "BOOL"
      }
    ]
  }
}