Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Timer 0 Retentive

(you are viewing a thread; or go back to list of threads)

Timer 0 Retentive (by Kumar)
Dear Johnathan,

Kumar here. There is an application, where i've to use retentive timer for control using 16F628A. The sequence goes like this:


----------------------------------------------[PERSIST TO]
|
-----------|XRA2|------|XRA3|-----------------(TO 10SEC.)
| |
-----------|R1000|----
|
-----------|T0|-------------------------------(YRB0)

But the thing is, it does not work correctly. Could you help me how to solve the problem? Please reply.Thanks.
Fri Jan 29 2010, 18:00:37
(no subject) (by MGP)
Kumar, can you upload the .LD file ? as ascii files are hard to understand.
Maybe a little explanation there of what you want.
Sat Jan 30 2010, 13:01:34
(no subject) (by Kumar)
To MGP,

This is the LD.file that you've asked for. Actually the problem is, the value of the TO could not be saved in EEPROM. This is because, sometimes when the power is switched OFF & ON again, the value of the TO is something goes to like zero. It couldn't hold the last value before the power down. So, is there any mistakes in the ladder sequence?. Please check & reply. Thanks.
Sun Jan 31 2010, 08:18:15, download attachment TO value Retention.ld
(no subject) (by MGP)
Kumar,

You cannot do that because TO{persist} IS NOT EQUAL TO(timer)
These are two different things

As for the timer, if you turn off the power then the timer is no longer a timer.
The timer always resets on power up.

As for TO{persist} (variable) you must use the instructions that are applied to variables

The manual also says :
If a variable that changes frequently is made persistent, then the
EEPROM in your micro may wear out very quickly, because it is only good for a limited (~100 000) number of writes.

So be carefull

Now your problem: You need a circuit that detects a power down connected to an input pin that triggers a MOVE instruction.
Use a countup or countdown instruction and a set-reset coil for your pseudo retentive timer.

But how do you gonna restore the T0 variable to 10 sec after you have changed the TO variable to another value?
Mon Feb 1 2010, 06:51:01
(no subject) (by Kumar)
To MGP,

Kumar here. I think there are some mistakes in the sequence. I didn't add that sequence, like what you've said about the
restoring the TO variable, when it change to another value. So, i'm also feel it will be better way to use the counters & SET/ RESET for this timing purpose. As what you've said, T0 persist & T0 are not equal. I will change the sequence & try with that one. I will come back to you, if any error arise. Anyway, thanks a lot for your reply.
Tue Feb 2 2010, 05:44:38
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):