how to turn on the compressor?

we are a rookie team and i am in charge of the programming, so i have a question about how programming pneumatics. currently we have this part of the arm wired; the spike relay and the compressor have power, and the data port on the spike relay is going to relay channel 1. another member on the team wants me to make a program that will turn on the compressor. he says turning on the spike relay should be all that’s required to do this. how would i program

this is what i have so far.

thanks a lot

What you have is actually more than you need.
The compressor Open and Start go in and that’s all you’ll ever have to do. Start begins a never ending background task that constantly checks the pressure sensor and automatically turns the compressor on when pressure drops below 95psi, and turns it off when pressure rises above 115psi.
(the Enable doesn’t do anything, it just lets you check to see if the compressor is running. But you aren’t even checking in that code you have.)

You don’t control the compressor spike relay directly.
It gets controlled based on the pressure sensor input and the robot inspectors will check for that.

Enable is unneeded. Just refnum and start.

alright, i put the compressor open/compressor start/and the compressorrefnum (what do refnum vis do btw?) registry set vis in after wiring them together. once i hit enable on the driver station this should turn on the compressor until it reaches 120 psi right?

also does the pressure switch need to be connected to the digital sidecar? one of our mentors says we should not need it to be connected because it is just a switch.

thanks for all the help

No, you need to connect the pressure switch to the DIO section of the digital sidecar. You specify the channel that you plug it into when you use the open block for the compressor.

The pressure sensor is certainly “just a switch,” however it is the switch that causes the compressor to turn on and off…
You really do need it as part of the compressor system.

The only reason you would not need to connect the pressure switch to the digital sidecar is if you wired the power for the compressor directly through the pressure switch. This is illegal because the switch can not handle the current drawn by the compressor. See <R72>