A basic example of NO and NC inputs.

Original Query

Show me the ladder logic (in JSON format) for a system that only turns on an output (O1) when an input (I1) is closed, and only turns on output O2 when input I2 is open.

Resulting JSON

  {
  "rung": [
    {
      "input": [
        {"name": "I1", "type": "coil", "state": "on"}
      ],
      "output": {"name": "O1", "type": "coil", "state": "on"}
    },
    {
      "input": [
        {"name": "I2", "type": "coil", "state": "off"}
      ],
      "output": {"name": "O2", "type": "coil", "state": "on"}
    }
  ]
}