Hello,
I have a reACTION program that counts objects detected by a PNP sensor. It works, but right now it counts when the object arrives (rising edge). I want it to count when the object leaves the sensor (falling edge). Could you please advise on the recommended way to do this?
Environment
- Automation Studio: 6.7.0.187
- reACTION module: X20RT8001
- Library: ASIORTI
- Sensor: PNP, wired to input Channel 1 of the X20RT8001
Current structure (screenshot attached; the number in each block is its execution order)
| # | Block | Wiring | Purpose |
|---|---|---|---|
| 1 | rtiDin_0 |
Channel = 1, Out → rtiTP_0.IN and rtiRes_1.Data |
Reads the sensor input |
| 3 | rtiRes_1 |
DpNr = 2 | Sends the raw sensor state to the application |
| 5 | rtiTP_0 |
IN ← rtiDin_0.Out, PT = 1, Q → rtiCount_0.Up_Clk |
Turns the input into a fixed-width pulse |
| 7 | rtiPar_0 |
DpNr = 1, Data → rtiCount_0.Clear |
Lets the application clear the counter |
| 9 | rtiCount_0 |
Mode = 0, Up_Clk ← rtiTP_0.Q, Down_Dir not connected | Counter |
| 12 | rtiRes_0 |
DpNr = 1, Data ← rtiCount_0.Out | Sends the count value to the application |
Current behavior
When the sensor turns ON (the object arrives), rtiDin_0.Out goes TRUE. rtiTP_0 then produces a pulse, and rtiCount_0 increments on that pulse. So the count happens on the rising edge of the sensor signal.
What I want
Increment the counter only on the falling edge of the sensor signal, i.e. when the object has passed and the sensor turns OFF.
Questions
- What is the recommended way to count on the falling edge with the ASIORTI blocks?
- Should I insert an inverter (for example
rtiNOT) betweenrtiDin_0.OutandrtiTP_0.IN? - Or can the
Modeinput ofrtiDinorrtiCountselect falling-edge detection directly? - Or should
OutTsEdgeNegofrtiDinbe used for this?
- Should I insert an inverter (for example
- Is
rtiTPneeded in front ofrtiCount.Up_Clkat all, or can the input signal be connected toUp_Clkdirectly? What unit isPTin? - If I invert the signal, is there anything to watch out for at startup? For example, could the counter increment once when the input is initially FALSE?
Any advice would be greatly appreciated. Thank you in advance.

