10-27-2014 02:51 AM
10-27-2014 02:58 AM
Here is the converted vi.
10-27-2014 03:04 AM
Hi Nayan,
you insert new elements in your array at Index zero using InsertIntoArray function. And now you wonder why each call of your VI inserts a new element? Really?
Did you read the help for that function?
When you want to replace elements at certain indices of your array you need to define an array with those elements and use ReplaceArrayElements!
10-27-2014 04:04 AM
Thax.
I tried 'Replace Array subset' function, but problem here was if I have an emplty array, it will not accept the value.
Is there any option that even if the array is empty it should replace the value what I wanted??
10-27-2014 04:13 AM - edited 10-27-2014 04:13 AM
Hi Nayan,
when the array is empty then there is no element you can replace. Sounds ok for me!
As I said before: you need to define an array with some elements. Or you need to implement some logic to append new elements when the y don't exist before…
10-27-2014 04:17 AM
How you will get the index for Empty array to replace your data ?
If you know your size of your array then 1st build array & replace your indices. If you don’t know about array size then check array and index.
If array is empty/index value is out of your array size then just add that element to array (using Build array) else replace same as you mentioned.
10-27-2014 04:21 AM
Thanks to both of you.
I have 2965 elements in the array, so created it first and now will use Replace Array Subset function.
10-27-2014 04:26 AM
If your replacing data continuously in a loop then use Shift registers to pass your data else you will get Array with Last updated Index.
10-27-2014 04:35 AM
I am not replacing the data continuously in a loop here, but thanx for the valuable suggestion.
10-27-2014 10:47 AM
@Nayan wrote:
Thanks to both of you.
I have 2965 elements in the array, so created it first and now will use Replace Array Subset function.
Please show your latest code. Your earlier VI made no sense at all.