Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PLC program to "look up" sunrise/set time. 1

Status
Not open for further replies.

henderd

Mechanical
Aug 25, 2003
5
0
0
US
Hello,
I am new to PLC ladder logic and need to produce a directSoft program for a DL05. This program should disable a lighting system for 12 different time periods (corresponding to day light) during the year. I am thinking a look up table. As I am still somewhat inexperienced with ladder logic, so an example would be helpful.
Thanks for the help.
Dave
 
Replies continue below

Recommended for you

Why not use a light sensor as one of the inputs and let that be the control. When it starts getting dark the plc turns on the lights. Maybe I am not understanding what you are asking. How about some more information about your system.

Steve
 
That would be the easy way out for sure. The point of this project is for me to learn how to store and retrieve data from the PLC registry. I am finding out that the documentation that came with my controller is very short on examples of actual programs. I am really looking for a library of PLC programs that I can look through and pull out what I need. I am not sure if exists.
Thanks for the help
Dave
 
Hello Henderd, Steve is right - using a light sensor would be more useful for determining when to turn on the lights, especially when you consider that your PLC table has no capability to detect a cloudy, stormy day. However, if you are determined to use a table.... I assume the 12 periods you refered to are months of the year? Am I correct? And I further assume that you would input to the PLC table the approximate sunrise/sunset time for that month. then here might be a possible framework for your program.
If your PLC stores Date, find out where in memory it stores the Month and the Time. Pick a memory area in you PLC for the table and input it in order of the months in sequential memory locations...ex January set time, february set time and so on through December, Then january rise time, february rise time etc.... Look up the current time in your program to determine if it is AM or PM. If it is AM you will be turning lights off, PM on. Look up the current month. Then look up the rise or set time in your PLC table based on the (First sequential memory location-1) + the month #. If current time = looked up time toggle the lights.
My other suggestion - use the light sensor and just tell people you are using a look up table - they won't know the difference
 
EEO, Yes, The 12 periods do represent the 12 months of the year. I would love to use a light sensor but this is a training project with specific learning goals. this answers xnuke too. As for nbucska, I have looked at some sunrise/set equations and they are very complicated due to the wobble of the planet. If there are some simpler equations you know of, I would love to find them. As for the sensor which detects the motion of the earth, I believe it would be called a pendulum.
-Dave-

 
Status
Not open for further replies.
Back
Top