View Full Version : program after plc shut off
April 27th, 2002, 07:56 AM
hi everybody, is it possible to continue the timer or counter value after the plc is shut off?
April 27th, 2002, 08:24 AM
When you say "shut off" do you mean powered down or do you mean switching plc from "run" to "stop"?
April 27th, 2002, 08:25 AM
Yes and No!
It is possible to compare two different time.
When the PLC shuts off you can move the RTC(Real Time Clock) value to an holding register array and later compare the new actual value of this RTC to the on you memorized earlyer...
Hence you will have a time duration value which will still take into account the time when the PLC was OFF...
Besides that, OFFF really means OFF
April 27th, 2002, 08:39 AM
wow! that was quick. The (Off) i mentioned is really off. THe power supply to the plc is off. THere's no supply to the plc. You see, the plc is located inside the machine, and our customers tend to shut down the supply to the machine, and well everything restarts when the machine is powered on again.
Omron CPM1A (AC).
April 27th, 2002, 09:16 AM
If your using a CPM1A, try using counters as timers. Counters are retentive and retain their current value on power down.
If you were using Timer 000:
Timer Input 0.1 sec clock
|---| |-----| |--------------[ CNT ]--|
| [ 000 ] |
| Reset [#0100] |
|--| |-----------------------[ ] |
Use contact of CNT 000 instead of TIM 000 as output of timer.
This makes an accumulating timer rather than one that loses its current value on power down. It will pick up where it left off when the power down came.
It will not continue to time with the power off, but maybe you could do math like Pierre suggests to move the differnce to the current value.
April 27th, 2002, 09:33 AM
thanx alot guys, the cnt worked! But the cnt value seemed to be interfeered by one of the (ADD Function). I placed a 0.02sec pulse infront of the (add) which i use to represent an encoder. THe value disturbs the CNT VALUE.
April 27th, 2002, 09:49 AM
Did you leading edge condition (one shot) the Add function? If not your counter value is going to go wild. Use an @ in front of the ADD (like @ADD) to differentiate the ADD function.
April 27th, 2002, 10:08 AM
I guess i'm too weak. Well, yes i have all the math fuction already set in LEADING EDGE from the beginning. But perhaps something else is wrong, I cant find the cause. The CNT value isn't counting. perhaps you should look at the diagram.???if it's no trouble to you. How to save as jpg?
April 30th, 2002, 09:48 PM
Reading on this older stuff I remembered that when you pick a counter or timer number in those OMRONs PLC, you have to be carefull...
Timer # 1 ... T001 has the same memory allocation as counter # 1 CNT001.
If you have a T001 ...AND... a CNT001, they will interfere with each other.:cool:
One trick is to pick your counter number before you write the program... say you'll be using 001 to 030 for copuntersand the rest for timers... it prevents those funny things like changing values...
May 1st, 2002, 02:29 AM
Pierre makes a good point. Another way of avoiding this conflict would be to always start with timer #000 and counter #127 (or whatever the highest number is). Then, as you need more timers, use 001, 002, 003, on up. As you need more counters, use 126, 125, 124, on down. This avoids having to allocate a specific number of timers or counters beforehand.
Back when I last used Omron stuff, we were limited to only 48 timers and counters (C20s era), so you had to use them sparingly!
May 4th, 2002, 10:11 AM
Many thanks! The apllication worked just the way I wanted it to. It's the first batch of our machines using PLC. We were using HARDWIRES previously! You should've looked at the reaction on my superiors face when the machine came to life.
November 25th, 2003, 11:13 PM
it depends r u refering to retentive memory a timer will retain its values when power to processor is lost but if the counter or timer is a progammed function meaning executed solely by the cpu then when power is lost all counting or timing will stop.