PLC Programming Example - PLC Clock

  • 5,442 views
Uploaded on

A most simple PLC programming example for those starting out with PLC programming.

A most simple PLC programming example for those starting out with PLC programming.

More in: Engineering
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
5,442
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
66
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. This copy distributed by http://BIN95.com/ PLCCLOCK.RSS LAD 2 - MAIN_PROG --- Total Rungs in File = 6 Page 1 Saturday, October 05, 2013 - 09:47:47 PLC Clock example by BIN95.com This is a rung comment. The rung below is 60 second timer, all other rungs are counters driven by this timer. This is referred to as a cascading programming methodology. You could design this PLC clock several different ways. We picked the most simplest for this example. 60 sec=minute, 60 min=hour, 24 hrs=day,365days=year 0000 I:0 0 1761-Micro RUN T4:0 DN SECONDS/DN EN DN TON Timer On Delay Timer T4:0 Time Base 1.0 Preset 60< Accum 32< TON SECONDS If 60 seconds have elapsed, increment minute counter by 1. 0001 T4:0 DN SECONDS/DN CU DN CTU Count Up Counter C5:0 Preset 60< Accum 59< CTU MINUTES C5:0 DN MINUTES/DN RES C5:0 MINUTES If 60 minutes have elapsed, increment hour counter by 1. 0002 C5:0 DN MINUTES/DN CU DN CTU Count Up Counter C5:1 Preset 24< Accum 6< CTU HOURS C5:1 DN HOURS/DN RES C5:0 MINUTES If 24 hours have elapsed, increment day counter by 1. 0003 C5:1 DN HOURS/DN CU DN CTU Count Up Counter C5:2 Preset 365< Accum 61< CTU DAYS C5:2 DN DAYS/DN RES C5:0 MINUTES
  • 2. This copy distributed by http://BIN95.com/ PLCCLOCK.RSS LAD 2 - MAIN_PROG --- Total Rungs in File = 6 Page 2 Saturday, October 05, 2013 - 09:47:47 This rung/counter gives current years accumulated based on 365 days counted. We pre-plugged to year 2013. You might have expected a rung for "Current Month" here (1-12), but for simplicity reasons we did not do that logic in the example. (As each month has different number of days in to and would complicate login more than we wanted to in this example.) 0004 C5:2 DN DAYS/DN CU DN CTU Count Up Counter C5:3 Preset 30000< Accum 2013< CTU CURRENT_YEAR C5:3 DN CURRENT_YEAR/DN RES C5:3 CURRENT_YEAR 0005 END