![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Lifetime Supporting Member
|
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; IF #condition_positive_edge THEN some_code(); END_IF; |
![]() |
![]() |
#2 |
Member
![]() ![]() Join Date: Feb 2009
Location: 127.0.0.1
Posts: 328
|
Use the built in functions (IEC 61131-3):
- R_Trig: Rising edge - F_Trig: Falling edge |
![]() |
![]() |
#3 |
Member
![]() ![]() Join Date: Jan 2013
Location: Germany
Posts: 1,196
|
+1 R_Trig
|
![]() |
![]() |
#4 |
Member
![]() ![]() Join Date: Jul 2007
Location: Lancashire
Posts: 1,176
|
If you wish to code it yourself then:
IF Condition AND NOT Condition_Memory Some Code End IF Condition_Memory = Condition |
![]() |
![]() |
#5 | |
Member
![]() ![]() Join Date: Jan 2006
Location: Finland
Posts: 1,528
|
Jesper's post 9 years ago, same as Manglemenders If condition on ST.
Quote:
|
|
![]() |
![]() |
#6 |
Lifetime Supporting Member
|
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'
__________________
nOrM ====================== nOrM=Norman Dziedzic Jr. I've never been to China but my phone has. |
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rising edge (oneshot) in TIA14 SCL | Michal_dk | LIVE PLC Questions And Answers | 7 | January 19th, 2018 01:54 AM |
SCL Postive Edge detection in Dword | MOeZ | LIVE PLC Questions And Answers | 3 | January 23rd, 2013 03:33 AM |
ST SCL question (swap words) | userxyz | LIVE PLC Questions And Answers | 1 | February 3rd, 2009 04:59 AM |
Is SCL almost = ST (structure text) ? | userxyz | LIVE PLC Questions And Answers | 10 | May 16th, 2007 09:53 AM |
Positive edge detection in SCL (S7) | Lesa | LIVE PLC Questions And Answers | 17 | October 5th, 2006 08:22 PM |