Cesar
OpenPLC Editor 1.3.3
Release: 2022-05-16

The variable never was 1 but at the first cycle F_TRIG detects a falling edge. Is this Behavior compliant with IEC or is it a bug?
It think this behavior makes it impossible to program a traffic light in FBD language only. Some users have tried to set an is_running variable and put an AND at the output of F_TRIG. However even with this trick I don't see possible to program the traffic light properly with FBD, specially if I want a more complicate traffic light.
I am wondering if this is compliant with IEC.  I might test it with Codesys to compare. But I don't have Codesys installed yet.
Can you guys give me some orientation? Is this issue something to do with the start-stop pattern or with the MCR (master control relay)?
Thanks. Capture.png  Capture1.png 
Blade Runner
Reply 0 0
thiagoralves
This is a bug that I though was fixed already. Maybe during the few merges that happened on the previous months this bug was resurrected. I will take a look at it. Meanwhile you can create your own F_TRIG block and use that instead.
Reply 2 0
robbie13
Hello, which version has solved this ?
Reply 0 0
thiagoralves
I don’t remember which version fixed it, but it should be fixed already
Reply 0 0
drelin
[203128%2F8786813%2Fmceclip0]
This is no bug. Even if the CLK variable never was TRUE, at the first cycle F_TRIG detects a falling edge. It is part of IEC-61131 specs.
Reply 0 0
robbie13
Hm ok. But doesn't that make it hard to use ?
Reply 0 0
thiagoralves
I agree. Even if the standard says that it should be true for the first cycle I think it makes the block harder to use. I’m pretty sure that MatIEC libs (which is the compiler OpenPLC uses) are a plain copy-paste from the standard code, so it should have the same behavior. Could you confirm please that this is still a problem? If so, I’ll check OpenPLC fork of MatIEC and fix it on our end.
Reply 0 0
robbie13
I did solve my issue by building the custom block, but the code is the same as in the image above. And it works as expected.
Reply 0 0
thiagoralves
 
Please update your editor on File->check for updates and check if the F_TRIG is working as expected now. Thanks!
Reply 1 0
Reply