Use system tag SystemCurrentDateTimeNewHour (
teslascada.com/HTML/tags.html). Create some local tags for your count purposes for Example: HoursCount and HoursSet.
Script should work every cycle.
if (Tags.SystemCurrentDateTimeNewHour==true){
Tags.HoursCount++;
if (Tags.HoursCount>Tags.HoursSet){
Tags.HoursCount=0;
int day = datetime(5);
int hour = datetime(3);
string reportname = "report"+day+hour;
reporttopdf("Report1",reportname);
}
}
Best regards,
Ruslan