Array Copy in Logix5000

cmac2425

Lifetime Supporting Member
Join Date
Jul 2012
Location
Pittsburgh
Posts
48
I am trying to copy 3 separate 32 element arrays into one 96 element array. I am using 3 I/O cards and each individual bit is a separate alarm. Once I move the "alarms" into one array I can then use a pointer for my text output to the HMI. I attached what I am doing right now using a FAL instruction but I am getting a control overflow and it's faulting my PLC. Any suggestions? Thanks in advance for your help.:D

array_copy.jpg
 
Your telling your FAL to start at position 64 and process a length of 96. That would try to access postion EOPO_ALARM_INDEXER_ARRAY[96+64]. I think all of your lengths should be 32.

Why not just use 3 COP commands?
 
Last edited:
^ agreed....No reason for the overhead and complexity of an FAL instruction here. Just do three copy's. Copy Array_1[0] Array[0] 32, Copy Array_2[0] Array[32] 32, Copy Array_3[0] Array[64] 32
 
I agree with what scott mentioned however, instead of your length being 32 your length needs to be 31, if your copying a 32 array element size 0...31, and also your position location of 0 for the first looks right, however for the second and third try 32 and 63 instead of 33 and 64, see if that will fix your issue.

EDIT*** robertmee said it best no need to use a FAL, you can accomplish the same thing with the COP instruction.
 
Last edited:
Thank you for your replies, I will try the easy route of just copying the arrays using the COP function. I was trying to make it too complicated.
 

Similar Topics

Hi, done Cop(Copy) instruction but usually with DINT or INT in an array, but just happen an hour ago that I try to COPy an array of 380Boolian...
Replies
0
Views
2,083
I am having to manipulate MB data in a compactlogix 5380. I need to copy the bit array from the TCP MB master into a matching bit array to use in...
Replies
13
Views
2,507
All, i nto fully get it. I read trough some froums but not finaly make it running. so I try to ask. Hopefully anybody has the kindness to answers...
Replies
7
Views
1,192
Hello! I am completely new to PLCs, so I apologize in advance if this is a dumb question. I have a device that sends out its data as a number of...
Replies
5
Views
2,133
Gents, I have a DB, that is an array of a UDT. This UDT has got a combination of INT's and REAL's. When an action is completed, I want to move...
Replies
11
Views
4,228
Back
Top Bottom