Autor Thema: mw reset  (Gelesen 370 mal)

Offline srd

  • Full Member
  • ***
  • Beiträge: 120
mw reset
« am: Oktober 16, 2024, 07:26:16 Vormittag »
Hi All
         if i have a valve saved to a marker is there away of resetting the value to 0 at a specific time. for example count water usage from april to september and keep the value visible and then reset it the 1st of jan every year. Cheers

Offline radar17892

  • Sr. Member
  • ****
  • Beiträge: 788
  • Think easy!
    • mollgruppe
Antw:mw reset
« Antwort #1 am: Oktober 16, 2024, 08:35:53 Vormittag »
Use the RTC. By comparing the date/time you generate a reset edge like this:

IF (RTC = target time) THEN M01:= true; END_IF
« Letzte Änderung: Oktober 16, 2024, 08:39:33 Vormittag von radar17892 »
Weil Einfach einfach Einfach ist!

Offline srd

  • Full Member
  • ***
  • Beiträge: 120
Antw:mw reset
« Antwort #2 am: Oktober 18, 2024, 12:11:23 Nachmittag »
my apologies it a mw that i could do with reseting the value to 0 if possible.

Offline radar17892

  • Sr. Member
  • ****
  • Beiträge: 788
  • Think easy!
    • mollgruppe
Antw:mw reset
« Antwort #3 am: Oktober 19, 2024, 12:21:21 Nachmittag »
IF (RTC = "target time") THEN
   MW1:= 0; END_IF
To reset the flag word use the RTC including seconds, then the word 1s is written with zero.
Weil Einfach einfach Einfach ist!

Offline srd

  • Full Member
  • ***
  • Beiträge: 120
Antw:mw reset
« Antwort #4 am: Oktober 21, 2024, 07:03:45 Vormittag »
Can it be written in function block

Offline radar17892

  • Sr. Member
  • ****
  • Beiträge: 788
  • Think easy!
    • mollgruppe
Antw:mw reset
« Antwort #5 am: Oktober 21, 2024, 21:17:13 Nachmittag »
Test this Program with UF
Weil Einfach einfach Einfach ist!