sparky64
Member
I need to prompt an operator to do a certain task at 7am every other day, Monday, Wednesday & Friday.
I,ve written some code in an SLC 5/04 that increments a counter at midnight starting from Sunday, so Monday is 1, Tuesday is 2 etc......and then on the following Sunday at midnight, the counter increments to 8, when the accumulator value is equal to 8, I move a value of 1 to the accumulator, so it's back to Monday.
I then condition the 7am so it only comes on, on the 1st day 3rd day and 5th day (Counter ACC value = 1, 3 or 5).
This works fine, but I am interested to know how other people would do this, is there a more scientific way of doing this?
Cheers
Sparky
I,ve written some code in an SLC 5/04 that increments a counter at midnight starting from Sunday, so Monday is 1, Tuesday is 2 etc......and then on the following Sunday at midnight, the counter increments to 8, when the accumulator value is equal to 8, I move a value of 1 to the accumulator, so it's back to Monday.
I then condition the 7am so it only comes on, on the 1st day 3rd day and 5th day (Counter ACC value = 1, 3 or 5).
This works fine, but I am interested to know how other people would do this, is there a more scientific way of doing this?
Cheers
Sparky
Last edited: