..How do you not make a counter start at zero. My clock needs to run from 1-12.
Tom,
The usual, regular, 24 hour clock (that has been in use for a long time by a lot of people) starts at "0" Hour and runs past 23:00. When it hits 24, it shifts to 0:00 again. Why would that not work? Is the 1-to-12 stupidity based on actual instructions from your instructor?
If so, you cannot reprogram PLC built-in instructions (such as Counters), but you can work around their limitations. If you want to start at "1" (where the counter normally starts at 0), then every time it goes to 0, put in an instruction to add 1 (or MOVE 1) to the Counter Accumulated value (C5:X.ACC in RSLogix where X is the counter number).
If it were me, I would stick with "real" things, like the way clocks work, instead of going off on an imagination trip and trying to reinvent the wheel. I would set my clock to run from 0:00 Hours and Minutes to 23:59 Hours and Minutes. Using Comparison Instructions, when Hours >= 0 or <= 11, the turn on "AM" output. When Hours >= 12 or <= 23, the turn on "PM" output. Period, done, and what is the next question?
My current teacher in my plc class has assigned us a task of programming a 12 hour clock on a slc 5/03, using timers and counters.
Did he say it had to be a "12-hour clock", or did he say it had to indicate 12 hour periods of AM and PM? That is a totally different problem!
TIP: If you want help that is very specific, accurate, and zeroed in on your actual problem....then please post the actual Lab # 6 problem as written, not a second-hand version as loosely interpreted by an admitted beginner (you - who may not understand enough to correctly interpret the questions. After all, if you did correctly understand the question, you could already write the program.
If you don't want to watch and wait for a whole hour to see what is going to happen, you can highlight a register while online, and simply type in a number (think of entering 59 into the minutes counter so you only have to wait one minute to see if your hour rollover logic is correct).
As usual, Paul has a great suggestion for the final check-out. Another method I use is that for all the program versions and revisions up until the last final, I often scale my real times by some factor (say instead of 1-hour, I change that to 1 real minute, and for 10 minutes I might change that to 10 seconds. Then I run the program and get everything working, then make a final version and use Paul's method to run the final test.