![]() |
Edge trigging in ST or SCL
What is your best practice for edge trigging in structured text language?
Code:
#condition := (Value1 > 0 OR NOT Tag1) AND Tag2; |
Use the built in functions (IEC 61131-3):
- R_Trig: Rising edge - F_Trig: Falling edge |
+1 R_Trig
|
If you wish to code it yourself then:
IF Condition AND NOT Condition_Memory Some Code End IF Condition_Memory = Condition |
Jesper's post 9 years ago, same as Manglemenders If condition on ST.
Quote:
|
1 Attachment(s)
Not sure if it's in all ST packages but in CoDeSys (at least in v3.5) you can set a bit for a positive or negative edge trigger. The 'P' indicates positive edge, for Negative edge it would be an 'N'
http://www.plctalk.net/qanda/attachm...1&d=1610562946 |
All times are GMT -5. The time now is 05:00 PM. |
.