1/19/2024 5:48 PM | |
Joined: 6/11/2019 Last visit: 8/18/2024 Posts: 2213 Rating:
|
Hello AutoGen_3711723, Date-related holidays, such as Christmas or Labor Day, can be easily implemented using the logo's annual timer. More effort is required for the variable holidays. You use the Gaussian Easter formula as a basis. It is best to use the summary presented by Heiner Lichtenberg. This is the best way to implement a routine for the logo program. However, you need divisions with residual value.Scorp has already published something like this in the German part of the forum. Now the current date and year cannot be read out, so you can only get to it indirectly. Some time ago I uploaded a UDF for the date in the German part of the forum. However, there is no comparable option for the year. This can only be implemented using a retentive counter that counts up by +1 at the turn of the year. But this should be designed in such a waythat if the logo is inactive at the turn of the year, the impulse is updated after the voltage returns. But if you have another logo in the same network, you can get around all of this by "stealing" the required time values from another logo. In order to be able to work with the Easter formula and the current date, it is easier to convert the date values into "days of the year" (January 1st would be day 1 and December 31st would be day 365 (366). So you have calculated Easter Sunday and Easter Monday would be Easter Sunday +1. Finally, all you need is a comparator that compares the calculated variable holidays with the current day of the year. Have fun programming Greetings, Ella_68 (translated with Google) |
Follow us on