QUOTE (Pulsar2003 @ Nov 3 2009, 10:10 PM)

Hello.
I like the idea of using a Micro 1000 or even 1100.
With the PICO it's quite easy to get some timers or have some output go on or off because the command is there and available.
If I were to do that with a Micro how would I need to proceed? Which commands should I use? S xx...it's 38 and 39 for the clock and 40-41 for the date...or something like that. I would have to move this and probably convert it to BDC TOR (I dont have my laptop with me so I write thing out of memory)...
Thank you.
Unless you are driving 7-segment LED displays directly from outputs or dealing with thumbwheel switches (which are more expensive than small graphical displays), there is almost never a reason to use BCD.
With a Micrologix 1100, the timers are very easy. To start with on a blank project, you only have 1 timer allocated. To create more, right-click on the "Data Files" folder and select properties. Then you can either create more data files, or select a data file and click "Properties" to change the length. Then you can add as many timers (or any other data file except the I/O images and the processor status file) up to the limits of memory. Then just use the appropriate timer command (TON, RTO, or TOF) depending on your needs followed by triggering off the timer bits (usually TT or DN, although the DN bit in a TOF function is more like "not done").
The PLC-5 uses S registers for the clock. On a Micrologix, it's somewhat different because it is similar to the SLC series. Double-click on "Function Files" to see the clock. Change the tab to RTC (Real Time Clock). You can visually see the clock there. The clock register names are RTC:0.YR, RTC:0.MON, and so forth. Hold your mouse over an entry and it will show you the correct syntax for the tag when you use it in a program.
If you want something to happen at the top of every hour, this is how I do that:
NEQ RTC:0.HR N7:0 OTE B3:0/0 -- if the clock hour isn't equal to the cached value (N7:0 in this example), set bit B3:0/0
XIC B3:0/0 MOV RTC:0.HR N7:0 --- when bit B3:0/0 is set, move the current hour value into the cached value (N7:0)
Then trigger all your code off of B3:0/0. This bit gets set exactly once each hour. You can also add a check on the minutes if you prefer a different time than the top of the hour.
If you wanted to do something once at the top of the hour each day, you could use something like this:
EQU RTC:0.HR 8 ONS B3:0/0 xxx --- At 8:00:00 AM each day, do "xxx" exactly once. The one shot resets at 9:00:00 AM, then retriggers again the next day at 8:00:00 AM for one scan.
Again, you can add a "minutes" or even "seconds" check to trigger an event at some other odd time.
The real time clock registers can be written to. Writing values into them can update the clock setting. So if you do something like this:
XIC B3:0/0 MOV N7:0 RTC:0.YR
XIC B3:0/0 MOV N7:1 RTC:0.MON
XIC B3:0/0 MOV N7:2 RTC:0.DAY
...
XIC B3:0/0 OTU B3:0/0
...then you can write the correct time into N7:0 to N7:5 (year, month, day, hour, minute, second). Then set B3:0/0 and the clock will be updated in one scan.
The same sort of code works with a PLC-5 except that you use S registers. The clock reading code will work with ControlLogix, too, but you have to first get the clock value (with GSV), and you have to set the clock with the SSV command.