Integer file question

jbrand85

Member
Join Date
Mar 2009
Location
Alaska
Posts
11
So I have a integer file N7. I would like to clear the whole file at 6:00am every morning. How would I write this in SLC 5/05?

Thanks
 
How many words are in your N7:?? to N7:?? data file? See Picture below it will move a value of zero to words N7:0 thru N7:99 at 6:00AM. Adjust the length of the FLL instruction to suit your needs.

clearWords.jpg
 
Last edited:
I would use a File FiLl (FFL) Use a eaual to from the internal clock. S:?? I don't remember which number it is. Once the clock H:M:S are equal to your 6:00:00 use the File FiLl to fill the N7 file from 0~ to what ever you want. I just use 255 as a number you will change for your file.
the ASCII would look like this except the xx would be replaced with the correct numbers.

EQU S:xx 6 EQU S:xx 00 EQU S:xx 00 FLL N7:0 255

I hope this helps
 
Jeff - your typo of an FFL would be a FIFO Load. Though your mnemonics indicated a File Fill mnemonic.

But your method would call the clear each scan for the entire second. While it won't really hurt anything, assuming that no data was being sent to the N registers during the rest of the scans, it's just not good form. Thus the OSR as shown in Mickey's post performs the clear only once during the first scan.
 
Bernie you are correct. I usually don't use One Shots I use a forth instruction LEQ to the address the ms . How would you use a binary before this just to reduce the scan time? I believe that once the processor executes the a false instruction it executees the remainder as false correct?

I have been destracted a lot lately balancing the do I go out on my own or keep a full time gig? I can't even draft an email without reading it 2 or 3 times anymore.

Should be
EQU S:xx 6 EQU S:xx 00 EQU S:xx 00 LEQ S:xx 3 FLL N7:0 255
 
Last edited:
One added detail...

If you need to clear more than 128 integers, you will need two FLL commands. They are limited to 128 integers per instruction.
 
Jeff - in this particular instance Mickey's method is about the fastest. JBrand85 needed the file cleared at 6:00AM. Since this implies that it should be cleared as soon as it reaches 6 there's no need to examine the minutes or seconds. Doing the clear JUST ONCE as soon as it turns 6 satisfies the need. If he had mentioned something like 6:43:29 then there would have to be more tests but an OSR would still be appropriate.

I come from a background of programming microprocessors with very limited speed and memory. So, despite current advances, the memory space and time needed for execution still occupies my mind.
 
Bernie
I never thought to just looking at the hour and OSR. Teach on guys. I have never had to plan the memory usage stuff before.
 

Similar Topics

Ex If I Read from Integer file N7:0 N7:0 is an 8 point input card , input 0 and 2 are on , rest off When I look at : N7:0 -7 6 5 4 3 2 1 0 I...
Replies
5
Views
744
I'm in the process upgrading and rss project and going through the program adding descriptions to the operation I've come across an integer file...
Replies
7
Views
2,608
Hey guys, I have to get my Compact Logix L32E to message between a ScadaFlex module via SLC 500 peer to peer protocol. Since the SLC 500 is using...
Replies
2
Views
1,370
I am trying to understand this MOV instruction address. N[N7:29]:19. In N7:29 mapped to 19 or vise versa?
Replies
3
Views
1,795
Hi all, I have an application where the plant PLC is communicating via Ethernet/IP to 3 different field PLC's. The Field PLC's are all Micrologix...
Replies
6
Views
3,415
Back
Top Bottom