LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove column from lvm file and read to 2D array

Solved!
Go to solution

Hi All,

 

Totally new to labview (about 3 weeks), Have learnt an awefull lot on this forum and web searches.

 

I am stummped at present. I want to store the calibrated data for pressure transducers into a lvm file and use this as a default file so I dont haveto recalibrate the transducers every time I open the vi. I have managed to save the file but the data presents in 4 columns and I only need the 2nd and 4th column. Can anyone please point me in the right direction

Config file.PNGFile.PNG

 

Data.PNGThe last column should read the same as the last column in the lvm file 0-5v not the 0-10 column.

I need to fine tune as the file will be written to when in cal mode and read when the vi executable opens

 

Any help appriciated

0 Kudos
Message 1 of 7
(3,025 Views)

Explore the Array palette.

 

Use Delete from Array.  Or Index Array to get the two columns and Build Array to put those 2 columns back together in a new 2-D array.

0 Kudos
Message 2 of 7
(3,010 Views)

Thanks for the input. Finally understood how the array and dynamic data interacted and came up with this..works ok as a stand alone, just need to put it into my base vi

 

Capture.PNG

 

 

 

Cheers

0 Kudos
Message 3 of 7
(2,965 Views)

Your code architecture in that screenshot does not make much sense.

 

If Cal Mode is True, that inner while loop is going to run continuously as fast as it can writing and rewriting data to the Measurement File.

 

I don't understand what is the relationship between Data and Data2.

And it is odd that the index  and length for the Array Subset function are controls to be manipulated by the user of the VI.

0 Kudos
Message 4 of 7
(2,956 Views)

Thanks for the reply,

 

I am totaly new to this labview, still trying to get my head around the way things work. I have changed the index and array length to constants and removed the loops from the write to file.

 

Data and Data2 were arrays I used to see if the program was working (didnt know about the probe capability), Once I understood the way things worked I modified as per below image.

 

The final code is below. Probably not the best way to do it and open to sugestions. The process takes the values of 6 pressure transducers (calibrated values) and writes them to a config lvm file when the calibrate bool is true. Cal bool is false when reading and logging actual values. The read code is activated only when then the vi is closed and reopened.

 

Appreciate the input you provided.

Final Read.PNGFinal Write.PNG

0 Kudos
Message 5 of 7
(2,953 Views)
Solution
Accepted by topic author Loppy

Get rid of the property nodes and just wire directly from where you are writing to it to where you are reading from it.

 

All the array manipuplation is very odd.  Doing mulitiple array subsets, then going and doing a delete from array to get a single item  (or are you removing a single item) seems like a lot of unnecessary manipulation.  It seems like you should just be using Array Index.  If so, you can do that with a single function since it is expandable to give multiple outputs.

0 Kudos
Message 6 of 7
(2,944 Views)

Cheers for that, Will have to get my head around how the Array index works.

 

The data is read from the file as 24 colum array. need every 2nd column read to each data set, ie 0 and 2 to d1, 4 and 6 to d2 and so on.

 

Baby steps are a pain.

 

Thanks for the help

0 Kudos
Message 7 of 7
(2,939 Views)