Topic: DMD0032 RSTCT - Reset Counter |
|
The Reset Counter (RSTCT) instruction is used to programmatically reset a Counter and clear the structure that is used by an Up Counter, a Down Counter, or an Up / Down Counter instruction. The Reset Counter instruction is the proper method to reset a UDCG - Global Up / Down Counter.
|
|
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.Counter Struct specifies which Counter number to edit, and by extension, the name of the Counter's associated structure. This can be any of the System-created Counters, or any user-created Counter. The default Memory Configuration contain 255 predefined Counters named CT0 through CT255.
|
|
Counter Structure MembersAll Counters have an associated structure with fields that can be used in the ladder program. The structure fields are updated whenever the Counter instruction is processed in the PLC scan. The syntax for using them is <Counter structure>.<field name>, for example: CT1.Acc.
.Acc (read/write) is a 32-bit integer value that represents the current number of counts that have accrued.
.Done (read-only) when counting upward toward a preset value, this Bit will be ON any time the value in the Counter's accumulator (.Acc) is greater than or equal to the Counter's Preset value.
.Reset (read-only) will be ON if the RESET logic is ON, or if the Counter is being held in reset by a Reset Counter (RSTCT) instruction. The Reset input has priority over the UP input, meaning that if the UP input is ON at the same time as the Reset input, the Counter will not count.
.Zero (read-only) will be ON any time the value in the Counter's accumulator value (.Acc) is 0.
.DnDone (read-only) when counting downward toward the down preset value, this Bit will ON any time the value in the Counter's
accumulator value (.Acc) is less than or equal to the Counter's Preset value. This bit field is only used by the Up / Down Counter (UDC) and the Global Up / Down Counter (UDCG) .
|
|
See Also:RSTCT - Reset Counter
|
|
Related Topics:
UDCG - Global Up / Down Counter
|
|
Rung Example:
|
|