An example showing several rungs converging.

Original Query

Show me the ladder logic for a system that has three input coils and sets an output on if any two of those inputs are on, but leaves the output off if there are 0, 1 or 3 inputs on. Describe the logic in JSON format, using the name 'rung' for rungs.

Resulting JSON

  {
  "rung": [
    {
      "input": [
        {"name": "Input 1", "type": "coil", "state": "on"},
        {"name": "Input 2", "type": "coil", "state": "on"}
      ],
      "output": {"name": "Output", "type": "coil", "state": "on"}
    },
    {
      "input": [
        {"name": "Input 1", "type": "coil", "state": "on"},
        {"name": "Input 3", "type": "coil", "state": "on"}
      ],
      "output": {"name": "Output", "type": "coil", "state": "on"}
    },
    {
      "input": [
        {"name": "Input 2", "type": "coil", "state": "on"},
        {"name": "Input 3", "type": "coil", "state": "on"}
      ],
      "output": {"name": "Output", "type": "coil", "state": "on"}
    }
  ]
}