Counting minutes in REXYGEN
-
Hello,
is there any way that I can count how many minutes an input is high? On a Unipi with REXYGEN on it.Thanks!
-
Have a look at example project 0305-01 which is included in REXYGEN Studio. I believe it solves your needs.
Connect the input signal to the RUN input of the hour_meter subsystem and change the unit parameter to "2: minutes".
Look inside the subsystem (Ctrl+U), you'll see it is built on top of the INTE function block.
Best regards
Jaroslav -
how can I read the hour meter?
for example, if I put a time block in front of it and a cnr block so that the input is 1 min high, it does not count 1 min but 0.250
-
Hello Martijn,
have a look at the following screenshot:
The BIS block generates 60-second pulses. These are fed into the hour meter. After four pulses, the output value is 4.000. From the time plot (TRND block) you can see that the hour meter works as expected.
Please post a screenshot or upload your source *.mdl files here if needed.
Best regards
Jaroslav -
but how can I read it through a rexlang block so that I can save it in a data base
-
Hello Martijn,
please clarify your question. Saving data to database is not related to the REXLANG programmable block at all. Describe in more detail the functionality you are trying to achieve so that I or anybody else can help.Kind regards
Jaroslav -
I have to record how long a conveyor belt runs here every time in minutes and store that in a database
-
Anywhone ?
-
Hello Martijn,
this will save the total number of run-minutes to database everytime the RUN input drops to OFF (FALSE):
See example 0404-01 and Database connection driver manual for details.
Hope it helps.
Jaroslav