161
ifm Vision Assistant O3M
UK
15.7.6 Example "Event counter" for "RAM write" / "RAM read" modules
In this example, an event counter is implemented for the vertical drilling rig (→ „15.7.1 "Teach" module“).
The "Area not free" events of ROI groups 1-8 of the vertical drilling rig are taken into account . The
transition from "Area free" to "Area not free" (falling edge of the binary signal) is counted .
Description of the modules used in the example:
Module number
Module
Description
1
RAM read
The state is read from the RAM . Index 0 to 7 is used as address .
The read state corresponds to the values stored in module 6 from the previous
cycle (n-1) .
2
AND
If the measurement is valid and in the tolerance range of the reference value, a
"1" is output (area free) .
If the measurement is invalid or not in the tolerance range of the reference
value, a "0" is output (area not free) .
This corresponds to the behaviour of the vertical drilling rig (→ „15.7.2 Example
for the "Teach" module“)
3
Fixed value
The fixed value "1" is defined .
4
DIFF
The difference between the previous and current cycle is established . At the
transition from "Area free" to "Area not free", a "1" is output (falling edge of the
binary signal) . In all other cases, a "0" or "-1" is output .
5
Digital output
The result of the AND module is output at digital output 1 .
6
RAM write
The state of the 8 ROI groups is written to the RAM . Index 0 to 7 is used as
address .
7
RAM read
The count of the last cycle is delivered .
8
Equal
If a "1" is present at the inputs, a "1" is output . In all other cases, a "0" is output .
So in the example, a "1" is only output whenever a transition from free (value
="1") to occupied (value ="0") occurs in the areas .
9
ADD
The counts of the previous and current cycle are added and output .
10
RAM write
The counter reading is saved .
11
Analogue output
The count is output at analogue output 0 .