BartPeters88
Member
Hey there,
I have some issues with my code below:
IF "OUT_MachineActive" = TRUE THEN //output when the machine is active
"webdata".I_ReadTime := RD_SYS_T("webdata".DTL_StartTime); //measure time to check how long the machine is active
"webdata".T_MachineActivity := "webdata".DTL_StartTime - "webdata".DTL_EndTime; // substract to get the total machine activity(in MS)
"webdata".DI_MachineActivity := TIME_TO_DINT("webdata".T_TotalActivity + "webdata".T_MachineActivity); // Convert The machine activity to DINT So I can send the information to my webserver. (Javascript/html doesn't like TIME)
IF "GL_Pulse2" = TRUE THEN // negative pulse when machine is turned ON
"webdata".T_TotalOffline := "webdata".T_TotalOffline + "webdata".T_MachineOffline;
FOR "webdata".Int_forLoopValue := 0 TO 25 + 1 DO
IF "webdata".Arr_DataLogTime[#Temp_Int_Forloop] = DTL#1970-01-01-00:00:00.0 THEN // If the value is NOT SET(0/null or whatever u wanna call it)
"webdata".Arr_DataLogTime[#Temp_Int_Forloop] := "webdata".DTL_StartTime; // set the first 0/null value in the array to the current starttime.
END_IF;
END_FOR;
END_IF;
END_IF;
When The Pulse triggers it gives an error:
Area Length error in FC1(my function block) - Processing will continue(no OB processing).
I can't figure out the problem.
I have some issues with my code below:
IF "OUT_MachineActive" = TRUE THEN //output when the machine is active
"webdata".I_ReadTime := RD_SYS_T("webdata".DTL_StartTime); //measure time to check how long the machine is active
"webdata".T_MachineActivity := "webdata".DTL_StartTime - "webdata".DTL_EndTime; // substract to get the total machine activity(in MS)
"webdata".DI_MachineActivity := TIME_TO_DINT("webdata".T_TotalActivity + "webdata".T_MachineActivity); // Convert The machine activity to DINT So I can send the information to my webserver. (Javascript/html doesn't like TIME)
IF "GL_Pulse2" = TRUE THEN // negative pulse when machine is turned ON
"webdata".T_TotalOffline := "webdata".T_TotalOffline + "webdata".T_MachineOffline;
FOR "webdata".Int_forLoopValue := 0 TO 25 + 1 DO
IF "webdata".Arr_DataLogTime[#Temp_Int_Forloop] = DTL#1970-01-01-00:00:00.0 THEN // If the value is NOT SET(0/null or whatever u wanna call it)
"webdata".Arr_DataLogTime[#Temp_Int_Forloop] := "webdata".DTL_StartTime; // set the first 0/null value in the array to the current starttime.
END_IF;
END_FOR;
END_IF;
END_IF;
When The Pulse triggers it gives an error:
Area Length error in FC1(my function block) - Processing will continue(no OB processing).
I can't figure out the problem.