Shifting Groups of words

InControl

Member
Join Date
Oct 2004
Location
Arkansas
Posts
29
Hello Everyone,

I have spent several hours searching the forum for a similar example or situation. The basic problem is this; I am trying to save data in a few registers for historical data that can be viewed on a PanelView plus. I am doing an Oven controller with an old PLC-5 and part of this project is a Summary for each bake--

Time Bake Started: Hour=N14:0 Minute=N14:1 Sec=N14:2
Time Temp was Reached: Hour=N14:3 Minute=N14:4 Sec=N14:5
Total Time at Temp: F8:60
Bake Number: ST12:1

etc
So..I am collecting this data and at the end of each batch
I am going to mov it to register and then shift it down. On the Panelview I will have a sumary screen with a up and down button to step through completed Batches using indirection.

Anyway I have written a little code and don't have a live PLC here in the shop to test it. What I am doing in this code is moving N14:0 N14:1 and N14:2 to N21:10, 11 and 12, The I am copying 900 words of n21 to n27:0(Storage) then 890 words from
n27:0 to n21:10 then clearing out n14:0. My goal is to move 10 words at a time down 10 place in the register(N21). In this example I am only showing N14s first 3 words but in final draft I will be moving Strings, Floats and Integers in respective files.
Then in the Panelview I will use my up and down button to increment or decrement a counter (C5:0) and look at the data like this

n21:[c5:0.acc]

I have read all the cases in here of using FIFOs and all that good stuff but tell why this won't work. Thank you all in advance.
 
Last edited:
Here is the sample code

Sample1.GIF
 
My experience with file moves, file shift, or fifo, is you need to shift from a higher number, to a lower number say N99 down to N98 to 97 96 95 etc,
The reason is the way the PLC processes its files, if you go from N1 to N2 to 3 4 5 etc, the value in N1 will end up in all of them in very short time, as they are steping in the same direction, as the PLC is stepping, it will appear to happen instantly as it does what you asked it to do one word at a time, and that is over write the next word.
If you go in a reverse direction it over writes the last word that you have only just shifted down one word.

Clear as mud yet ?
Yes mud is murky.
 
fill from bottom up?

Gil47 said:
you need to shift from a higher number, to a lower number say N99 down to N98 to 97 96 95 etc,
So you're saying i should insert new values at the bottom N21:800 instead of n21:10 and copy from n21:900 to n21:890?
 
In Slc 500 there is a limit of 128 or 256 words in files operations
PLC5 can move more it may be all 999 but check as it maybe only be 512
I cant remember without needing to look it up.
 
In Slc 500 there is a limit of 128 or 256 words in files operations
PLC5 can move more it may be all 999 but check as it maybe only be 512
I cant remember without needing to look it up.

The limit is 128 words, but that doen't preclude the use of COP to achieve this with larger files:-

Divide your large file into blocks <= 128 words (eg 500 words, 4 blocks of 125).

Copy from the bottom up, as already suggested, but copy the lowest order block first, link between the blocks with a MOV :-

COP #N7:1 #N7:0 124
MOV N7:125 N7:124
COP #N7:126 #N7:125 124
MOV N7:250 N7:249
COP #N7:251 #N7:250 124
MOV N7:375 N7:374
COP #N7:376 #N7:375 124
MOV {new data} N7:499
 

Similar Topics

Greetings, I am trying shift data in an array (such as Array[0] is shifted into Array[1], Array[1] is shifted into Array[2]......all...
Replies
10
Views
364
Hello Guys, I think I need to use SCL for the following task but am very weak using SCL in tia portal. I have results history data block. It is...
Replies
14
Views
3,047
Why encremental encoder have a phase shift of 90°between A,B phases ,if it's 60° 30° what happen what's the difference ,can we change the 90°in...
Replies
47
Views
10,909
Hello everyone, I am working on trying to record a history of user logins with a time stamp. It will record their user ID and the time that they...
Replies
15
Views
3,876
Hey guys, What do you suggest for doing a shift of dints within an array like this? Thanks, Kevin
Replies
12
Views
2,589
Back
Top Bottom