Indexing

Hi

I'm using Studio 5000 from Rockwell. There is the possibility to do for loops and I normally do it using arrays. Now I need to make a loop doing something with array elements but I need also to use an index that again is an array. Example

main_array[index[0]] but syntax is not accepted and I tried many other syntaxes. Is this possible?

Regards
 
I just tried it to in an offline file and it doesn't like that syntax. You can use a tag inside the outer set of [ ] braces, but only to one level. You can instead use a MOV instruction to move the value from index[0] to an intermediate register that you can use to step through main_array:

MOV index[0] index_a

Then you can use main_array[index_a]
 
Top