The digital inputs on the RC will read as "1" when open, and "0" when grounded. They will directly detect contact closures to ground, such as a limit switch or an Allen-Bradley optical sensor.
If you want your code to count switch activations, you should remember that you only want to increment the count when the read value
changes from 1 to 0.
Code:
if (last_rc_dig_07 == 1 && rc_dig_07 == 0)
switch_counter++;
last_rc_dig_07 = rc_dig_07;