The first thing you should do is to rename each switch port so the names are more meaningful, making the programming and troubleshooting easier in the long run. Go into your System View and click the Switch Inputs node to expand it. Then click the gear icon on each switch port to get to the screen where you can rename it. Inputs are limited to 6 characters, so you'll need to be creative with abbreviations.
Next, add a line of code to any output you want to control. For example, I used my "SkmFul" switch to turn off my skimmer when it's full:
[Skimmer]
Fallback OFF
Set ON
If SkmFul CLOSED Then OFF
If Output ReturnPump = OFF Then OFF
Defer 005:00 Then ON
I also send an alarm notification:
[EmailAlm]
Set OFF
If SkmFul CLOSED Then ON
You cannot trigger a Feed mode through programming. You can only activate Feed by clicking one of the Feed A, B, C, D buttons on the dashboard. However, you can simulate a Feed cycle using a virtual output as explained in my Apex Feed Cycles tutorial here:
https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-7-feed-cycles.715/