PLC5 Indirect address conversion

Hi

You need to create an array of ints and then create a counter to address the int word to bit level. The n7 200 is here word you are adding.i will have logic open later I will do it out unless someone else does it first just on my phone at the moment

Donnchadh
 
Indirect alias

QUOTE
counter to address the int word to bit level UNQUOTE
The original PLC5 was this N[N7:200]:[C5:1.ACC]
No bit level
I solved the T14[C5_1_ACC].ACC by making an alias to
C5[1].ACC , however
N[N7_200][C5_1_ACC] is still eluding me

Lets say N7_200 has a value of 16
Lets say C5_1_ACC is at 10
Then N[N7_200][C5_1_ACC] would look like this
N16[10] thats a tough one to figure out
 
This is from RSLogix5000 help...

MyArray defined as INT[100] - MyIndex defined as INT
MyArray[(MyIndex AND NOT 15) / 16].[MyIndex AND 15]
This example references a bit within an INT array.

MyArray defined as DINT[100] - MyIndex defined as DINT
MyArray[(MyIndex AND NOT 31) / 32].[MyIndex AND 31]
This example references a bit within a DINT array.

I can't say for certain, but the index tags could be different, try and see and let us know if it works.

James
 
I'm sorry, I emulated and index tags really need to be the same, if you don't want to use a multi dimension array, you could do this:

MUL MyIndex1 32 Index ADD Index MyIndex2 Index
OTE "MyArray[(Index AND NOT 31) / 32].[Index AND 31]"
All tags are DINT.

This could be done for INT also, just change 31 to 15 and 32 to 16.

James
 
I'm sorry, I emulated and index tags really need to be the same, if you don't want to use a multi dimension array, you could do this:

MUL MyIndex1 32 Index ADD Index MyIndex2 Index
OTE "MyArray[(Index AND NOT 31) / 32].[Index AND 31]"
All tags are DINT.

This could be done for INT also, just change 31 to 15 and 32 to 16.

James

I am sorry but this makes no sence to me

Lets clear this again

N[N7_200][C5_1_ACC]

N7_200 is an alias to the value in N7[200]
C5_1_ACC is an alias to the value in C5[1].ACC

The value ranges of N7_200 is 17, 18, 19, 20, 21, 22, 23
based on the code construction

so N[xxx] will always be N17 or N18 or N19 or N20
or N21 or N22 or N23

C5_1_ACC hs a range based on the code of 1 - 7
so each the posibilites are as follows

N17[1], N17[2], N17[3], N17[4], N17[5], N17[6], N17[7]
N18[1], and so on
so there are 7 * 7 posibilities

N_ARRAY[7,7]
Now creating an array like N_ARRAY[array1, array2] will not work because array2 can not be indexed with array1
and there no way to add them.
 
Sure it will!! What is your basis for saying it will not??

I was refering to my issue which is a lot more complicated
than that threads issue
My N[xx] is a different file not the same array
Were indexing a different file based on the value of N7_200
 

Similar Topics

In an old PLC5 I see an output like this B37 -()- [N19:21] If I remember correctly that says to set the bit of word 37 thats equal to the value...
Replies
13
Views
6,934
Hey everyone, Just used the PLC5/Logix migration utility to convert a program, and while addressing the PCEs, I noticed a lot of errors for "XIC...
Replies
12
Views
1,968
Can anyone explain to me what this would mean in a COP instruction? Source: #N[N187:4]:[N187:5] Dest: #N[N187:1]:0 Length: 20 I am doing a...
Replies
6
Views
2,206
I am trying to convert an old PLC5 program. I have several instances in the unlatch instruction where they give a B file on top of the unlatch...
Replies
9
Views
2,019
what would be the simplest way to convert this to CLX Thanks
Replies
17
Views
3,750
Back
Top Bottom