Mirek's example is good, but my imagination tells me that the S7 timers have a built-in slope mechanism and the circuit would work by connecting the input directly to the timer.
Another example - a simple counting of items moving on a conveyor belt. We count using a photocell that gives 1 as the object is in its area and 0 when the object is not there.
And our program could look like this:
if photo = 1; photo is a sensor, we check the presence of the object
if so, increase the counter by 1; the counter is the current state we have counted
if not, go on; and that's it
theoretically, we count items, practically there will be nonsense because the program is so fast that during the passage of one item on the tape, the program will execute e.g. 100 loops and each time it will increase the piece counter. Here the SLOPE helps, which in this case can be called the APPEARANCE of the object, thanks to which the program will get the state 1 (on the slope marker) only in one moment when the object appears in the field of view of the photo sensor and in the next program pass on the slope signal it will be 0 because the sensor has 1 all the time so the slope is gone.
then the program:
if appearance = 1; we check the slope
if so, increase the counter by 1
if not then go ahead
makes sense and we'll calculate correctly
often in programs where we use "latched" outputs, i.e. set, reset needs to be operated with slopes. Imagine a system built of a pneumatic actuator, a monostable control valve, the idle state of the actuator is retracted, and when we give 24V, it slides out and waits for 24V to disappear. We have end position sensors on the actuator, the actuator performs a quick, short movement.
It is assumed that the actuator is to move when the button is pressed (the button can be released immediately), come to the end and return. It can only start when the START button is pressed again.
kr_1, kr_2 - actuator limits
start - START button
st_zbocz - edge signal from START button
q - output to the actuator valve
if we write a program:
And the start
S q
the actuator will start and will not come back, so we give:
A kr_2
R q
after reaching kr_2, the actuator will start to return unless !! :
we did not manage to release the START button - then the actuator, after leaving kr_2, will start going towards it again
but we can get rid of it by writing:
A kr_1
And the start
S q
A kr_2
R q
Thanks to this, the actuator will return because in order to start it must be in the initial position, i.e. on kr_1
only that if we still haven't released the button, the actuator will start by itself and here the slope comes to the rescue:
A kr_1
A st_zkocz
S q
A kr_2
R q
Thanks to this, the cycle will be performed only once and the operator must release the button and press it again to consciously start the next cycle
-----
the edge itself is an abstract concept, so the drivers deal with it using an additional memory cell, which stores the state of the signal of interest to us from the previous program transition.
thanks to this, by comparing the current value and the previous value, we can state that there has been a change and save it as an edge occurrence. Then of course we rewrite the current value into memory where we keep the previous one and reread the inputs - and so on.
in practice, we will get an impulse when the state changes at the input, I will try ascii - chart

:
__________ | '' '' '' '' '' '' '' '' '' '' '' 'sensor input
__________ | '| ________ rising edge of the sensor
another good example is the use of a slope, as in the example with an actuator, on the button that starts the machine cycle in order to eliminate the "match" operator trick - consisting of pressing the match into the starting button and going for the pipe

- without a slope, it will work continuously, without operator supervision, on a slope it will force it to be released and re-engaged.
greetings