FAL I think???

JeffKiper

Lifetime Supporting Member + Moderator
Join Date
Jun 2006
Location
Indiana
Posts
2,460
Guys and Gals I need to add a group of 47 Integers. I have never used the FAL so I don't understand it. Is that what I should be using or just an CPT expression? Is so can you give me a few pointers?
 
Think of a FAL as an instruction with a built in FOR loop. The loop can run in ALL mode or INCREMENTAL mode, that is it will do all calculations in a single scan or it will do one calculation per scan until done.

For a PLC/5 for your application

CLR N7:0 //you need to clear the destination first
FAL R6:0 47 0 ALL N7:0 N7:0 + #N7:1

is eqivalent to

N7:0 := 0;
FOR i:= 0 to 46 DO
N7:0 := N7:0 + N7:[1+i];
NEXT i


For a ControlLogix you would enter it as
CLR SUM
FAL FALCTRL 47 0 INC SUM "SUM + MYARRAY[FALCTRL.POS]"


You can index the address of either the destination and/or some or all elements addressed in the expression. For example

FAL R6:0 10 0 ALL #N11:0 #N12:0 + #N13:0

is equivalent to

For i:= 0 to 10 do
N11: := N12: + N13:;
Next i;

In a PLC/5 you can used indexed addressing. In the CLX you use Control.POS as an array index value. So it becomes

My_Int_array[3][10] //.3 x 10 array

FAL FALCTRL 10 0 INC My_Int_Array[0][FALCTRL.POS] My_Int_Array[1][FALCTRL.POS] + My_Int_Array[2][FALCTRL.POS]
 
bernie yess they are in sequential order. Sorry I didn't post that. You know when you are to close to something you just can't see it.

Alaric The light bulb just clicked. I think I will be able to use it know. If I get hung up I may have to ask for some more help. I will let you all know how it works.
 
Alaric
I have been fighting fire every where else. So I jusy got to this. That little (#) Index address symbol means the world doesn't it. Thanks for the help so far it all looks great.
 

Similar Topics

Is there a way to use the FAL instruction to do +=2 instead of +=1? I have an array that is organized with alternating "data" and "flag" values...
Replies
5
Views
126
Hey everyone, Just a question regarding the conversion of FAL element addressing between a PLC-5 and Logix5000-series processor. In the...
Replies
3
Views
1,621
I have a timer array and need to 'copy' the .acc's to another array. This is part of data analysis being requested so there is a lot of copy and...
Replies
2
Views
1,315
I am trying to figure out an instruction. What does the MOD do in a FAL instruction. For instance I have an expression in the FAL...
Replies
1
Views
1,285
Good afternoon all, I am attempting to get a panelview standard 1000e too communicate completely with a 1756-L83E through a 1756-DHRIO card and...
Replies
2
Views
2,865
Back
Top Bottom