katratzi said:
Thanks Ron and rdrast. my program is working now, though I am not exactly sure why. It was very similar to the program rdrast sent
to me, although I didn't use a bit to initiate the timer. The only change I made in my program was to move the C5:0 RES instruction to the last rung, instead of the rung immediately after the counter.
And what the hey, it started working!? I tried attaching my
program to this reply but my evaluation version of Winzip is giving
me an error message, "failed to compress file footagecount0.rsp" so
now I've got to look into that. thanks a bunch for all the help.
Without seeing your program, it sounds like you had the counter reset triggerred off of the counter done bit, BEFORE you tried your move. That definately won't work (in AB PLC's).
Just for a bit of information, PLC's from different manufacturers (and PLC's from the same manufacturer) often opererate quite differently from one another. It is important to read about how they process their scans to avoid problems like this in the future.
With most PLC's out there today, any change to a bit or word done in a program becomes affective immediately. In your case, that is reflected by the RES instruction clearing not only the counter, but resetting it's .DN bit immediately. Any following logic will never see the .DN bit set. There are ways around that, if you wish, one would be to move your SOR XIC C5:0.DN RES C5:0 EOR run to the rung just BEFORE the actual counter rung. If you do that, then the entire program will see the counter .DN bit active for one complete scan, before the reset.
I say most PLC's, because not all operate this way. Some don't actually process the actual 'RESET' command until it's corresponding counter logic block is executed again. Some self-reset, set a 'DONE' status, and wait for you to manually clear it.
Even I/O isn't always scanned the same way. In typical Synchronous-I/O PLC's, Inputs are scanned before the start of the logic, and copied into a 'Shadow Input Table', then the logic runs, using the state of the inputs before the logic scan, and updating outputs in a 'Shadow Output Table'. At the end of the scan, the 'Shadow Output Table' is copied to the actual physical outputs. Some PLC's though (ControlLogix for one) have an Asynchronous I/O scan. With CLX, the state of an input can change at any time during the logic scan.
Moral of the story, pay some attention to the manufacturers published literature before programming!
Good luck!