meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

simatic:scl_commands_bit_logic [2024/11/17 22:29] – created - external edit 127.0.0.1simatic:scl_commands_bit_logic [2026/03/09 11:44] (current) vamsan
Line 1: Line 1:
 ~~NOCACHE~~ ~~NOCACHE~~
 ====== LamaPLC: Simatic S7 SCL commands: Bit logic operations ====== ====== LamaPLC: Simatic S7 SCL commands: Bit logic operations ======
-==== positive / negative edge monitoring ====+==== positive/negative edge monitoring ====
 {{anchor:edge_monitor}} {{anchor:edge_monitor}}
-Of course, there is an R_TRIG / F_TRIG function for edge monitoring, but do you really have to call an FB and an IDB for such a simple function?+Of course, there is an R_TRIG / F_TRIG function for edge monitoring, but do you really need to call an FB and an IDB for such a simple function?
  
-Both negative and positive edge monitoring require an extra BOOL type static, db, or mark variable (temp is not good!) in addition to the signal variable. In this variablethe signal state one cycle earlier is stored and the current state of the signal is compared+Both positive and negative edge monitoring require an additional BOOL-type static, DB, or mark variable (temp is not suitable) in addition to the signal variable. This variable stores the signal state from the previous cycle, which is then compared to the current state. 
-If the old state is FALSE and the current state is TRUE, then a positive edge is received; if the reverse is true, the old state is TRUE and the new state is FALSE. +If the old state is FALSE and the current state is TRUE, it indicates a positive edge; if the reverse is true, the old state is TRUEand the new state is FALSE.
- +
-The example below illustrates the two options, the variables in this case being FB local "static" variables, but they can also be DB variables or markers. The signal can also be an input:+
  
 +The example below demonstrates the two options, with the variables being FB local "static" variables, but they can also be DB variables or markers. The signal can also be an input.
 <code SCL|edge_monitor> <code SCL|edge_monitor>
 // signal, old_signal is type BOOL // signal, old_signal is type BOOL
Line 29: Line 28:
 </code> </code>
  
-[[simatic:scl_commands|>> Back to LamaPLC main menu (SCL commands)]]+[[automation:s7_scl_commands|>> Back to LamaPLC main menu (SCL commands)]]
 ==== R_TRIG ==== ==== R_TRIG ====
-Detect __positive__ signal edge, if the state change from FALSE to TRUE at CLK. I have described above a similar but much simpler procedure for edge monitoring: [[:simatic:scl_commands#edge_monitor|positive / negative edge monitoring]].+Detect __positive__ signal edge, if the state changes from FALSE to TRUE at CLK. I have described above a similar but much simpler procedure for edge monitoring: [[automation:s7_scl_commands#edge_monitor| positive/negative edge monitoring]].
  
 <color white/orange>[[:simatic:tia_knowhow#fc|_FB_]]</color>   <color white/orange>[[:simatic:tia_knowhow#fc|_FB_]]</color>  
Line 42: Line 41:
 |<color blue>Q </color>|output|Result of edge evaluation| |<color blue>Q </color>|output|Result of edge evaluation|
  
-[[simatic:scl_commands|>> Back to LamaPLC main menu (SCL commands)]]+[[automation:s7_scl_commands|>> Back to LamaPLC main menu (SCL commands)]] 
 + 
 +{{page>automation:tarhal}} 
 ==== F_TRIG ==== ==== F_TRIG ====
-Detect __negative__ signal edgeif the state change from TRUE to FALSE at CLK. I have described above a similar but much simpler procedure for edge monitoring: [[:simatic:scl_commands#edge_monitor|positive / negative edge monitoring]].+Detect __negative__ signal edge if the state transitions from TRUE to FALSE at the CLK. I have described above a similar but much simpler procedure for edge monitoring: [[automation:s7_scl_commands#edge_monitor| positive/negative edge monitoring]].
  
 <color white/orange>[[:simatic:tia_knowhow#fc|_FB_]]</color>   <color white/orange>[[:simatic:tia_knowhow#fc|_FB_]]</color>  
Line 55: Line 57:
 |<color blue>Q </color>|output|Result of edge evaluation| |<color blue>Q </color>|output|Result of edge evaluation|
  
-[[simatic:scl_commands|>> Back to LamaPLC main menu (SCL commands)]]+[[automation:s7_scl_commands|>> Back to LamaPLC main menu (SCL commands)]]
 \\ \\
 +{{page>automation:s7_idx}}
 +
 {{tag>Simatic SCL F_TRIG  R_TRIG bit_operation flanke trigger TIA}} {{tag>Simatic SCL F_TRIG  R_TRIG bit_operation flanke trigger TIA}}
 \\ \\
 \\ \\
 This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}} This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}