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

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
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
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
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
 
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
 
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
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 

Recently uploaded (20)

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
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...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
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
 
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
 
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
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 

PLC Programming Example | Day of Week to debug

  • 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