SlideShare a Scribd company logo
1 of 1
Download to read offline
Https://BIN95.com
Simple Track Day of Week (M,T,W,T,F,S,S) © BIN95.com
On day of loading, pre plug C5.30.acc with value equal to what the current day of week is. (this is program setup) It simple and only requires minimum maintenance. The counter resets its
self when counter done bit fires. thus a virtual engine.
So for example, it is wednesday when you load the program, set C5:30.acc to = 3. If it was a friday, you would C5:30.acc to = 5. (Some PLC/PAC may need counter preset set at 8 instead
of 7.)
0000
EQU
Equal
Source A S:40
0<
Source B 23
23<
EQU
Clock
Calendar
Hours
EQU
Equal
Source A S:41
0<
Source B 59
59<
EQU
Clock
Calendar
Minutes
CU
DN
CTU
Count Up
Counter C5:30
Preset 7<
Accum 0<
CTU
Day of week Counter
(1=Mon,2=Tue,3=Wed,
4=Thu,5=Fri,6=Sat,
7=Sun)
DOWCNT
C5:30
DN
Day of week Counter
(1=Mon,2=Tue,3=Wed,
4=Thu,5=Fri,6=Sat,
7=Sun)
DOWCNT/DN
RES
C5:30
Day of week Counter
(1=Mon,2=Tue,3=Wed,
4=Thu,5=Fri,6=Sat,
7=Sun)
DOWCNT
From there on out, C5:30.acc will keep track of what day of the week it is.
0001
LIM
Limit Test
Low Lim 6
6<
Test C5:30.ACC
0<
High Lim 7
7<
LIM
Day of week Counter
(1=Mon,2=Tue,3=Wed,
4=Thu,5=Fri,6=Sat,
7=Sun)
DOWCNT.ACC
B3:20
7
ON is Day of week
equals SAT or SUN.
(One time setup of
C5:30.acc with day
downloading. IE:3=w)
With a huge Gregorian claendar mathimatical formula, you can do it another way that it also acocunts for leap years and does not require setup value be entered. 10 differant programmers,
you could have 10 differnt ways to takle this one. Always opt for the simplist way when possible.
Formula: N = d + 2m + [3(m+1)/5] + y + [y/4] - [y/100] + [y/400] + 2 ("d"=S:39, "m"=S:38, "y"=S:37, "N"=day of week 0-6)
(On some PLC processor, you have a Status word you can use that already has value 0-6 for date. Like SLC 500/3-5 uses S:53, where 0=Sunday, 6=Saturday)
0002
B3:20
7
ON is Day of week
equals SAT or SUN.
(One time setup of
C5:30.acc with day
downloading. IE:3=w)
B3:40
0
Do something, except
sat and sun.
0003 END

More Related Content

More from Business Industrial Network

Manufacturing executive leadership journal sustainability
Manufacturing executive leadership journal   sustainabilityManufacturing executive leadership journal   sustainability
Manufacturing executive leadership journal sustainabilityBusiness Industrial Network
 

More from Business Industrial Network (20)

Siemens PLC Programming Example #2
Siemens PLC Programming Example #2Siemens PLC Programming Example #2
Siemens PLC Programming Example #2
 
What is a PLC ?
What is a PLC ?What is a PLC ?
What is a PLC ?
 
Online Infrared Training Center Presentation
Online Infrared Training Center PresentationOnline Infrared Training Center Presentation
Online Infrared Training Center Presentation
 
PLC Networking Basics - Instructor's notes
PLC Networking Basics - Instructor's notesPLC Networking Basics - Instructor's notes
PLC Networking Basics - Instructor's notes
 
Plc networking basics - controllogix
Plc networking basics - controllogixPlc networking basics - controllogix
Plc networking basics - controllogix
 
Best plc-programming
Best plc-programmingBest plc-programming
Best plc-programming
 
PC vs PLC
PC vs PLCPC vs PLC
PC vs PLC
 
Thank You Veterans for your service
Thank You Veterans for your serviceThank You Veterans for your service
Thank You Veterans for your service
 
USA Manufacturing Jobs Analysis
USA Manufacturing Jobs AnalysisUSA Manufacturing Jobs Analysis
USA Manufacturing Jobs Analysis
 
Best Practices in PLC Programming
Best Practices in PLC ProgrammingBest Practices in PLC Programming
Best Practices in PLC Programming
 
Support Workforce Wednesdays
Support Workforce WednesdaysSupport Workforce Wednesdays
Support Workforce Wednesdays
 
Lean TPM Autonomous Maintenance 2
Lean TPM Autonomous Maintenance 2Lean TPM Autonomous Maintenance 2
Lean TPM Autonomous Maintenance 2
 
7 warnings: Before Hiring a Web Developer
7 warnings: Before Hiring a Web Developer7 warnings: Before Hiring a Web Developer
7 warnings: Before Hiring a Web Developer
 
PLC Simulator
PLC SimulatorPLC Simulator
PLC Simulator
 
Change Management Process sample
Change Management Process sampleChange Management Process sample
Change Management Process sample
 
Industrial doodles
Industrial doodlesIndustrial doodles
Industrial doodles
 
Manufacturing executive leadership journal sustainability
Manufacturing executive leadership journal   sustainabilityManufacturing executive leadership journal   sustainability
Manufacturing executive leadership journal sustainability
 
Strengthening Manufacturing
Strengthening ManufacturingStrengthening Manufacturing
Strengthening Manufacturing
 
Bin95 you tube-video-marketing
Bin95 you tube-video-marketingBin95 you tube-video-marketing
Bin95 you tube-video-marketing
 
Bin95 seo-smo-2010
Bin95 seo-smo-2010Bin95 seo-smo-2010
Bin95 seo-smo-2010
 

Recently uploaded

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 

Recently uploaded (20)

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 

Plc programming example Day of Week - Answ

  • 1. Https://BIN95.com Simple Track Day of Week (M,T,W,T,F,S,S) © BIN95.com On day of loading, pre plug C5.30.acc with value equal to what the current day of week is. (this is program setup) It simple and only requires minimum maintenance. The counter resets its self when counter done bit fires. thus a virtual engine. So for example, it is wednesday when you load the program, set C5:30.acc to = 3. If it was a friday, you would C5:30.acc to = 5. (Some PLC/PAC may need counter preset set at 8 instead of 7.) 0000 EQU Equal Source A S:40 0< Source B 23 23< EQU Clock Calendar Hours EQU Equal Source A S:41 0< Source B 59 59< EQU Clock Calendar Minutes CU DN CTU Count Up Counter C5:30 Preset 7< Accum 0< CTU Day of week Counter (1=Mon,2=Tue,3=Wed, 4=Thu,5=Fri,6=Sat, 7=Sun) DOWCNT C5:30 DN Day of week Counter (1=Mon,2=Tue,3=Wed, 4=Thu,5=Fri,6=Sat, 7=Sun) DOWCNT/DN RES C5:30 Day of week Counter (1=Mon,2=Tue,3=Wed, 4=Thu,5=Fri,6=Sat, 7=Sun) DOWCNT From there on out, C5:30.acc will keep track of what day of the week it is. 0001 LIM Limit Test Low Lim 6 6< Test C5:30.ACC 0< High Lim 7 7< LIM Day of week Counter (1=Mon,2=Tue,3=Wed, 4=Thu,5=Fri,6=Sat, 7=Sun) DOWCNT.ACC B3:20 7 ON is Day of week equals SAT or SUN. (One time setup of C5:30.acc with day downloading. IE:3=w) With a huge Gregorian claendar mathimatical formula, you can do it another way that it also acocunts for leap years and does not require setup value be entered. 10 differant programmers, you could have 10 differnt ways to takle this one. Always opt for the simplist way when possible. Formula: N = d + 2m + [3(m+1)/5] + y + [y/4] - [y/100] + [y/400] + 2 ("d"=S:39, "m"=S:38, "y"=S:37, "N"=day of week 0-6) (On some PLC processor, you have a Status word you can use that already has value 0-6 for date. Like SLC 500/3-5 uses S:53, where 0=Sunday, 6=Saturday) 0002 B3:20 7 ON is Day of week equals SAT or SUN. (One time setup of C5:30.acc with day downloading. IE:3=w) B3:40 0 Do something, except sat and sun. 0003 END