You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old January 20th, 2018, 12:53 PM   #1
CaspianSage
Member
United States

CaspianSage is offline
 
CaspianSage's Avatar
 
Join Date: Jan 2017
Location: Where I Am
Posts: 122
Copying Floating Point files

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.
__________________
Caspian

---------------------------------------
1+1 = 3 and I never was good at math.
----------------------------------------
  Reply With Quote
Old January 20th, 2018, 01:52 PM   #2
Mickey
Lifetime Supporting Member
United States

Mickey is offline
 
Mickey's Avatar
 
Join Date: May 2003
Location: Palmdale,Ca
Posts: 10,120
Consider a "FAL" instruction, see pdf.
Attached Files
File Type: pdf fal_instruction.pdf (107.3 KB, 16 views)
__________________
Mickey

If you want happiness for an hour-take a nap. If you want happiness for a day-go fishing. If you want happiness for a month-getmarried. If you want happiness for a year-inherit a fortune. If you want happiness for a lifetime-help someone else.
----- Chinese Proverb
  Reply With Quote
Old January 20th, 2018, 02:32 PM   #3
CaspianSage
Member
United States

CaspianSage is offline
 
CaspianSage's Avatar
 
Join Date: Jan 2017
Location: Where I Am
Posts: 122
Thank you Mickey... Forgot about that instruction for doing file moves.... and I even looked at it before I wrote this post....

Sorry for bothering you..

Quote:
Originally Posted by Mickey View Post
Consider a "FAL" instruction, see pdf.
__________________
Caspian

---------------------------------------
1+1 = 3 and I never was good at math.
----------------------------------------
  Reply With Quote
Old January 20th, 2018, 02:53 PM   #4
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,858
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.
__________________
It's not all the variables I am most concerned with, it's the undiscovered constants.
  Reply With Quote
Old January 20th, 2018, 02:58 PM   #5
CaspianSage
Member
United States

CaspianSage is offline
 
CaspianSage's Avatar
 
Join Date: Jan 2017
Location: Where I Am
Posts: 122
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!
__________________
Caspian

---------------------------------------
1+1 = 3 and I never was good at math.
----------------------------------------
  Reply With Quote
Old January 20th, 2018, 03:02 PM   #6
CaspianSage
Member
United States

CaspianSage is offline
 
CaspianSage's Avatar
 
Join Date: Jan 2017
Location: Where I Am
Posts: 122
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

Quote:
Originally Posted by OkiePC View Post
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.
__________________
Caspian

---------------------------------------
1+1 = 3 and I never was good at math.
----------------------------------------
  Reply With Quote
Old January 20th, 2018, 03:53 PM   #7
Mickey
Lifetime Supporting Member
United States

Mickey is offline
 
Mickey's Avatar
 
Join Date: May 2003
Location: Palmdale,Ca
Posts: 10,120
Quote:
Originally Posted by CaspianSage View Post
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?
__________________
Mickey

If you want happiness for an hour-take a nap. If you want happiness for a day-go fishing. If you want happiness for a month-getmarried. If you want happiness for a year-inherit a fortune. If you want happiness for a lifetime-help someone else.
----- Chinese Proverb
  Reply With Quote
Old January 20th, 2018, 04:37 PM   #8
DwSoFt
Lifetime Supporting Member
Canada

DwSoFt is offline
 
Join Date: Mar 2012
Location: Alberta
Posts: 867
What happens to the 10th day, it gets discarded is my bet by overwriting it
__________________
Dan Wiebe
-----------------
Automation Manager
Phoenix Energy Services
  Reply With Quote
Old January 20th, 2018, 05:22 PM   #9
CaspianSage
Member
United States

CaspianSage is offline
 
CaspianSage's Avatar
 
Join Date: Jan 2017
Location: Where I Am
Posts: 122
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

Quote:
Originally Posted by OkiePC View Post
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.
__________________
Caspian

---------------------------------------
1+1 = 3 and I never was good at math.
----------------------------------------
  Reply With Quote
Old January 20th, 2018, 05:27 PM   #10
CaspianSage
Member
United States

CaspianSage is offline
 
CaspianSage's Avatar
 
Join Date: Jan 2017
Location: Where I Am
Posts: 122
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...

Quote:
Originally Posted by Mickey View Post
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?
__________________
Caspian

---------------------------------------
1+1 = 3 and I never was good at math.
----------------------------------------
  Reply With Quote
Old January 20th, 2018, 10:03 PM   #11
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,858
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.
__________________
It's not all the variables I am most concerned with, it's the undiscovered constants.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
AB Panel view plus 600 copying files jeb72 LIVE PLC Questions And Answers 1 August 6th, 2013 06:28 PM
Floating point to integer representation PLBoudette LIVE PLC Questions And Answers 10 November 6th, 2012 01:32 PM
A/B Micrologix 1200: converting floating point values? downey18 LIVE PLC Questions And Answers 8 March 18th, 2008 05:08 PM
Topserver/ Intouch floating point value problem pasimanninen LIVE PLC Questions And Answers 6 February 27th, 2008 09:24 PM
AB Floating Point errors Hakutsuru LIVE PLC Questions And Answers 8 January 15th, 2008 07:01 PM


All times are GMT -5. The time now is 09:06 PM.


.