OR latch with a reset?

Hi,
I have a project where I want to measure the pressure drop across a filter bank supplied by 2 pumps.
I need either a function or group of nodes that trigger the pressure drop calculation flow 5 seconds after either of the pumps start running and continue until both pumps are running.
The pumps status are signaled from optocouplers continuously sending 0's or 1's
I believe this will work

  1. have two status messages sending 1 = on and 0 = off
  2. OR function from 2 inputs signals start after 5 sec delay
  3. start remains until both status is off, then is stop
    I can achieve parts of the requirement but it gets very messy when trying to stop

Sounds like you want an XOR gate. Perhaps this will work?

[{"id":"43d410d7c5aa3d91","type":"group","z":"0841b84d312a9445","name":"XOR ","style":{"label":true},"nodes":["b72613755e4d1c8c","841e94e2074f711d","952e92c59c855233","1ccc78780ddcd03b","d2a046d01dd7b81a","0fb18a62146ec92a","5baaa6b6e30077cd"],"x":14,"y":239,"w":852,"h":122},{"id":"b72613755e4d1c8c","type":"switch","z":"0841b84d312a9445","g":"43d410d7c5aa3d91","name":"payload.1 == 1?","property":"payload.1","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":120,"y":300,"wires":[["841e94e2074f711d"],["952e92c59c855233"]]},{"id":"841e94e2074f711d","type":"switch","z":"0841b84d312a9445","g":"43d410d7c5aa3d91","name":"payload.2 == 1?","property":"payload.2","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":280,"wires":[["d2a046d01dd7b81a"],["1ccc78780ddcd03b"]]},{"id":"952e92c59c855233","type":"switch","z":"0841b84d312a9445","g":"43d410d7c5aa3d91","name":"payload.2 == 1?","property":"payload.2","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":320,"wires":[["1ccc78780ddcd03b"],["d2a046d01dd7b81a"]]},{"id":"1ccc78780ddcd03b","type":"change","z":"0841b84d312a9445","g":"43d410d7c5aa3d91","name":"START","rules":[{"t":"set","p":"payload","pt":"msg","to":"START","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"XOR","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":280,"wires":[["5baaa6b6e30077cd"]]},{"id":"d2a046d01dd7b81a","type":"change","z":"0841b84d312a9445","g":"43d410d7c5aa3d91","name":"STOP","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"XOR","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":320,"wires":[["5baaa6b6e30077cd"]]},{"id":"0fb18a62146ec92a","type":"debug","z":"0841b84d312a9445","g":"43d410d7c5aa3d91","name":"debug 27","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":300,"wires":[]},{"id":"5baaa6b6e30077cd","type":"delay","z":"0841b84d312a9445","g":"43d410d7c5aa3d91","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":620,"y":300,"wires":[["0fb18a62146ec92a"]]},{"id":"14f259e0d5da7255","type":"group","z":"0841b84d312a9445","name":"Test input","style":{"label":true},"nodes":["5a3240d0329c9095","bf1793bdbd504a71","6a9def2aa5143bfa","f78b37d3697835cc","6f1aca28a58bc492","944476bd9b09cd42","8ee51879661e58fc"],"x":14,"y":19,"w":492,"h":202},{"id":"5a3240d0329c9095","type":"inject","z":"0841b84d312a9445","g":"14f259e0d5da7255","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":110,"y":60,"wires":[["6a9def2aa5143bfa"]]},{"id":"bf1793bdbd504a71","type":"inject","z":"0841b84d312a9445","g":"14f259e0d5da7255","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":110,"y":100,"wires":[["6a9def2aa5143bfa"]]},{"id":"6a9def2aa5143bfa","type":"change","z":"0841b84d312a9445","g":"14f259e0d5da7255","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":100,"wires":[["8ee51879661e58fc"]]},{"id":"f78b37d3697835cc","type":"inject","z":"0841b84d312a9445","g":"14f259e0d5da7255","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":110,"y":140,"wires":[["944476bd9b09cd42"]]},{"id":"6f1aca28a58bc492","type":"inject","z":"0841b84d312a9445","g":"14f259e0d5da7255","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":110,"y":180,"wires":[["944476bd9b09cd42"]]},{"id":"944476bd9b09cd42","type":"change","z":"0841b84d312a9445","g":"14f259e0d5da7255","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":140,"wires":[["8ee51879661e58fc"]]},{"id":"8ee51879661e58fc","type":"join","z":"0841b84d312a9445","g":"14f259e0d5da7255","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":430,"y":120,"wires":[["b72613755e4d1c8c"]]}]

@jbudd hey thanks so much, yes this looks good. I wasn't sure about the delay on the stop. The delay is to give the pump/'s time to get to pressure to eliminate the water hammer/pressure spikes on pressure up. The thought was to stop recording when the pumps stopped in case of any other issues and to ensure clean data. I looked at removing the delay on the stop but that incurs a stop, 5 seconds, start, 5 seconds Stop stop etc etc. I'll set it all up and see how i go. Many many thanks

You migth also want to look at the Boolean logic nodes - very comprehensive

Craig