First copy one of the sample config directories from /usr/share/doc/linuxcnc/examples/sample-config to ~/linuxcnc/configs/ or follow the instructions under CustomizingConfigsOnUbuntu (outdated)
LinuxCNC uses a Hardware Abstraction Layer (HAL) which is very configurable. You can easily map any signal to any hardware pin, or modify signals with hal components as if they were real analog or digital electronic signals. See SampleParport for an example.
ClassicLadder, a software PLC, has been added to LinuxCNC. It allows plenty of flexibility for creating custom machine logic, in a format that most integrators are familiar with.