Copying Floating Point files

CaspianSage

Member
Join Date
Jan 2017
Location
Where I Am
Posts
128
Good Afternoon

First I want to thank all of your regulars that volunteer so much of your time. It is so much appreciated that you take the time out of your day to help others. It really is quite a testimony to your selflessness.

I hope I am posting this in the right place. my apologies if I am not.

I am trying to save some historical data for just a few days that resides in floating point files.

F8:0, 1 AND 2
I want to copy that data at midnight to: For example: 10 days of history to

F8:0 to F17:0, 1, 2
F8:1 TO F18:0 1 AND 2
F8:2 TO F19:0 ,1 AND 2
and so on...

I want to keep 10 days of data. for each. I would not necessarily use three different files(ie, 17, 18, and 19) unless I have to. I just showed it that way to keep this clear for the purpose of illustration.

Since a FFL will not accept floating point and copy shoves everything in one rung transition I am using several rungs with MOV instructions to do this with each one moving a different word a second apart using the PLC RTC. Doing this so I make sure the data I want is moved and not overwritten.

Surely there is a better way isn't there?

Thank you, I hope I am clear. I am using AB PLC 5/11 and 20s enhanced PLCs with RS Logix 5.
 
Use three COP instructions, and three separate floating point files.
Fire a oneshot when the RTC hour equals zero.

When the oneshot occurs, COP F100:1 to F100: 0 Length 10, COP F101:1 to F1010: 0 Length 10, COP F102:1 to F102:0 Length 10

Stuff your newest data into F100:9, F101:9, F102:9

This will work like a FIFO only the newest data is at the end, and the oldest at the beginning.
 
Following up Mickey

That sure cleans up the program reducing number of instructions but unless I am missing something, I will need to write one of these for each day I want saved since I cannot use a FIFO. Am I missing something here?

Thank you!
 
Thank you, Looks good, Similar to but better than what I am doing but with MOV instructions,

I will take some time working on that and see how it goes

Use three COP instructions, and three separate floating point files.
Fire a oneshot when the RTC hour equals zero.

When the oneshot occurs, COP F100:1 to F100: 0 Length 10, COP F101:1 to F1010: 0 Length 10, COP F102:1 to F102:0 Length 10

Stuff your newest data into F100:9, F101:9, F102:9

This will work like a FIFO only the newest data is at the end, and the oldest at the beginning.
 
Following up Mickey

That sure cleans up the program reducing number of instructions but unless I am missing something, I will need to write one of these for each day I want saved since I cannot use a FIFO. Am I missing something here?

Thank you!

You could use indirect addressing for the destination, increment each day.
Never tried it so not sure if the FAL instruction supports it, worth a try.

But what happens at the end of day 10?
 
What I was doing with the MOV instructions is not even close to this Okie, This is quite impressive.

I tried a copy instruction on one of the data files out of the 3 but I was seeing the files fill up to whatever length I set it for.

This works well but even as I watch it, I am not sure how it is only populating one word with each scan. I thought a copy instruction filled up every word according to the length with each scan.

Anyway. Thank you very much for a great solution! I owe you!

Caspian

Use three COP instructions, and three separate floating point files.
Fire a oneshot when the RTC hour equals zero.

When the oneshot occurs, COP F100:1 to F100: 0 Length 10, COP F101:1 to F1010: 0 Length 10, COP F102:1 to F102:0 Length 10

Stuff your newest data into F100:9, F101:9, F102:9

This will work like a FIFO only the newest data is at the end, and the oldest at the beginning.
 
That's an interesting possibility, what happens on day ten with anything like this is it gets overwritten of course but if you want day ten I suppose you make the length 11 ....

I might try this but the solution by OkiePC works very well so we will see.

I am all ears if someone has another idea. Love to learn...

You could use indirect addressing for the destination, increment each day.
Never tried it so not sure if the FAL instruction supports it, worth a try.

But what happens at the end of day 10?
 
You can set the length up to 64 for 32 bit elements such as floats. If it were me, I would store 64 days worth of data unless you are out of memory. The PLC doesn't care if you use lots of its memory or very little.
 

Similar Topics

I'm not super familiar with the Micrologix line of processors, but I am pretty familiar with RSLogix 500. I'm trying to simply copy a string to...
Replies
4
Views
260
Hi All, I am looking to copy and paste a routine. I know this has to be done offline. My question is, when I go back online, these tags are...
Replies
6
Views
480
Hello everyone, friends. I need help with something related to SCL. In a FB, I need to copy the value in the DB to the DB at another address. I...
Replies
3
Views
1,350
Hello all! Is it possible to COP a SINT array to a UDT structured the same as a SINT array, except all BOOL bits? I have a module that has an...
Replies
5
Views
3,139
Hello, looking for a way to capture and display the accumulated time for a retentive timer in rslogix 500 on a microligix 1400 plc example move...
Replies
3
Views
1,632
Back
Top Bottom