LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

manual indexing

I am trying to import data from an external instrument into a 2D array. I would like for the data to be imported into one cell at a time, and for the user to be able to arbitrarily select which cell will be filled and when. I'm reasonably sure that I can do this using the Replace Array Subset function or the Build Array function. The problem is whether the program will remember all of the measurement previously recorded into the array. So far, I've tried several things, including Case Structures with concatenated and non-concatenated Build Array objects, as well as FOR loops with and without auto-indexing, but I just can't seem to figure out how to do this. is there a way to manually index the array, and perhaps use Shift Registers to maintain the original values? Thank you.

Regards,

-David Clark
0 Kudos
Message 1 of 3
(2,843 Views)
Since you want the ability to put the data into any cell, you must predefine your array with default values (0 or -99 or whatever). For example, you cannot put a value in row 3 column 1 if there is no data in row 2. So define your initial array and use it to initialize a shift register. Use loops to get the row and column number and the signal to put the data into the array. See attached vi.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 3
(2,836 Views)
As follow on to the other post, be careful what value you select as your default. For floating point data you always want to use NaN (Not-a-Number). Any other value puts you at risk of ending up with a default that is also a valid value. With integers you have to be extra careful because with integers there are no predefined "undefined" values.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 3
(2,831 Views)