Array element shifting for RSLogix 5000

crazylizz

Member
Join Date
Sep 2007
Location
S'Western Ontario
Posts
14
Hey guys,

Again, another question I have that I can't seem to find the answer in the search.

I am writing a program to go along with my panelview screen (PV1500+) and I am using RSLOGIX5000 V 13.01.
*On a side note, the company that I am going to install at is running 14.1 for safety controllers*

Thier goal:
To be able to cycle through a 100 part history on the HMI screen. The part history will be generated by a Vision Camera, and then be sent to the PLC in a format yet to be determined (I was leaning towards a string)

I have been able to accomplish the scrolling portion of the program without a problem, but I am now having issues with the data transfer.

This is my ladder logic
copyproblemfu8.png


The OK_TO_DISPLAY_HMI is a oneshot triggered output when the camera PC has sent new information to the PLC.

Each hole history is a 100 element DINT array (although the values will only be between 0-5).

I thought that this would allow me to copy HIST_HOLE_08[0] to HIST_HOLE_08[1] for 99 units, that would essentially shift my values +1 every time OK_TO_DISPLAY_HMI was triggered. The CAMERA_STRING is the input string that I will be recieving via ethernet from another computer, which is then copied/written to the first part in the array.

What I am experiencing when I set everything up using the emulator/RSViewStudio, is that instead of 'shifting', the bits are being overwritten. (I have also tried the COP command, I just happened to have the CPS in place during time of the screenshot).

What is my best way to complete this task?
Can anybody lend advice to this matter?
I cannot thank you enough in advance.

Joe
 
Last edited:
COP or CPS won't work. Simple reason? It starts by copying Something[0] to Something[1] (making Something[1] == Something[0]), then copies Something[1] to Something[2]... See the problem?

You could possibly use the BSR instruction, 32 times, copy to a backup file with COP (or CPS), or use the FFL Fifo instruction (which, if not unloaded, will roll over I think).
 
rdrast said:
COP or CPS won't work. Simple reason? It starts by copying Something[0] to Something[1] (making Something[1] == Something[0]), then copies Something[1] to Something[2]... See the problem?

You could possibly use the BSR instruction, 32 times, copy to a backup file with COP (or CPS), or use the FFL Fifo instruction (which, if not unloaded, will roll over I think).

Thank you for the quick reply :D

I am going to try & stay away from the BSR as thats is going to really increase the rungs in the ladder, but I'm going to start looking into the FIFO and do it that way.
Thank you
 
Really, CLX is so fast, you might find it simpler just to use COP to copy from your current array, to a temporary one, and then back.

COP HIST_HOLE[0] HIST_HOLE_TEMP[1] 99 CLR HIST_HOLE_TEMP[0] COP HIST_HOLE_TEMP[0] HIST_HOLE[0] 100
 
COP or CPS won't work. Simple reason? It starts by copying Something[0] to Something[1] (making Something[1] == Something[0]), then copies Something[1] to Something[2]... See the problem?

To solve this problem you can load new data in Something[99]. The source of the COP instruction will be Something[1] and the destination will be Something[0] and the length 99.
The oldest data will be in Something[0].
 
Guys,

Thank you very much!
I had thought about it doing it this way, but I had originally thought that it would be too much work (either to write, or to decypher).
Turns out I was wrong. Fairly easy to follow, and did not take any extra rungs!

If either of you guys ever hit up S/W Ontario, let me know... Coffee or cookie is on me :D

*I'm sure I'll be back later on in the week with another problem lol*
 

Similar Topics

Hello, first time poster here! A belated "thank you" for the direction I've already received from this forum! So, can I do this? Move value 1...
Replies
6
Views
727
I received the following message via PM, and am posting here publicly to help others. ============================================ I had a...
Replies
10
Views
1,031
Hi Folks, I am trying to trend in Logix Designer an element of an INT[223] input data array. For some reason, the "add" button is greyed out. I...
Replies
7
Views
2,197
I have 23 Micrologix 1400s and I want to take the same register, N100:99, out of each one and put in a single array in a CompactLogix L18ER. From...
Replies
18
Views
7,009
Does anyone know how to link an element of an array tag to a widget? My current widget needs to use the array element tag's .AsText property and...
Replies
2
Views
1,322
Back
Top Bottom