RES (Reset) Ladder Logic Instruction

Definition

The Reset instruction is used to reset Timers, Counters, and Control structures used in the ladder logic. Timer On and Timer Off instructions are normally reset when the preceding rung logic transitions from either true to false or false to true, however they can also be reset with the Reset instruction.

The only reset for the RTO timer is the Reset instruction.

The Count Up and Count Down instructions are reset with either the Reset instruction or by moving a 0 into the respective Accumulators.

Control structures are reset with the reset instruction.

List of possible arguments

  • COUNTER STRUCTURE             PRE DEFINED STRUCTURE
  • TIMER STRUCTURE                    PRE DEFINED STRUCTURE
  • CONTROL STRUCTURE             PRE DEFINED STRUCTURE

 

Note: When referencing a structure the tag name is sufficient. Do not reference an element of the structure. Example:  Correct- MY_TIMER    Incorrect- MY_TIMER.DN

CTD (Count Down) Ladder Logic Instruction

Definition

The Count Down instruction that counts down by one every time the preceding logic transitions from false to true. The Counter.DN bit is set when the Accumulator reaches the Preset. The accumulator will continue to count even when the done bit is set. The CTD instruction can be paired with a CTU instruction referencing the same tag name. The overflow and underflow bits are set when the Accumulator exceeds the upper or lower limits.

List of arguments

COUNTER STRUCTURE             PRE DEFINED STRUCTURE

Tag Structure

  • BOOL             Counter.UP     Count up bit, set when instruction is enabled.
  • BOOL             Counter.DN    Count done bit, set when the accumulator reaches the preset.
  • BOOL             Counter.OV    Count overflow bit, set when the count exceeds the upper limit of 2,147,483,647. The accumulator will roll over to -2,147,483,648 and begins counting down.
  • BOOL              Counter.UN     Count overflow bit, set when the count exceeds the lower limit of -2,147,483,648. The accumulator will roll over to 2,147,483,647 and begins counting up.
  • DINT               Counter.PRE    Count Preset value, when the accumulator reaches the preset the .DN bit is set.
  • DINT               Counter.ACC   Count Accumulator value, keeps track of the current count.

Note: The CTD ladder instruction is reset with the RESET instruction referencing the CTD tag. The instruction could also be reset by moving a 0 into the Accumulator.

CTU (Count Up) Ladder Logic Instruction

Definition

The Count Up instruction counts up by one every time the preceding logic transitions from false to true. The Counter.DN bit is set when the Accumulator reaches the Preset. The accumulator will continue to count even when the done bit is set. The CTU instruction can be paired with a CTD instruction referencing the same tag name. The overflow and underflow bits are set when the Accumulator exceeds the upper or lower limits.

List of arguments

COUNTER STRUCTURE             PRE DEFINED STRUCTURE

Tag Structure

  • BOOL             Counter.UP     Count up bit, set when instruction is enabled.
  • BOOL             Counter.DN    Count done bit, set when the accumulator reaches the preset.
  • BOOL             Counter.OV    Count overflow bit, set when the count exceeds the upper limit of 2,147,483,647. The accumulator will roll over to -2,147,483,648 and begins counting down.
  • BOOL              Counter.UN     Count overflow bit, set when the count exceeds the lower limit of -2,147,483,648. The accumulator will roll over to 2,147,483,647 and begins counting up.
  • DINT               Counter.PRE    Count Preset value, when the accumulator reaches the preset the .DN bit is set.
  • DINT               Counter.ACC   Count Accumulator value, keeps track of the current count.

Note: The CTU ladder instruction is reset with the RESET instruction referencing the CTU tag. The instruction could also be reset by moving a 0 into the Accumulator.