280 likes | 454 Views
PLC Timers. PLC files. The SLC 500 organizes the CPU memory into sections called “files”. There can be additional user defined files above the basics listed, but we won’t need more. Types of Timers. There are two major classifications of timers.
E N D
PLC files The SLC 500 organizes the CPU memory into sections called “files” There can be additional user defined files above the basics listed, but we won’t need more.
Types of Timers There are two major classifications of timers. Retentive timers can be started and stopped any number of times and will retain the elapsed time. Non-retentive timers will reset if stopped before completing their timing function. Two types of non-retentive timers we use are Time delay off and Time delay On.
Parts of a Timer Timebase Preset Accumulator Enable Reset
Timebase In our lives we use different timebases. A second, minute, hour, day, month, etc are all examples of timebases. If we agree ahead of time to use minutes for our timebase then we can say there is one minute per increment. A 50 minute class would have 50 increments. The SLC500 has two timebases; seconds and hundredths of a second (10 mSec) increments.
Preset Is the number of timebase increments required before the timer activates. For example, when using a microwave oven, you enter the cook time. The cooking time is the PRESET.
Accumulator The accumulator holds the elapsed time since the timer was activated. The Preset value can be a constant, but the accumulator must be a variable since it is constantly changing. In the timer below, the accumulator has a value of 475. In 25 more increments or 0.25 seconds the timer will activate
Enable The timer will only run when the enable bit is active. The enable line is used to start and stop the timer. Enable line
Reset After the timer is finished it turns on the DONE bit. This will remain on until the timer is Reset. When the Reset bit is activated the accumulator is reset to a value of zero. In this example, the timer done bit is used to turn on an output.
Retentive - RTO Will retain the accumulated value if the enable becomes false Useful if you want to measure the total time, regardless of interruptions SLC 500 instruction mnemonics
Non-Retentive Will zero the accumulator if the enable becomes false. This is useful for events that don’t get interrupted. For example, in a heat treat process, it might be necessary to put a part in an oven and hold the oven temperature above a 400 degrees for two minutes. A part will only be considered good if the temperature stays above 400 degrees for the entire two minutes. A temperature probe is setup to go high if the temp is above 400 degrees. This signal will control the run line on the timer. If the timer times out the part is good, otherwise we have a bad part.
Example of the difference A person can hold their breath for 20 minutes. The “catch”, hold your breath for 15 seconds of every minute until the total time measured is 20 minutes Which timer does this illustrate? Retentive or Non-retentive
Time delay off - TOF Might be used to keep an exhaust fan running for a while after someone signals for a process to stop WARNING! Do not use the RES instruction to reset a TOF instruction. A RES always clears the status bits and the accumulated value. This could result in unpredictable machine operation or injury to personnel.
Time delay on - TON The output will energize after a period of time Might be used to provide a 2 second OSHA safety start delay before machinery starts to move
Programming Timers You can have up to 255 timers, starting at T4:0 thru T4:255 The Reset coil is T4:x/RES, where x is the timer from 0 to 255 The Done bit is T4:x/DN or T4:x/13 Maximum # of increments is 32767
Timer -internal structure Each timer uses 3 - 16 bit words Timer Data File Element Bit 15 14 13 12 11 Word 0 EN TT DN Word 1 Preset Value Word 2 Accumulated Value
Timer issues In the next example, you will probably not see output #1 fire How can we tell if it did? Look at the latch and how it is used Timing accuracy is limited to +/- 1 timebase increment, therefore in time sensitive applications use the 10 mSec timebase.
Timer example #2 Turn the timer back off at the end of the scan
Clocks By using two timers together you can generate a “clock” that will have the frequency and duty cycle you want Duty cycle is the On time / Period Period = 1 / frequency The “clock” ladder logic might be used to turn on a pump for a 2 minute duration every 18 minutes. The total period is 18+2 or 20 minutes, the duty cycle is 2 / 20 or 10%
Special Timer contacts The Status File - S2 provides access to a free running clock A contact with the reference of S2:4/0 is a 20mSec with 50% duty cycle S2:4/1 is a 40 mSec clock For bit values from 2 thru 15 the clock doubles (20, 40, 80, 160 mSec….) S2:4/15 is a 655360 mSec clock
Exercises Construct a clock that will create a 1 scan pulse every 24 hours Construct a clock that will make B3:1/1 a 1 second clock with 50% duty cycle Construct a 1 year clock Construct a program that will create a pulse on output #1, 5 sec in duration that will start 15 seconds after input #1 is turned off.