Structured text For/IF DTL - Siemens Tia Portal V11

BartPeters88

Member
Join Date
Feb 2015
Location
Asten
Posts
18
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.
 

Similar Topics

I have an expression in a structured text routine of a Logix controller that looks more or less like the following: ResultInteger := Integer1 *...
Replies
13
Views
374
Good evening. I display the step number of a SFC on a display. Sometimes, on a trip, it goes quickly through many steps and I need to prove to...
Replies
1
Views
110
I am trying to set up a piece of equipment with a Horner HE-X4R. I'd like to use structured text and so far I'm just trying to get a basic On/off...
Replies
0
Views
66
Good morning. I'm doing a rehab and I need to recycle some part of the old code that won't change and that I need. This is a calculation that...
Replies
22
Views
1,339
I'm writing some structured text that's handling a data structure that comes from a PC. The PC structure is in the "new" LREAL 64-bit floating...
Replies
3
Views
481
Back
Top Bottom