How to connect a limit switch(OMRON V-156-1A5) and an opto sensor(OMRON EE672)?

Hi

I’d like to detect these limit switch/opto sensor by DIO channel on Arduino.
But I’m not sure how to connect them to Arduino.

OMRON V-156-1A5
I connected it as the first attached figure.
Is this connection okay to detect the DI signal?
And I wonder if I have to add a resistor to protect the Arduino board?
What if I connected several limit switches at the same time, as the second attached figure?

OMRON EE-672
I connected it as the third attached figure.
Is this connection okay? I’ve tried but failed to get the signal when the light blocked.

OP's pix:

Sorry that my third pic is wrong. The blue connection in that figure should between DIO and OUTPUT terminal of the opto sensor. I still do not have idea why I can't measure the output signal when I connect the onboard 5V to the Vcc terminal of opto sensor.