Hello All,
I am am working with RX Logix 5000 and new to Structured Text Programming Language. Also, I am a beginner in PLC programming. I need help!
Question:- I tried implementing the Structured Text of FAL Instruction. I am stuck with Errors. I have mentioned both the Syntax from Instruction Help and My code below.
SIZE(destination,0,length-1);
FOR position = 0 TO length DO
destination[position] := numeric_expresion;
END_FOR;
My code:-
If FG016_L1_Auto_Start Then
FG016_Step_DL_Spuelung_L1 :=1;
AOI_Day_of_Week(Wallclock);
SIZE(Day,0,Day[4]);
FOR position = 0 TO 5 DO
Day[0] := Wallclock.Actual_Day;
END_FOR;
SIZE(Month,0,Month[4]);
FOR Month[0] = 0 TO 5 DO
Month[0] := Wallclock.Actual_Month;
END_FOR;
SIZE(Year,0,Year[4]);
FOR position = 0 TO 5 DO
Year[0] := Wallclock.Actual_Year;
END_FOR;
SIZE(Hour,0,Hour[4]);
FOR position = 0 TO 5 DO
Hour[0] := Wallclock.Actual_Hour;
END_FOR;
SIZE(Minute,0,Minute[4]);
FOR position = 0 TO 5 DO
Minute[0] := Wallclock.Actual_Minute;
END_FOR;
SIZE(Second,0,Second[4]);
FOR position = 0 TO 5 DO
Second[0] := Wallclock.Actual_Second;
END_FOR;
end_if;
I ended up with the following Errors:-
Error: Line 5: 'FOR' loop invalid index initialization.
Error: Line 5, 'DO': Unexpected.
Error: Line 9: 'FOR' loop invalid index initialization.
Error: Line 9, 'DO': Unexpected.
Thanks in Advance!
Expecting Suggestions.
I am am working with RX Logix 5000 and new to Structured Text Programming Language. Also, I am a beginner in PLC programming. I need help!
Question:- I tried implementing the Structured Text of FAL Instruction. I am stuck with Errors. I have mentioned both the Syntax from Instruction Help and My code below.
SIZE(destination,0,length-1);
FOR position = 0 TO length DO
destination[position] := numeric_expresion;
END_FOR;
My code:-
If FG016_L1_Auto_Start Then
FG016_Step_DL_Spuelung_L1 :=1;
AOI_Day_of_Week(Wallclock);
SIZE(Day,0,Day[4]);
FOR position = 0 TO 5 DO
Day[0] := Wallclock.Actual_Day;
END_FOR;
SIZE(Month,0,Month[4]);
FOR Month[0] = 0 TO 5 DO
Month[0] := Wallclock.Actual_Month;
END_FOR;
SIZE(Year,0,Year[4]);
FOR position = 0 TO 5 DO
Year[0] := Wallclock.Actual_Year;
END_FOR;
SIZE(Hour,0,Hour[4]);
FOR position = 0 TO 5 DO
Hour[0] := Wallclock.Actual_Hour;
END_FOR;
SIZE(Minute,0,Minute[4]);
FOR position = 0 TO 5 DO
Minute[0] := Wallclock.Actual_Minute;
END_FOR;
SIZE(Second,0,Second[4]);
FOR position = 0 TO 5 DO
Second[0] := Wallclock.Actual_Second;
END_FOR;
end_if;
I ended up with the following Errors:-
Error: Line 5: 'FOR' loop invalid index initialization.
Error: Line 5, 'DO': Unexpected.
Error: Line 9: 'FOR' loop invalid index initialization.
Error: Line 9, 'DO': Unexpected.
Thanks in Advance!
Expecting Suggestions.