Array question (or better way to do this)...

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
** EDIT - UPDATE **

** After a bit of searching on here I've found an excellent example from LD... so I think I can utilise that to get something working... original question below for the curious among you... Thanks ;-) **

Hi all,

I have a function that accepts ten Double Integers.

It puts them into an array...

Code:
L  #myDint1
T  #myArray[1]
L  #myDint2
T  #myArray[2]
// etc

I want to run a loop and then pick out an array element based on a number... so for instance what I want to do (and I know that this wouldn't work but you get the idea)...
Code:
L  #myArray[#myValue]
T  blah blah

Any ideas how this can be done?

Many thanks

;-)
 
Last edited:
If I understand it well what you want to do, I would have done it in this way ...
qwertyh.png
 

Similar Topics

Hello, When you want compare values of an array to a range of numbers is it a right way to do that? FUNCTION ADD VAR_IN_OUT A:ARRAY[1..50]...
Replies
5
Views
2,076
Hi all, I'm trying to access a variable address in a shift register. I have used BSL with an array DINT[20]. Now I wan't to access...
Replies
4
Views
1,526
Hi all, I am using RSLogix5000 version 7 to modify a program on a 1756-L1 controller. We have installed 5 more drives on a conveyor system. The...
Replies
2
Views
2,687
Hello, I need some ideas on how to sort an array. I have 3 1d arrays in a udt with a length of 101. Lets call them XAxis[0-100],YAxis[0-100],and...
Replies
3
Views
5,228
This should be a simple one. I have a Dint array in my program that is setup for 30 elements. If I want to increase the array size, will the...
Replies
3
Views
3,511
Back
Top Bottom