SFC21 (FILL) in RSlogix5000??

SKAN_INNOVA

Member
Join Date
Mar 2012
Location
barcelona
Posts
4
Hi.
I came from S7 and i have a problem trying to reset the value of some tags. In Siemens is To Easy reset a DB (With BLKMOV or FILL), in Rslogix i can't find the solution to reset all the values of the structure with one instruction....

I have a structure of tags composed of differents User data types and generic data types (Bool, Sint, Array, Int, Dint) this structure have the same content of one DB in S7.
In S7 at the end of the program i reset all the DBs to 0 with "FILL" (calling SFC21), it's the following code:

L 0
T #auxFill
CALL SFC21
BVAL:= #AuxRstFill
RET_VAL:= MW4
BLK:= P#DB504.DBX0.0 BYTE 144


With this code we charge to 0 the local variable "#auxFill" and this value is transfered to all the bytes specified in the line BLK:= (In DB504, start at Byte 0.0 End at Byte 144 (all the lenght of the DB)).

In Rslogix i can't do this?, i can't reset all the values of a tags structure (int, array, bools....) in one instruction? I try with "CLR", "MOV".... but this instructions don't accept the sctructure.......

To copy one DB in other (with exactly the same tags and types of data) i use "CPS" and works correctly. But when i want to Reset all the DB i can't use CPS.


Thks for your attention and sorry for my bad English.
 
Look at the FLL. It accepts a structure as both source and destination.

The FAL will let you be more selective.

Good luck

(8{)} :) .)
(Yosi)
 
RSLogix has a FLL (Fill File) instruction, but I think it won't work for you since you are using a structure of various data types (UDT).

I think your simplest solution is going to be to create an instance of that UDT which contains all zeros and then COP (copy) it to the working tag you wanted cleared.

EDIT: Maybe I am wrong. Yosi says FLL does work with UDTs.
 
Last edited:
it works!

Hi.
Thankyou for your quick answers.

i try with the FLL instruction and i think works ok!🍻! i can't try with the real structure because i need to debug some errors in the program.... but i create a structure with a lot of data types, char arrays, bool, Dint.....fixing it value.
With FLL Source: 0, Dest: Mystructure. All the tags of all the types of data are reset to 0!!

Thankyou very much. i have little time to a project in a diferent plataform thah i usually use...
 
You're welcome.

If you're a newbie to Rockwell then you should read up on the most efficient way to build structures. It's highly recommended NOT to use INTs in the ControlLogix. They work best on DINTs and, yes, there's a BIG difference in execution times.

Good luck
(8{)} :) .)
(Yosi)
 

Similar Topics

I am trying to reset all values in DB10 to 0. I think the best way to do this is using SFC21 the fill block. I made a copy of DB10 with all 0's...
Replies
6
Views
9,839
Hi' Can anyone tell me what is wrong here, I can't compile this code. FUNCTION_BLOCK FB10 VAR_INPUT Step : BOOL; END_VAR VAR //...
Replies
3
Views
3,028
Anyone tell me why this code comes up with an error, I'm trying to fill an array with a value, the array is in the stat section of the FB (60...
Replies
3
Views
3,214
Dear colleagues, hope you can help on that matter. We have a project where we need to control 3 servomotors to move a auger feeder system...
Replies
38
Views
1,157
So this is my attempt at collecting and displaying data on a Cmore panel With a DL06. Each pair in my logic is the "Time total" or the TA15 and...
Replies
4
Views
477
Back
Top Bottom