rvaidyamath
New member
Hello there
let us say .. i need a signal to come when the aggregation period as per the clock (time of the day) is done properly . .ex., if i need a signal to come when at each 5 minute... i need the signal to show up at beginning of hh:6:00, hh:11:00, hh:16 and so on .. this could be any hour of the day … how do i get this .. The following script is what I am attempting, but it is not going as well as I had hoped.
#Code :
input givenMinute = 5;
def currentTime = GetTime();
AddLabel(yes, "Current Time: " + AsText(currentTime), Color.CYAN);
def currentMinute = Floor(currentTime / (1000 * 60));
AddLabel(yes, "Current Minute: " + AsText(currentMinute), Color.CYAN);
def remainder = currentMinute % givenMinute;
AddLabel(remainder == 0, "Remainder is a complete period: " + AsText(remainder), Color.CYAN);
AddLabel(remainder != 0, "Incomplete period: " + AsText(remainder), Color.YELLOW);
def currentHour = Floor(currentTime / (1000 * 60 * 60));
def currentMinuteInHour = Floor((currentTime - (currentHour * 60 * 60 * 1000)) / (1000 * 60));
def currentSecondInMinute = Floor((currentTime - (currentHour * 60 * 60 * 1000) - (currentMinuteInHour * 60 * 1000)) / 1000);
AddLabel(1, "Current Time: " + AsText(currentHour) + ":" + AsText(currentMinuteInHour) + ":" + AsText(currentSecondInMinute), Color.GRAY);
#code End - Appreciate the help
let us say .. i need a signal to come when the aggregation period as per the clock (time of the day) is done properly . .ex., if i need a signal to come when at each 5 minute... i need the signal to show up at beginning of hh:6:00, hh:11:00, hh:16 and so on .. this could be any hour of the day … how do i get this .. The following script is what I am attempting, but it is not going as well as I had hoped.
#Code :
input givenMinute = 5;
def currentTime = GetTime();
AddLabel(yes, "Current Time: " + AsText(currentTime), Color.CYAN);
def currentMinute = Floor(currentTime / (1000 * 60));
AddLabel(yes, "Current Minute: " + AsText(currentMinute), Color.CYAN);
def remainder = currentMinute % givenMinute;
AddLabel(remainder == 0, "Remainder is a complete period: " + AsText(remainder), Color.CYAN);
AddLabel(remainder != 0, "Incomplete period: " + AsText(remainder), Color.YELLOW);
def currentHour = Floor(currentTime / (1000 * 60 * 60));
def currentMinuteInHour = Floor((currentTime - (currentHour * 60 * 60 * 1000)) / (1000 * 60));
def currentSecondInMinute = Floor((currentTime - (currentHour * 60 * 60 * 1000) - (currentMinuteInHour * 60 * 1000)) / 1000);
AddLabel(1, "Current Time: " + AsText(currentHour) + ":" + AsText(currentMinuteInHour) + ":" + AsText(currentSecondInMinute), Color.GRAY);
#code End - Appreciate the help