Clear Entire Binary File

zblum

Member
Join Date
Mar 2016
Location
Ohio
Posts
38
Any quick way to clear an entire binary file? I have a 75-word file, with each word having 16 elements (am I saying that right, or is it the opposite?). There will be scattered 1's throughout this file, but I want the entire file to be reset to 0 when I press the system reset button.
Thanks
 
I am using a MicroLogix 1200, so RSLogix 500. I think there is a limit of 128 elements for the FLL command.
 
You said "Quick". Does that mean it has to execute in minimum time or be the shortest rung possible?

On one extreme, 75 "MOV 0" instructions (or CLR if they are available) will do the trick in the shortest possible execution time.

On the other hand, a single "MOV 0" executed 75 times in a loop will make a much shorter program but will take a little longer to execute. This is usually the preferred choice unless the number of words to clear is small.

Since you can clear an entire word with a single instruction, there is no need to be concerned about the bits.
 
You said "Quick". Does that mean it has to execute in minimum time or be the shortest rung possible?

On one extreme, 75 "MOV 0" instructions (or CLR if they are available) will do the trick in the shortest possible execution time.

On the other hand, a single "MOV 0" executed 75 times in a loop will make a much shorter program but will take a little longer to execute. This is usually the preferred choice unless the number of words to clear is small.

Since you can clear an entire word with a single instruction, there is no need to be concerned about the bits.

I mean the second option. How would I succinctly clear 75 separate words (which are the only words making up a single file - B9).
Thanks
 
XIC PB_Reset FLL B9:0 0 75

Fill file with zeros starting at WORD 0 for 75 words. That will zero out all the bits from B9:0/0 through B9:74/15.

That's what I was curious about. The instructions I read made it sound like FLL can only clear 128 elements. Thus, I could only clear all 16 elements of words B9:0 through B9:7.
 
FLL

Source = 0,
Destination = # Address of the first word of the data file to be zeroed
Length = 75

"...Length is the number of elements in the file you want filled. If the destination file type is 3 words per element (for example a Timer), you can specify a maximum length of 42. If the destination file type is 1 word per element (integer), you can specify a maximum length of 128 words. See the table below for valid length limits. Depending on the processor you are using, some of the file types listed in the table are not allowed..."

FLL.jpg
 
Last edited:
That's what I was curious about. The instructions I read made it sound like FLL can only clear 128 elements. Thus, I could only clear all 16 elements of words B9:0 through B9:7.

FYI - the machine is a 16-bit architecture, therefore you cannot create a Binary file of less than 16-bits, or one word of memory.

In this context then, even though it's a Binary file, an element of a binary file is 1 16-bit word, just the same as an Integer file.

To be totally honest, there isn't a great deal of difference between Binary and Integer files, except that Binary files allow you to address individual bit addresses beyond the 16-bit word boundary.

B3/17 is the same as B3:1/1 - either address can be used for programming, and you can choose between the two how bit addresses are displayed.
 
That's what I was curious about. The instructions I read made it sound like FLL can only clear 128 elements. Thus, I could only clear all 16 elements of words B9:0 through B9:7.

When they say elements they mean words, so it will clear 128 words (16 bits each or even floating points)
 
When they say elements they mean words, so it will clear 128 words (16 bits each or even floating points)

I have never understood why they allowed file sizes of 256 elements, eg. N7:0 to N7:255, and then limited the file instruction's (eg COP & FLL), to 128 elements...

But they also allowed "indexing across file boundaries", giving the ability to have files bigger than 256 elements, but no supporting instructions that can work with them....
 

Similar Topics

Hi, Experts: We have 20 + years old GE PLC series 90-30 stop running (the run led not on and battery led not on) and HMI showing that "PLC has...
Replies
7
Views
200
Hi everyone, recently i worked with a cmore panel and have the question that how can clear alarm list whit remote form,right now only can with...
Replies
0
Views
112
Hi guys, I have a data table as REAL type VALUES_TABLE[32,100]. I want to clear this table. For that i created a REAL type CLEAR_DATA tag with...
Replies
8
Views
565
Hi, I have bought a used 1756-L73S and SP, it is running firmware 30.013 and safety locked, im running Logix Designer 30.01.00. The controller...
Replies
10
Views
1,670
First time using a panelview. I have all of my alarms mapped to bits of dints. How do I get the alarm panel to popup when an alarm happens...
Replies
6
Views
2,128
Back
Top Bottom