{
  "schema": "spec-platform/v1",
  "kind": "timingchart",
  "v": 5,
  "steps": 22,
  "stepW": 44,
  "rowH": 48,
  "edgeMode": "v",
  "meta": {
    "title": "サーボの位置決め起動",
    "note": "目標位置が届いてから起動する。起動は動作中（受け付けの返事）が ON になるのを見てから落とす（起動の入力を移動中ずっと保持する方式を除く）。移動完了は、起動のあとに動作中の ON を見たうえで、動作中 OFF・位置決め完了 ON・停止要求やエラーで止まっていない、がそろったとき（起動の直前は前の位置の位置決め完了が残っている）。動作中の OFF と位置決め完了の ON の前後は機種しだい。動作中は目標位置を書き換えない",
    "stepMs": 100,
    "master": "PLC",
    "slave": "サーボアンプ"
  },
  "library": [],
  "rows": [
    {
      "id": "r_cond",
      "name": "bStartOK",
      "type": "BOOL",
      "comment": "起動条件（サーボ ON・アラーム無し・原点確定）",
      "role": "I",
      "values": [
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true
      ]
    },
    {
      "id": "r_tgt",
      "name": "nTargetPos",
      "type": "DINT",
      "comment": "目標位置 [pulse]",
      "role": "M",
      "values": [
        "0",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000",
        "50000"
      ]
    },
    {
      "id": "r_start",
      "name": "bStartReq",
      "type": "BOOL",
      "comment": "位置決め起動",
      "role": "M",
      "values": [
        false,
        false,
        true,
        true,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false
      ]
    },
    {
      "id": "r_busy",
      "name": "bBusy",
      "type": "BOOL",
      "comment": "動作中",
      "role": "S",
      "values": [
        false,
        false,
        false,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        true,
        false,
        false,
        false,
        false
      ]
    },
    {
      "id": "r_inpos",
      "name": "bInPos",
      "type": "BOOL",
      "comment": "位置決め完了（インポジション）",
      "role": "S",
      "values": [
        true,
        true,
        true,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        true,
        true,
        true,
        true,
        true,
        true,
        true
      ]
    },
    {
      "id": "r_done",
      "name": "bMoveDone",
      "type": "BOOL",
      "comment": "移動完了（動作中 ON のあと OFF・位置決め完了・異常無し）",
      "role": "I",
      "values": [
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        false,
        true,
        true,
        true
      ]
    }
  ],
  "variables": [
    {
      "id": "r_cond",
      "name": "bStartOK",
      "type": "BOOL",
      "role": "I",
      "comment": "起動条件（サーボ ON・アラーム無し・原点確定）",
      "address": "",
      "bit": null,
      "initialValue": "1"
    },
    {
      "id": "r_tgt",
      "name": "nTargetPos",
      "type": "DINT",
      "role": "M",
      "comment": "目標位置 [pulse]",
      "address": "",
      "bit": null,
      "initialValue": "0"
    },
    {
      "id": "r_start",
      "name": "bStartReq",
      "type": "BOOL",
      "role": "M",
      "comment": "位置決め起動",
      "address": "",
      "bit": null,
      "initialValue": "0"
    },
    {
      "id": "r_busy",
      "name": "bBusy",
      "type": "BOOL",
      "role": "S",
      "comment": "動作中",
      "address": "",
      "bit": null,
      "initialValue": "0"
    },
    {
      "id": "r_inpos",
      "name": "bInPos",
      "type": "BOOL",
      "role": "S",
      "comment": "位置決め完了（インポジション）",
      "address": "",
      "bit": null,
      "initialValue": "1"
    },
    {
      "id": "r_done",
      "name": "bMoveDone",
      "type": "BOOL",
      "role": "I",
      "comment": "移動完了（動作中 ON のあと OFF・位置決め完了・異常無し）",
      "address": "",
      "bit": null,
      "initialValue": "0"
    }
  ],
  "triggers": [
    {
      "from": {
        "varId": "r_tgt",
        "step": 1
      },
      "to": {
        "varId": "r_start",
        "step": 2
      }
    },
    {
      "from": {
        "varId": "r_start",
        "step": 2
      },
      "to": {
        "varId": "r_busy",
        "step": 3
      }
    },
    {
      "from": {
        "varId": "r_start",
        "step": 2
      },
      "to": {
        "varId": "r_inpos",
        "step": 3
      }
    },
    {
      "from": {
        "varId": "r_busy",
        "step": 3
      },
      "to": {
        "varId": "r_start",
        "step": 4
      }
    },
    {
      "from": {
        "varId": "r_busy",
        "step": 18
      },
      "to": {
        "varId": "r_done",
        "step": 19
      }
    }
  ]
}
