Skip to main content

Reset Tag Value Each Day

Comments

2 comments

  • Hugh Whitefur

    If you're just trying to edit a tag's value, can you try using

    TagName@ = 0

    instead of the SETSYS commands? As a shortcut, you can retrieve and change tag values with the TagName@ syntax like they are normal Basic variables.

    Additionally, instead of getting and checking the time you can use ONDATE commands to schedule actions. If you want to send a report every day at midnight you can do something like:

    ONDATE 1, "0 0 * * *", "GOTO SendReport"
    END

    SendReport:
    // report email actions
    TagName@ = 0
    END

    The "0 0 * * *" is a cron statement meaning "every day at 00:00". I recommend looking at crontab.guru to help with these statements, as well as RG-0006-01-EN - Programming Reference Guide for more info on our implementation of Basic.

    1
  • Lucas Kirk

    Thank you for the response, your solution worked for me.

    0

Please sign in to leave a comment.