I'd like to connect a sensor Festo SME-8M-DS-24V-K-2 and create a program capable to read a value of sensor. I searched and tried to find some solutions but nothing on internet.
It's a reed switch. You can read it like a switch:
Data sheet, I assume you have already seen this: