|
|
|
(you are viewing a thread; or go back to
list of threads)
Presettable timer (by José SCOURNEAU)
Good morning all,
I wish to realize a timer adjustable by potentiometer between 10 and 120 seconds with start of the delay by a contact. Would you have an idea for the program ?
thank you in advance.
Jose
Presettable timer (by DanielH)
Hi José!
Attached scourneau_presettable_TON.ld as an example on how to program your adjustable timer.
Of course, there are multiple variants for programming this task, including the use of Time to Counter Converter instruction.
See https://github.com/LDmicro/LDmicro/wiki/TIME-to-COUNTER-converter
In LDmicro wiki and in this forum there are lot of examples.
But the user's own effort to learn how to program is irreplaceable.
Best regards,
DanielH
(no subject) (by DanielH)
One step further: performing calculations of the timer parameter only when TON is activated, using the evaluation of the rising edge in contact (Edge -> Insert OSR - One shot rising).
scourneau_presettable_TON_edge.ld attached.
Best regards,
DanielH
Presettable timer (by José SCOURNEAU)
Hi Daniel,
thank you for your quick response!
I will check that as soon as I have some time,
thank you again.
Nice day to you.
Jose
Presettable timer (by José SCOURNEAU)
Hi Daniel,
Sorry, I have no experience with analog inputs, for the TOF, how to proceed ?
Thank you,
Jose
Presettable timer (by José SCOURNEAU)
Daniel,
in your first sample program, rung 16, how to configure the TON for scale?
Impossible for me to write "scale" in the field "time (ms)"
Thank you,
Jose
Presettable timer (by DanielH)
...
>Hi Daniel,
>
>Sorry, I have no experience with analog inputs, for the TOF, how to proceed ?
What kind of Presettable timer do you need?
Delay ON (TON), Delay OFF (TOF), One Shot or Positive Pulse timer (THI), cyclic timer (TCY)?
I have developed my example as a TON; make a different type of presettable timer is not related on how to process potentiometer signal (analog input, rungs from beginning until 14) to obtain the "scale" value, but the logic for processing Xstart digital signal (rung 16).
Each kind of timer requires its own logic... but is easy to solve in this case: you can replace TON instruction in rung #16 by a TOF, or a THI, or a TCY...
Of course, you can do these changes using the same "scale" variable as parameter (please see my previous post on names for variable field in timers (and counters, too)).
I recommend you to try and simulate, you don't harm your PC!!!
BTW: there is a lot of programming examples in LDmicro forum, wiki, youtube. Take your time to read and learn!
Best regards,
DanielH
(no subject) (by Tom J.)
José SCOURNEAU,
It's easier, and kind of neater to use two push buttons and step the delay value up and down rather than bother with ADC.
A PERSIST would ensure the timer value remained on the next boot but it's not a good idea to persist often so it would be maybe once per every timer cycle or two at most to keep the MCU healthy.
Presettable timer (by José)
thank you for all these details,
I installed the latest version LDmico as suggested by Daniel,
I will test, ...
Post a reply to this comment:
|