We got some photoelectric switches made for industrial applications but they operate between 10-30v. I need to know how to connect then to a RoboRIO. They are three wire PNP type.
Any chance you can get an NPN sensor instead? With an NPN sensor, you can connect the sensor’s output to the signal pin on the roboRIO and everything just works.
For a PNP sensor, you’ll need to either create a voltage divider with the roboRIO signal pin connected to the middle, or get or make an opto-isolator. Voltage divider is the simplest option here, but runs the risk of damaging your robotRIO input if the voltage divider is disconnected from 0V while the sensor is outputting 12V.
The RoboRIO was designed and tested to survive battery voltage on every pin, so this won’t cause damage, but the input might not be functional while the excess voltage is present.