Array Shifting

do not shift the array as this is very consuming
just change the input pointer and the output.
so one shift (pointer) is enoough iinstead of the whole array
 
suppose you have a list of 100 items.
when you have to shift them like you are used to you need 100 instructions to get one shift done.
i have a list and a input pointer and an outputpointer
the input starts at zero (as most arrays start at 0
whenever the line is advanced the inputpointer is added one and the list is written if a bottle is present or not.
the output pointer start at 90 for example. same here the outputpointer is added when the line is advanced. then check if list is true or not.
a check for pointers overflow is needed. if any pointer is >=100 the pointer is reset to 0 again
use a few coins on a strip of paper and two pens as pointers.and simulate the action.
 
Hi Shooter,

Thanks for the explanation, the concept is good, but, will that increase the overhead, at least upon shifting occur.
Maybe is alright, due to faster processors now a days.
Regards
________
 

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
366
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,057
Hey guys, What do you suggest for doing a shift of dints within an array like this? Thanks, Kevin
Replies
12
Views
2,592
Not sure if this is possible but thought I would put it out there. Using Rockwell Studio 5000, is it possible to shift the address of an array...
Replies
7
Views
2,138
Gents, Trying to shift and average 10 integer array values. First issue is shifting every value in the array forward one spot. 0..8 becomes...
Replies
5
Views
1,942
Back
Top Bottom