This may be a simple question to answer.
I have a flow meter sensor, specifically this one: https://www.adafruit.com/products/833
The recommended way to read from this sensor is to connect it to an input pin on an Arduino that supports IRQ. I'm using Arduino Mega so I have several input pins that support IRQs. The sensor itself outputs a pulse as it spins to detect flow (485 pulses per litre).
So when programming this using the standard Arduino IDE, it's a simple IRQ handler that increments a variable and counts how many pulses have been received over time.
My question is, when I use OpenPLC to write an algorithm to read from this same sensor, how do I handle triggering my code on an interrupt?
I know that I can define a task to run on an "Interrupt" (as opposed to "Cyclic"). However, will this do what I want? How would the task know to run when a pulse comes in on a specific input?
Related to this, if I have 5 sensors like this, do I need to create 5 different tasks to read from them?