LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modification of Array contents

I have a data array of 22 columns and typically 4000 rows. The data in the array is generated by a towed body and  occasionally has corrupt rows of data.  There can be several isolated groups of corrupt data.  The corrupt data is easily detected as a transient in an otherwise slowly changing data stream.
 
The user would like to review and modify the contents of the array to either remove the corrupt rows and/or to interpolate from the last good data to the next good data,
 
I can identify the corrupt rows and generating the interpolating array to replace the corrupt data.   I can find no way of inserting the new data back into the original array or even generating a single modified array containing all the modifications.  I can generate a new array for each modification but that is not what I need.  Every attempt to modify an existing array gives the error message "Member of a Circle".
 
Is this is due to my not understanding Labview?
 
I am a infrequent user of Labview.
0 Kudos
Message 1 of 7
(3,223 Views)
Hello Allan,

from your question it seems you want to do the following: read data from an array, change that data, write it back to the array. You have to do this in a "dataflow" way, so you cannot write the data back to the data source!

To do the "write back" you have several options, the most common is to use a local variable. When you change the data in a loop use a shift register to keep the changes.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,215 Views)
Hi Allan:

You can build a SubVI to check every row of the towed body data.

If data on a particular row is corrupted, manage the data to be good data.

After you have checked all rows, you will have an array of same dimension of original and with good data.

----

If you need to delete some rows, you can keep track of the rows and delete them at the end. (note that if you don't reverse Index Array to Delete, you would delete incorrect rows)

Hope it helps,
Aitortxo.
0 Kudos
Message 3 of 7
(3,204 Views)

Hiii, Grade & Alllen

            Grade u r absolutely right, that he can use the Local variable to update the data and shift register to store the data, but he also have to concentrate on performing the actions, Allen you use the sequensial case structure to read, update and Write the data from which this actions will performed sequentially and anoter thing never use the wires of the variables, which are not included in that particular cae, coz that will broke the sequential condition and the data u r reading might not be the current one.

Thanks,

Nishant

0 Kudos
Message 4 of 7
(3,202 Views)

here is my way:

the array is stored in a shift register of a while loop 

one additional copy is made to cancel the changes

you can add new events (or better copy the 'replace' event) and add other functions

you don't have to use an event structure...

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 7
(3,186 Views)

Thanks to everyone for the information and tips. Its nice to know help is available, I shall spend some time working through the suggestions.

Allan 

0 Kudos
Message 6 of 7
(3,171 Views)
You could just remove the outliers automatically.  LV8 has a Remove Outliers function on the Advanced Curve Fitting pallette.  You can provide a range of expected values and it will remove all the values that fall outside the range. 
0 Kudos
Message 7 of 7
(3,165 Views)