Help with function blocks
contactform last edited by
I was wondering if could get some help with choosing the correct block/s for the below process?
Use a boolean input to capture/get/display a point in time. i.e. pressing a pushbutton, captures/displays the the time “17:30:02”.
Use a different boolean to reset the above time to “00:00:00”.
I was thinking about using the “DATETIME” block but there doesn’t appear to be a method of resetting it to zero/nothing?
jaroslav_sobota last edited by
sure you can. Can you please describe in more detail what is the end goal? What problem are you trying to solve? Some kind of stop watch? Or maybe run-hours counter?
The DATETIME block is very likely way too complicated for your needs.
BailP last edited by
I'm hoping to use this function to record/capture what time a pushbutton has been pressed - I'd also like the ability to reset the captured time?
for measuring time of pressed pushbutton I would go for integrator (INTE function block) with ti=1.
What is reason for measuring pushbutton pressed time? I'm asking because my proposed solution doesn't have to be the best for your end goal. Let us know.
BailP last edited by
Thanks for your help with this subject - very much appreciated.
In terms of setting up the block, I have a few small questions:
- Input: What inputs do I provide to the block? A "CNI =1" to the "ti" input? Are any other inputs required?
- Output (a time that I can display on RexHMI): Output "Y" - is that correct?
- Reset: The block can be reset with a "Bool = 1" to the "R1" input?
The reason for measuring the pushbutton pressed time is to provided a centralised display for an access control system
let me answer your questions:
ad 1) Yes, in order to count time connect CNI=1 to "ti" input as you proposed.
ad 2) Correct, "Y" should contain time.
ad 3) Exactly.
It also assumes that your boolean signal from pushbutton is connected to input "u".
For more details about the INTE function block see docs: https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/INTE.html#x81-800005