shoelesscraig
Member
Ok, I'm trying to do something that I'm sure is very simple. I am missing something. I am using a CLX so this is in Logix 5000 software.
So I was thinking I could use a "copy" instruction for this, but I tried it and I guess I'm wrong. I have an array of 10 DINTs. Lets just call them DINT[0],DINT[1] and so on up to DINT[9].
In DINT[0] I have the number 1, next one is number 2 and so on up to 5 which would be in DINT[4]. The rest are zeroes.
I want to copy what is in DINT[1] with a length of 4 and paste it into DINT[2]. Basically shifting everything in DINT[1]-DINT[4] down one position. I realize that DINT[1] would still have the number 2 in it, and thats fine. It can remain unchanged. Then DINT[2] would have number 2, DINT[3] number 3, DINT[4] number 4, and DINT[5] number 5.
At least that is what I want. To be able to shift or "copy" part of an array on top of itself. Of course, this is just my example. What I actually need to use it on is arrays that are several hundred DINTs long, not just 10, but you get the point. I tried the COP instruction, but got undesirable results. What am I missing? Can the FAL instruction do this?
So I was thinking I could use a "copy" instruction for this, but I tried it and I guess I'm wrong. I have an array of 10 DINTs. Lets just call them DINT[0],DINT[1] and so on up to DINT[9].
In DINT[0] I have the number 1, next one is number 2 and so on up to 5 which would be in DINT[4]. The rest are zeroes.
I want to copy what is in DINT[1] with a length of 4 and paste it into DINT[2]. Basically shifting everything in DINT[1]-DINT[4] down one position. I realize that DINT[1] would still have the number 2 in it, and thats fine. It can remain unchanged. Then DINT[2] would have number 2, DINT[3] number 3, DINT[4] number 4, and DINT[5] number 5.
At least that is what I want. To be able to shift or "copy" part of an array on top of itself. Of course, this is just my example. What I actually need to use it on is arrays that are several hundred DINTs long, not just 10, but you get the point. I tried the COP instruction, but got undesirable results. What am I missing? Can the FAL instruction do this?