How Can We Help?

Print

How to extracts hours, minutes and seconds from a total number of seconds in HMI with a Macro/Script

 

Here, we extracts hours, minutes and seconds declared in LW0, LW1 and LW2 from a total number of seconds write in LW4

#include "MacroInit.h"
void Macro_main(IN *p)
{
MarcoInit
//ToDo
hours = total_seconds / 3600;
minutes = (total_seconds % 3600) / 60;
seconds = total_seconds % 60;
}

You can dowload the script here

Unzip it, and open the directory from the “Script Editor”