Hi I don't know how to make counter which will count how many hours and minutes a motor is running!?
I have one tag which represent motor status of running (td1), 0=not running and 1=running. I have many motor where I have to do this couter.
I only managed to get start and end date and time and that's it.
In Data Change Script I placed this code:
Tagname[.field]:td1
IF td1 == 1 THEN
day1 =$Day;
month1 =$Month;
hour1 = $Hour;
minutes1 = $Minute;
ELSE IF td1==0 THEN
day2 =$Day;
month2 =$Month;
hour2 = $Hour;
minutes2 = $Minute;
ENDIF;
ENDIF;
Can someone please help me.
Thanks,M
I have one tag which represent motor status of running (td1), 0=not running and 1=running. I have many motor where I have to do this couter.
I only managed to get start and end date and time and that's it.
In Data Change Script I placed this code:
Tagname[.field]:td1
IF td1 == 1 THEN
day1 =$Day;
month1 =$Month;
hour1 = $Hour;
minutes1 = $Minute;
ELSE IF td1==0 THEN
day2 =$Day;
month2 =$Month;
hour2 = $Hour;
minutes2 = $Minute;
ENDIF;
ENDIF;
Can someone please help me.
Thanks,M
Last edited: