IAmTheCapo
Member
Sorry for the word salad title, I'm having trouble putting my problem into words.
Basically I have two arrays of DINTs, both the same size called array1 and array2 and I want to update the value in array2 to be the related index for that number in array1.
For example if I have:
array1[1] = 3
array1[2] = 1
array1[3] = 2
I want to get
array2[1] = 2
array2[2] = 3
array2[3] = 1
Basically I want the value and index from array1 to be swapped for array2.
I can easily do this in a few lines in structure text, but was wondering if there was a way to do this in ladder (FAL instruction maybe?)
Cheers,
AC
Basically I have two arrays of DINTs, both the same size called array1 and array2 and I want to update the value in array2 to be the related index for that number in array1.
For example if I have:
array1[1] = 3
array1[2] = 1
array1[3] = 2
I want to get
array2[1] = 2
array2[2] = 3
array2[3] = 1
Basically I want the value and index from array1 to be swapped for array2.
I can easily do this in a few lines in structure text, but was wondering if there was a way to do this in ladder (FAL instruction maybe?)
Cheers,
AC