From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-12-2005 07:50 AM
10-12-2005 08:16 AM
10-12-2005 08:23 AM - edited 10-12-2005 08:23 AM
Message Edited by mkniller on 10-12-2005 08:27 AM
10-12-2005 08:36 AM
I don't have LV handy so I can't attach an example, but here's a simple idea:
Store your matrix of indices as a 2D integer array constant on your block diagram. (Note that you'll need to subtract 1 from them because LV array indices are 0-based.) Generate a 2D floating point array of the same dimensions and initialize all values to either 0.0 or NaN, depending on the later data processing you'll do.
Pass the integer array of indices into 2 nested For loops using auto-indexing at the loop boundaries. Pass the 2D floating point array into the loops using shift registers at the boundaries. Pass the 1D data into the loops without auto-indexing.
Inside the inner loop, use the two loops iteration counts ("i") to extract the appropriate index value from the 2D integer array. Use that index to extract the sensor value from the 1D array. Then call Replace Array Subset, passing in the 2D floating point array, the two iteration counts, and the corresponding sensor value.
Just be sure you know which iteration count refers to rows and which one to columns. My habit has generally been to remember wrong so I typically make a quick and simple test program to verify which is which.
-Kevin P.
10-12-2005 09:41 AM
Here is a sample. Written in LabVIEW 7.1.1.
I read your spreadsheet directly and translated the map. You should be able to restructure it to meet your needs.
NOTE: I modified an example from zone.ni.com. With Office, 2003 I had to modify one of the properties. It is documented how to change it back if the VI is broken when you open it.
Hope it helps