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

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
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
 
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
 
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
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
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
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 

Recently uploaded (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
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...
 
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
 
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
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.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
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 

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