Siemens 6AV6651-7KA01-3AA4 - S7-1200 + KTP400 Basic Starter Kit 6AV6651-7KA01-3AA4 Manual Do Utilizador
Códigos do produto
6AV6651-7KA01-3AA4
Programming made easy
6.3 Powerful instructions make programming easy
Easy Book
Manual, 03/2014, A5E02486774-AF
Manual, 03/2014, A5E02486774-AF
109
As long as the timer runs, the state of DB1.MyIEC_Timer.Q=1 and the Tag_Output value=1.
When the Tag_Time value has elapsed, then DB1.MyIEC_Timer.Q=0 and the Tag_Output
value=0.
6.3.6
Counters
You use the counter instructions to count internal program events and external process
events.
● The "count up" counter (CTU) counts up by 1 when the value of the input parameter CU
● The "count up" counter (CTU) counts up by 1 when the value of the input parameter CU
changes from 0 to 1.
● The "count down" counter (CTD) counts down by 1 when the value of input parameter CD
changes from 0 to 1.
● The "count up and down" counter (CTUD) counts up or down by 1 on the 0 to 1 transition
of the count up (CU) or count down (CD) inputs.
S7-1200 also provides high-speed counters (Page 118) (HSC) for counting events that occur
faster than the OB execution rate.
The CU, CD, and CTUD instructions use software counters whose maximum counting rate is
The CU, CD, and CTUD instructions use software counters whose maximum counting rate is
limited by the execution rate of the OB they are placed in.
Note
If the events to be counted occur within the execution rate of the OB, use CTU, CTD, or
If the events to be counted occur within the execution rate of the OB, use CTU, CTD, or
CTUD counter instructions. If the events occur faster than the OB execution rate, then use
the HSC.
Each counter uses a structure stored in a data block to maintain counter data. For SCL, you
must first create the DB for the individual counter instruction before you can reference it. For
LAD and FBD, STEP 7 automatically creates the DB when you insert the instruction.
The number of counters that you can use in your user program is limited only by the amount
The number of counters that you can use in your user program is limited only by the amount
of memory in the CPU. Individual counters use 3 bytes (for SInt or USInt), 6 bytes (for Int or
UInt), or 12 bytes (for DInt or UDInt).