{
  "schemaVersion": 1,
  "metadata": {
    "format": "plcsim.fbd-program",
    "exportedAt": "2026-06-17T11:30:00.000Z",
    "language": "FBD",
    "nodeCount": 4,
    "connectionCount": 2
  },
  "editorGraph": {
    "id": "graph-main",
    "language": "FBD",
    "version": 1,
    "viewport": {
      "x": 0,
      "y": 0,
      "zoom": 1
    },
    "nodeDefinitions": [
      {
        "id": "def-in",
        "blockType": "IN",
        "displayName": "Input",
        "description": "Читает входной сигнал",
        "stateful": false,
        "inputPorts": [],
        "outputPorts": [
          {
            "id": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": null
          }
        ]
      },
      {
        "id": "def-tof",
        "blockType": "TOF",
        "displayName": "TOF",
        "description": "Off-delay timer",
        "stateful": true,
        "inputPorts": [
          {
            "id": "in",
            "name": "IN",
            "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",
        "description": "Записывает выходной сигнал",
        "stateful": false,
        "inputPorts": [
          {
            "id": "in",
            "name": "IN",
            "direction": "IN",
            "signalType": "BOOL",
            "required": true,
            "maxConnections": 1
          }
        ],
        "outputPorts": []
      }
    ],
    "nodes": [
      {
        "id": "node-0001",
        "definitionId": "def-in",
        "label": "Light_Command",
        "position": {
          "x": 80,
          "y": 120
        },
        "ports": [
          {
            "id": "node-0001:q",
            "nodeId": "node-0001",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "node-0002",
        "definitionId": "def-tof",
        "label": "TOF_Light_Delay",
        "position": {
          "x": 300,
          "y": 105
        },
        "ports": [
          {
            "id": "node-0002:in",
            "nodeId": "node-0002",
            "definitionPortId": "in",
            "name": "IN",
            "direction": "IN",
            "signalType": "BOOL"
          },
          {
            "id": "node-0002:q",
            "nodeId": "node-0002",
            "definitionPortId": "q",
            "name": "Q",
            "direction": "OUT",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {
          "PT_SCANS": 100
        }
      },
      {
        "id": "node-0003",
        "definitionId": "def-out",
        "label": "Light_Output",
        "position": {
          "x": 560,
          "y": 120
        },
        "ports": [
          {
            "id": "node-0003:in",
            "nodeId": "node-0003",
            "definitionPortId": "in",
            "name": "IN",
            "direction": "IN",
            "signalType": "BOOL"
          }
        ],
        "parameterValues": {}
      },
      {
        "id": "comment-0001",
        "type": "comment",
        "position": {
          "x": 80,
          "y": 230
        },
        "data": {
          "text": "Логика: Light_Command -> TOF -> Light_Output. Пока команда активна, освещение включено сразу. После снятия команды блок TOF удерживает выход Light_Output еще установленное время, затем отключает освещение.",
          "width": 420,
          "height": 110
        }
      }
    ],
    "connections": [
      {
        "id": "edge-0001",
        "sourceNodeId": "node-0001",
        "sourcePortId": "node-0001:q",
        "targetNodeId": "node-0002",
        "targetPortId": "node-0002:in",
        "signalType": "BOOL"
      },
      {
        "id": "edge-0002",
        "sourceNodeId": "node-0002",
        "sourcePortId": "node-0002:q",
        "targetNodeId": "node-0003",
        "targetPortId": "node-0003:in",
        "signalType": "BOOL"
      }
    ]
  }
}
