Instead of setting an input to Port 10 pin 1 set up an OEM trigger for these pins, then go to the config menu and down to System Hotkeys. When that window opens enter the OEM code for the button you want to operate in the box for the OEM Trigger you have the pokeys set to.
The OEM code for the Z Ref button is 1024
You can do similar in a brain, it would look like this in the Brain.
Hood