{
  "schema": "spec-platform/v1",
  "kind": "timingchart",
  "v": 5,
  "steps": 18,
  "stepW": 44,
  "rowH": 48,
  "edgeMode": "v",
  "meta": {
    "title": "氣缸的前進與後退（雙電磁閥）",
    "note": "端點用磁簧開關而不是時間判斷，並同時看「到達側的 ON」與「離開側的 OFF」。到達側持續 ON 0.2 秒後即確定。前進 SOL 與後退 SOL 不同時 ON。因為是 2 位雙電磁閥，即使在端點切斷 SOL，閥仍保持切換後的位置。上限：從 SOL ON 至離開側 OFF（不動作）約為試車時量測時間的 3 倍，從 SOL ON 至到達側 ON 為 2 秒（行程 0.5 秒的 4 倍。若把行程調慢就要修改）。兩端同時 ON 即為異常。",
    "stepMs": 100,
    "master": "PLC",
    "slave": "閥、氣缸"
  },
  "library": [],
  "rows": [
    {
      "id": "r_fsol",
      "name": "bFwdSol",
      "type": "BOOL",
      "comment": "前進 SOL（2 位雙線圈。到端即切斷）",
      "role": "M",
      "values": [
        false,
        true,
        true,
        true,
        true,
        true,
        true,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false
      ]
    },
    {
      "id": "r_bsol",
      "name": "bBwdSol",
      "type": "BOOL",
      "comment": "後退 SOL（不與前進 SOL 同時 ON）",
      "role": "M",
      "values": [
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        true,
        true,
        true,
        true,
        true,
        true,
        false,
        false,
        false
      ]
    },
    {
      "id": "r_fend",
      "name": "bFwdEnd",
      "type": "BOOL",
      "comment": "前進端（行程 0.5 s）",
      "role": "S",
      "values": [
        false,
        false,
        false,
        false,
        false,
        false,
        true,
        true,
        true,
        true,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false
      ]
    },
    {
      "id": "r_bend",
      "name": "bBwdEnd",
      "type": "BOOL",
      "comment": "後退端",
      "role": "S",
      "values": [
        true,
        true,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        true,
        true,
        true,
        true
      ]
    },
    {
      "id": "r_fok",
      "name": "bFwdOK",
      "type": "BOOL",
      "comment": "前進端 確定（持續 ON 0.2 s）",
      "role": "I",
      "values": [
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        true,
        true,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false
      ]
    },
    {
      "id": "r_bok",
      "name": "bBwdOK",
      "type": "BOOL",
      "comment": "後退端 確定（送出前進 SOL 的條件）",
      "role": "I",
      "values": [
        true,
        true,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        true,
        true
      ]
    }
  ],
  "variables": [
    {
      "id": "r_fsol",
      "name": "bFwdSol",
      "type": "BOOL",
      "role": "M",
      "comment": "前進 SOL（2 位雙線圈。到端即切斷）",
      "address": "",
      "bit": null,
      "initialValue": "0"
    },
    {
      "id": "r_bsol",
      "name": "bBwdSol",
      "type": "BOOL",
      "role": "M",
      "comment": "後退 SOL（不與前進 SOL 同時 ON）",
      "address": "",
      "bit": null,
      "initialValue": "0"
    },
    {
      "id": "r_fend",
      "name": "bFwdEnd",
      "type": "BOOL",
      "role": "S",
      "comment": "前進端（行程 0.5 s）",
      "address": "",
      "bit": null,
      "initialValue": "0"
    },
    {
      "id": "r_bend",
      "name": "bBwdEnd",
      "type": "BOOL",
      "role": "S",
      "comment": "後退端",
      "address": "",
      "bit": null,
      "initialValue": "1"
    },
    {
      "id": "r_fok",
      "name": "bFwdOK",
      "type": "BOOL",
      "role": "I",
      "comment": "前進端 確定（持續 ON 0.2 s）",
      "address": "",
      "bit": null,
      "initialValue": "0"
    },
    {
      "id": "r_bok",
      "name": "bBwdOK",
      "type": "BOOL",
      "role": "I",
      "comment": "後退端 確定（送出前進 SOL 的條件）",
      "address": "",
      "bit": null,
      "initialValue": "1"
    }
  ],
  "triggers": [
    {
      "from": {
        "varId": "r_fsol",
        "step": 1
      },
      "to": {
        "varId": "r_bend",
        "step": 2
      }
    },
    {
      "from": {
        "varId": "r_fsol",
        "step": 1
      },
      "to": {
        "varId": "r_fend",
        "step": 6
      }
    },
    {
      "from": {
        "varId": "r_fend",
        "step": 6
      },
      "to": {
        "varId": "r_fsol",
        "step": 7
      }
    },
    {
      "from": {
        "varId": "r_fend",
        "step": 6
      },
      "to": {
        "varId": "r_fok",
        "step": 8
      }
    },
    {
      "from": {
        "varId": "r_fok",
        "step": 8
      },
      "to": {
        "varId": "r_bsol",
        "step": 9
      }
    },
    {
      "from": {
        "varId": "r_bsol",
        "step": 9
      },
      "to": {
        "varId": "r_fend",
        "step": 10
      }
    },
    {
      "from": {
        "varId": "r_bsol",
        "step": 9
      },
      "to": {
        "varId": "r_bend",
        "step": 14
      }
    },
    {
      "from": {
        "varId": "r_bend",
        "step": 14
      },
      "to": {
        "varId": "r_bsol",
        "step": 15
      }
    },
    {
      "from": {
        "varId": "r_bend",
        "step": 14
      },
      "to": {
        "varId": "r_bok",
        "step": 16
      }
    }
  ]
}
