Well, ya know, ya take the time to build up a reply only to find good answers posted in the meantime...
So... maybe this will help.
Actually, jayshah11, the Register Chapter refers to the program example in the “Basic Program Example” (the previous chapter). It does not refer directly to the Relay Chapter.
Your primary problem is that you are trying to associate the --| |-- and --|/|-- symbols in the program example directly to the contacts in the hardware... DON’T DO THAT!
The figure on the left is supposed to represent real hardware. The figure on the left shows the hardware WITHOUT a PLC. Once a PLC is used, the figure on the left is only a conceptual expression of the operation provided by the PLC. The Ladder Code DOES NOT directly represent the figure on the left. The figure on the left represents how the code works!
Once a PLC is brought into the picture, the actual hardware configuration is quite different. The figure below shows the hardware WITH a PLC.
Now, in the first code example, the first --| |-- is simply asking if SW-1 is ON. The second --| |-- is simply asking if SW-2 is ON. If the answer to BOTH questions is YES (TRUE), then the Output will be energized. If the answer to either question is NO (FALSE), then the Output will NOT turn ON.
In the second code example, the --| |-- is simply asking if SW-1 is ON. The --|/|-- is simply asking if SW-2 is OFF. If the answer to BOTH questions is YES (TRUE), then the Output will be energized. If the answer to either question is NO (FALSE), then the Output will NOT turn ON.
Pay attention...
As far as the code is concerned, it doesn’t give a hoot whether either switch is "Normally Open" or "Normally Closed". All the code wants to know is... --| |-- “Is it ON?” or --|/|-- “Is it OFF?”