PLC2U.com

...The latest article and sample code for your automation and control

  • Increase font size
  • Default font size
  • Decrease font size
Home Article PLC S7-200 Tips : Time/Event Drum Example 1

S7-200 Tips : Time/Event Drum Example 1

This Time/Event Drum program simulates an electromechanical stepper switch or drum. A timer only, an event contact only, or a time and an event can index the EDRUM. A Jog input enables you to allow either a time or an event to advance the drum a step. The EDRUM provides 8 output coils and 7 steps that are operated on multiples of the drum time base of 1 second. Each step controls all 8 output coils.

Program Description

EDRUM Operation

The drum is enabled when the Enable/Reset input is on. Depending upon the operation of the timer and/or event, when the Enable_Reset is on and the Start input turns on, the drum begins to run. The drum begins at the step specified by the Preset input on the Time_Control subroutine and advances to the next step. When the drum advances a step, outputs are turned on or off according to the drum mask for the new step. “Ones” in the mask designate that an output be turned on. “Zeros” designate that an output is to be turned off.

The Done bit for the Drum turns on and remains on for one scan after the last step has been executed. The drum automatically restarts at step 1 after step 7 is completed. To advance to the next step the event (if one was programmed for this step) must be on and the Cur_CNT must be at least  SEC_STPx. If the event turns off after Cur_CNT reaches SEC_STPx, the drum output remains on and the EDRUM remains at the last programmed step until the drum is reset or Jogged. To skip a step, just connect the Eventx input to SM0.0 and the SEC_STPx input to a 0.

When the Enable_Reset turns off, the drum returns to the step specified in Preset. If the Start input turns off and Enable_Reset remains on, the drum remains at the Cur_STP and holds its Cur_CNT. The drum advances to the next step immediately if the Jog input transitions from off to on and the Enable_Reset is also on.

Caution: All outputs keep the state specified by the drum mask.When the drum is at the Preset step, the outputs follow the states specified by the drum mask for that step, even if the Enable_Reset input is off. Be sure to program the mask with a bit pattern that is a safe (home) state for the Preset step.

Timer-Triggered Advance

 
For a step to have a timer operation only, set the SEC_STPx value greater than 0 and connect the Eventx input for this step to SM0.0. The drum remains at this step until the Cur_CNT reaches SEC_STP value.

Event-Triggered Advance

For a step to have an event only operation, set the SEC_STPx value for the step equal to 0 and program a contact in the Eventx field for this step. The drum remains at this step until the event specified turns on. The drum then advances to the next step.

Timer and Event-Triggered Advance

For a step having timer and event operation, set the SEC_STPx value for the step greater than 0 and program a contact in the Eventx field for this step. The following actions occur:

  • The timer counts up during every scan in which the event is on.

If the event turns off, Cur_CNT holds its current value and resumes counting when the event turns on again.

  • Timing is the same as for a time-triggered advance.

  • When Cur_CNT reaches SEC_STP the drum advances to the next step.

Timer or External Event-Triggered Advance

For a step having timer or external event operation, set the SEC_STPx value for the step greater than 0. Connect the Eventx input for this step to SM0.0. Design the program such that an event Advance external to the drum turns on the Jog input. The drum advances to the next step based on either the drum timer or the external event.

Download Program Example :

 

 


Related articles:

Powered By relatedArticle

Blog Catalog

My BlogCatalog BlogRank

Blog Directory

Blog Directory & Search engine

Blog Directory

Technology

Visitors Counter

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday129
mod_vvisit_counterYesterday154
mod_vvisit_counterThis week495
mod_vvisit_counterLast week811
mod_vvisit_counterThis month985
mod_vvisit_counterLast month3010
mod_vvisit_counterAll days22716