plc5 fifo instruction help

roy357

Member
Join Date
Dec 2008
Location
El paso TX
Posts
7
hi every one,
I have a question about FIFO instruction, i need to to store data in just like the fifo does, but i need to do it with float point data type and in the plc5 instruction set manual tells me that i can use integer only as valid data type. is there a way to do it? the data i need to use are the form 1.33e-7. i use a plc5/20

thanks

roy:book:
 
You can achieve similar results with a stack, and an index, maybe two indexes. You can also create a stack and "pop" the stack and move the data. If you could describe what your goal is, perhaps that will lead us to the best solution for your application.
 
the purpouse of doing this is to be able to see some data during the day maybe every hour, we go end look the last 60 results of a test there's nothing special but the problem is the data type that is float.
 
could you explain me how to do the indexing procedure that you mencioned im not plenty familiar with some expressions used in plc world
 
Last edited:
Here's another way.
In this example F9:0 will hold the latest value, F9:1 the previous value, F9:2 next oldest etc.... all the way up to F9:59 which will hold the oldest value.
F10:0-F10:59 is just a holding register for the shift. The example shows your data coming from F8:0, adjust to fit your program.
When your data store bit is true, we copy the contents of F9 to F10, then copy the data back starting at F9:1, this in effect shifts the data values by one register, then we write the current value to F9:0
There is a more elegant way to do this, but this way is easier to follow.
Hope this gets you started.

REG_SFT.png
 
You can avoid using a scratch file and reduce the number of memory copies if you can store the data upside down, That is, F9:0 is the oldest data and F9:60 is the newest data.

COP #F9:1 #F9:0 59
MOV F8:0 F9:59

In this example the COP instruction copies F9:1 down to F9:0, then F9:2 to F9:1, then F9:3 to F9:2, etc. Finally, the newest data is saved at F9:59.
 
Last edited:

Similar Topics

I am using the following formula and I am getting error, Invalid Expression - too many closing parenthesis. when i copy the formula to notepad or...
Replies
4
Views
154
Preface: Kinda long, so I made section titles Intro: I just want to see if anyone here has seen anything similar. A PLC5-40 series C enhanced...
Replies
3
Views
373
Hi, can anyone help me get a pdf file for this RSP files. They are from a PLC5. Thanks
Replies
5
Views
522
Hello all, I am seeing this behaviour where an integer file (N46:33), has an integer in binary (11110) which is 30 in decimal. I did a...
Replies
7
Views
520
Back
Top Bottom