LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate Enthalpy values from Temperature using lookup table method

Hello Uday,

 

Please find zip file attached herewith which contains my VI and two other .csv documents namely , "Superheated enthalpy" which contaiNs table of all enthalpy values and "Superheated Property Chart" which contains pressure and temp.columns respectively.

 

I read both these files in labview and then pass them to Interpolate 2D function.

 

Kindly let me know if I am wrong or doing something foolish & correct me with the same.

 

Post yours solutions in version 8.2.1

 

Thanks & Regards,

 

Snehal Upadhye

CLAD

 

 

0 Kudos
Message 11 of 20
(5,525 Views)

Hi Snehal,

 

when you want to interpolate in a 2D array you should also provide a 2D array!

 

- Your Z data consist of just one column! That should be a "rectangular" array instead.

- Your X/Y data are just mixed up in two columns with some text garbage in between. There should be just a vector of X and Y data each! X vector can be pressure (from 1 to 60), Y data is temperature (-20 to 300)...

 

Please format your data in a more regular format and create a 2D array of Z data...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 20
(5,514 Views)

Hello GerdW,

 

Thanks for reply.

 

Though my front panel indicator shows that my Z value is only one column ; but in fact its a 2D array only , as I have used Read from spreadsheet file function whose output is a 2D array. This output has been given to the Z input of  Interpolate 2D fuction.

For my convenience I have just reduced my front panel indicator "Enthalpy's" size to just a one column, oherwise it was just a rectangular array only.

If my Z value would not have been a 2D array then Interpolate 2D function wouldn't have accepted it !!!

 

Yeah I know there are some garbage values in my X and Y inputs as I have just copied down this .csv file; but these values are interpreted as "Zero" in labview ; so atleast interpolation with value "0" is possible.

 

These are just my points of view. Kindly correct me if I am wrong.

 

I kindly request you to modify my given VI according to what you are trying to suggest me as I am not exactly getting your point by just reading your suggestions.

 

Thanks & Regards,

Snehal Upadhye,

CLAD

 

 

0 Kudos
Message 13 of 20
(5,500 Views)

Hi Snehal,

 

even when you read your Z data as 2D array it might just have one column of data (just a "x by 1" 2D array). That's not what the interpolation function expects...

 

When you have (for example) 10 pressure values and 20 temperature values you need to have a Z array containing 10 by 20 values! Please format your data in such a way...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 20
(5,482 Views)

Hello GerdW,

 

Thanks for reply.

 

I am getting what you are trying to say, but I am totally unable to implement that in my code.

 

I tried several possible ways with which your suggestion can be implemented ; but could not succed.

 

May be its quite possible that whatever I have been trying so far can be totally wrong and there could be a completely different solution for this than to use Interpolate 2D function. 

 

I am attaching Excel file  given to me (From which I'll have to format my values) in which all the pressure,temp.and enthalpy values are tabulated; so that you can have some idea how interpolation can be done with those.

 

Kindly post some soultion as all my efforts are coming back to square one again and again.

 

Thanks & Regards,

Snehal Upadhye

CLAD

0 Kudos
Message 15 of 20
(5,458 Views)

Hi Snehal,

 

you have to re-format your values into a "real" 2D table. See attachment...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 20
(5,459 Views)

Hi GerdW,

 

Thank you so much for suggestion.

It worked except for certain readings  i.e. -   for every Pressure value enthalpy values corresponding to Temp. -10 & 0 are not according to what is written there in LUT. They are totally different. 

 

for instance; for temp. -10 and pressure 2 Enthalpy=399.77 but its is showing 1.

                   for temp. 0 and pressure 2  Enthalpy= 401.210 but its showing 2

 

Same happens with each value of pressure corresponding to temp.values -10 & 0

 

This code is fully working otherwise.

 

P.F.A here which includes my code and .csv file (LUT) 

 

 

Best Regards,

Snehal Upadhye

CLAD

Download All
0 Kudos
Message 17 of 20
(5,441 Views)

Hi Snehal,

 

the interpolation function has an error output. And you should always check that output.

 

In your case you get an error -20077: "values not ascending".

 

- That's because your X/Y values aren't strictly ascending, as the pressure vector ends with a zero. To get this VI running I used some ArraySubset functions to correct your data reading...

- When loading the CSV data you should use ArraySubset anyway to provide the different parts of that table, as it consists of X and Y vector as well as a Z data array...

- I made all those values default to get rid of the CSV file...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 18 of 20
(5,438 Views)

HI GerdW,

 

Thank you so much for all the help throughout.

 

It seems that my problem has been solved with this solution.

 

Best Regards,

 

Snehal Upadhye

CLAD

0 Kudos
Message 19 of 20
(5,425 Views)

Hi Snehal,

 

then you should mark the message as "solution"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 20 of 20
(5,406 Views)