mov

Join Date
Mar 2003
Posts
3
Hello
I'm using RS 500
I would like to move six numbers (N7:1 thru N7:6) to different locations in file N10 depending on the value in N7:0.
e.g. If N7:0 = 1 I want to move N7:1 thru N7:6 to N10:4 thru N10:9
If N7:0 = 2 move them (N7:1 thru N7:6) to N10:24 thru N10:29
If N7:0 = 3 move to N10:44 thru N10:49
and so on.
The number of different values in N7:0 could be as many as 20.
The number of words to be moved may increase from six to as many as 19.
Needless to say I'm a novice with PLC's but I think I could do this with a bunch of if statements. However, I'm sure there's a more efficient way to do it?
Thank you
Danny
 
Yes, by select case of N7:0 or by indiredt pointer N10:[x] where x=N7:0*20-16 if N7:0>0, but how many element ? 6 to 19 and what is the logic for that ? Select case again..
 
I think seppoalanen is trying something along these lines...

Don't forget to take into consideration that limits must be added to keep the indirect addressing from crossing data files, going negative, and other fun things like that.

The number of words to be moved may increase from six to as many as 19.
My sample will not work with more than 16.

rslogix_indirectgif.gif
 
Last edited:
Thanks jdbrandt,

At least I got the point across.....
BTW, before someone else points it out, theres a flaw with my logic, if N7:0 is zero it will write to words N10:4 thru N10:9 as if N7:0 is 1.
 

Similar Topics

Hello experts. Anyone has any idea how to make BLKMOV execute only once? I have tried with R_TRIG and (P) but it wont write to my location.
Replies
3
Views
198
I've used AOI and User Defined Data Types, but I haven't created one yet. I have a lot of repetitive MOV commands to take a select number of...
Replies
4
Views
380
I'm having to make an AOI to use with a generic ethernet device because the manufacturer does not provide an AOP. I just want to do a sanity check...
Replies
13
Views
1,258
Hello, I'm trying to copy the entire value of a UDT base tag to an element of an array of another UDT containing an element of the first UDT...
Replies
7
Views
1,669
Hi, I would like to move a word to display wind direction. For example: NW, or SE, or ESE in RSLogix 5000, not panelview. I have a wind speed...
Replies
18
Views
5,551
Back
Top Bottom