Login Page - Create Account

Support Board


Date/Time: Tue, 07 May 2024 18:42:14 +0000



Post From: [User Discussion] How can I set a update interval for a custom ACSIL study?

[2020-02-09 17:41:38]
User353585 - Posts: 66
Thank you Ackin! I was able to make a working example!

here's the code :
////////////////////////////////////////////////////////
SCDateTime currentdatetime = sc.GetCurrentDateTime();
SCDateTime& datetimestamp = sc.GetPersistentSCDateTime(1);
bool run_code;

if (!datetimestamp)
run_code = true;
else if ((datetimestamp + 60*SECONDS)<currentdatetime)
run_code = true;
else
run_code = false;

if (run_code == true)
{

//Code you want to run


datetimestamp = currentdatetime;
}
///////////////////////////////////////////////////////
Date Time Of Last Edit: 2020-02-09 17:43:59