mr_sack
I think the falling edge input modifier and F_TRIG function block not working correctly.

Here is my program with my own falling edge detection for comparison to show what I mean:

Anmerkung 2019-06-24 163740.png 

Following the IEC standard the output should not be true after  I started the simulation (and also in runtime).

Quote:
The R_TRIG and F_TRIG function blocks defined in 2.5.2.3.2 of IEC 61131-3 exhibit differentbehaviour following “cold restart” as described in 2.4.2 of that document. The Q output of anR_TRIG instance can be set to 1 on the first invocation but the Q output of an F_TRIG instancealways requires at least two invocations before being set to 1. This behaviour can be explainedas follows.Since the default value of Boolean variables is 0, then if the CLK input is 1 on the firstinvocation, it means that the input has changed its value from 0 to 1 i.e. a rising edge hasbeen detected and thus the Q of an R_TRIG instance is set to 1.In the case of an F_TRIG instance, the CLK input must first be detected as being a 1 beforea change of state from 1 to 0 can be detected. Thus, at least two invocations are needed.
Quote 0 0
thiagoralves
You are right. I'll take a look at this block and figure out what is wrong
Quote 0 0