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

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
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
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
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
 
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
 
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
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
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
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
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"
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
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
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
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
 
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
 
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"
 
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
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

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