Hello Marcus,
I would suggest setting up some kind of digital channel that you pool every time and depending on the state of the line, either substract or not. To do this, you would just have to setup a digital channel and read the digital line into a case structure that would select the operation to perform.
Hope this helps...