LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete elements in a 2d array

0 Kudos
Message 11 of 14
(1,179 Views)

  Hello again,

 

   So, you have 18 columns, 12 of which are for your temp sensors.  So basically, for each run through an iteration, the columns that are not being updated remain zero, and you append the new data, including zeros, at the end, correct?  You need the zeros to ensure that the data gets written to the correct column, so why not assign the data specific indices for each channel?  Now, the reason why you need to keep the zeros is because they keep space when you append data to the end.  Why not create a 2D array in your DD1000_DAQ.vi instead, and use the Array Subset.vi to separate/extract the data you need?  Now, I cannot see those three subVIs you have in DDM1000_DAQ.vi, but I'm guessing it's what you're using to read from a specific channel.  All I see is that after those three subVIs, you have a value being written to your initialized array and I'd guess that you could also find a way to output from one of those subVIs an index determining which column is being read.  For example: "if channel = "Kanal 5", index = 1" (based on your pic).  You could wire that index value appropriately to your Replace Array Subset VI in DDM1000_DAQ.vi to determine which cell to overwrite. So, at the end of the iteration of your For Loop, you'll have a 1D array of 18 columns. Instead of appending the next 18 columns at the end of this one, create a new row.  To ensure that rows are not overwritten, use the counter of the While Loop to indicate the current row and build the array from there; you may need to move your Bundle By Name VI outside of the While Loop (on the right), and be sure to then auto index your Werte array.  My suggestion will go like this: when the VI is called, the while loop will be at 0, your for loop will go through 18 iterations (one per column), and once complete, the while loop will go to the next iteration with the counter going to 1, the for loop goes for another 18, and so on until the while loop is stopped.  After this process completes, you'll have a 2d array, and the only zeros that should be present are for when an entire column is zero, if it had been switched off in the front panel control.  You would have to change your Decimate 1D Array VI in your TD_4.vi block diagram, too.  Again, use the Array Subset.vi instead of Decimate 1D Array.vi to extract the data you need.  After this you may also have to change the controls/indicators in your other VIs to ensure that the datatypes agree when you wire them together.  

 

I hope that helps you, have a good day,

 

Dan

0 Kudos
Message 12 of 14
(1,153 Views)

Sometimes that's the data you are given (with 0's in it), you can't go back, change the code, and redo it.

0 Kudos
Message 13 of 14
(397 Views)

@Robur wrote:

Sometimes that's the data you are given (with 0's in it), you can't go back, change the code, and redo it.


Are you responding to any particular post in this ancient thread that hasn't seen activity in 10+ years? Seems a bit terse.

Message 14 of 14
(388 Views)