Editing the contents of a labview array

I am trying to increase certain elements by 1 in order to record the results as they become available. I am trying to read an element, add 1 to it, and then write it back to the same memory address. Why is it not so simple?

In code, it would be so simple:

array1[element1] = (array1[element1]+1) 

or

 array1[element1]++ 

Do arrays seem to be either read (indicators) or a record (controls)? This is really disappointing, and there is very little help on the Internet.

+4
source share
3 answers

You can use the Index / Replace Array element inside the Place Element Structure:

usage of in place element structure

+6
source

You should use ReplaceArraySubset in the Array palette. For simple replacements, it is much faster than the structure of In Place elements. Replace Array Subset example.

+3
source

As a rare, novice Labview user, I have the same problem ... until I found the code that I used 10 years ago. Of course, the answer to sgccarey: Right-click on a control or array indicator and create a local variable. This variable will appear on the block diagram and can be set as "Change to write" or "Change to read" as needed to be used as an input and / or output array for a simple "subset of a subset". Thus, the array data is displayed only once on the front panel and is updated as necessary. I have no idea that using local variables affects performance, but it works for me. Hope this helps.

-1
source

Source: https://habr.com/ru/post/1469169/