Fifo

Hojland

Member
Join Date
Oct 2006
Location
Langå
Posts
203
Hi I have a machine where I want to type a 6 or 8 digit number into before it starts. If I type a new 6 or 8 digit number in, the old on stores for up to 10 entries. How can I do it. It's an SLC 5 / 05 with a PanelView Plus 1000
 
Hojland,

You could use the LFL and LFU instuctions. The LFL (Last In, First Out Load) moves your numbers from the PanelView into data storage locations beginning at the LIFO address, and continuing for (Length= 10) words. The LFU (Last In, First Out Unload) unloads the numbers to Destination, beginning with the Last In (reverse order).

Another option is to create your own routine by using COP for each new number entry, an copy all the old numbers down one position (using Indexed Addressing), leaving a space at the top of your memory area, then moving the new number into that space.
 
Storing ten entries if the easy part. First off lets talk about your 6 or 8 digit number and the limitations of the SLC5/05.

You can store a 6 digit number as an integer provided it is less than 32,767. You can store an 8 digit number as a float provided it is less than 16,777,215. You can store it as a 32 bit double in two consecutive integers or as a BCD in two consecutive integers but that complicates things a little. Or you can store the numeric characters as a string.

A little more information from you will help us give you a better answer. What is the number and what kind of range will it have?
 
Are there any 6 digit integers less than 32,767?
I guess only some that begin with zero: 012345
Maybe that's why the banks use 4 digit PIN's.
 
I will look at it tomorrow. But I've never used these instructions before. Nobody starts with 0 ex 124958th ... 30011440
Can you tell what you fill in the various fields
Many thanks in advance
 
If you dont need to to do any math use a string.
Make a string with 11 elements.
Move your number into string #ST11:10 and then use 4 copy instruction:
BST COP #ST11:1 #ST11:0 3 NXB COP #ST11:4 #ST11:3 3 NXB COP #ST11:7 #ST11:6 3 NXB COP #ST11:10 #ST11:9 1 BND

Put the move and cop instruction behind a OneShot
The oldest is located in #ST11:0
When using COP you must copy from high to low othervice it will not work.

The COP instruction can only copy a certaint amount of data so you need to use 4 of them since STRING containing up to 82 character uses a lot of space.
 
The COP instruction can only copy a certaint amount of data so you need to use 4 of them since STRING containing up to 82 character uses a lot of space.
Yeah, or use one LFL and one LFU. That seems easier in this case.
 

Similar Topics

I am not sure if this is possible but if there is a way, you guys would be the ones to know. I am currently working on a project where we are...
Replies
7
Views
216
Hello all, I'm using a 5069-L330ER in a project and I need to essentially capture some data that will be shown as a trend on a screen. The data...
Replies
9
Views
961
Hello! I have a network of conveyors bringing raw product to 4 machines. A sensor in the hopper of each machine calls for more product. I'm...
Replies
15
Views
5,867
Hello everyone, has anyone out there ever made a FIFO using an FFL and FFU instructions on a Micro800? I have tried setting it up just as I would...
Replies
9
Views
3,115
I have a bottle capper that is using an encoder and FIFO logic to track the free standing bottles passing through a bottle capper. I have checked...
Replies
31
Views
11,671
Back
Top Bottom