Structured Text of FAL Instruction

Ish_Yad

Member
Join Date
Jun 2016
Location
Wuppertal
Posts
9
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.
 

Similar Topics

Hello, I am using studio 5000 pro and am trying to figure out the structured text. Here's my scenario: An operator scans a barcode, the barcode...
Replies
15
Views
284
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
417
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
153
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
91
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,389
Back
Top Bottom