LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

refprop

LabVIEW missed a couple of wires in the file read code when I backward compiled it from 8.2 to 8.0 to 7.1

Try this recompiled version. I verified it works with pure fluids and mixtures.

Look in the VI tree at the example (Refprop Example.vi).
Using this code, both pure fluids and mixtures are handled the exactly the same way.


Message Edited by gsussman on 02-20-2007 12:19 PM

Message 11 of 45
(4,674 Views)

I tried these VI's and managed to get properties for mixtures to read, which is major progress for me. However, I'm now getting a lot of errors (the type that require Labview to shut down). These don't happen all of the time. I use the part of the code that you sent me to initialise, and then I use the "Call_TPFLSHdll+Indicators" which I got some months ago (on this thread) to read properties when values of P and T are input. Maybe you have an updated version of the routine to do this. If not, can you suggest any possible reasons for the errors?

Regards,

Will

0 Kudos
Message 12 of 45
(4,661 Views)
Unfortunately I don't have any functions other than the ones that are included in the zip file I sent you.

LabVIEW errors (the type that require a shutdown) when calling a DLL are normally indicative of passing the DLL the wrong data type(s) or passing arguments that don't have the correct preinitialized size. LabVIEW does not allow allocation of memory by the DLL, LV must pass all parameters to the dll padded to specific lengths. The same holds true for any data retruned from the DLL.

The best advise I can give you is to use the code I sent you as a baseline for extending the functionality to other Refprop function calls.
Use the calling convention detailed in my code. DO NOT use the calling conventions used in the code you originally received from NIST. The NIST calling conventions are not formatted 100% correctly. They will work for pure fluids but will fail when attempting to work with mixtures.

0 Kudos
Message 13 of 45
(4,654 Views)

I believe that most of these calculations have limits on the ranges. If a calculation attempt is made and the data input is not a reasonable number you will get this error. Maybe you could use some sort of valid range check before attempting the call. You could use the example Excel program supplied on with the NIST CD to check the response with the given data. I believe that if you attempt to give it data that is out of range it will respond with an error and allowable ranges. (In the excel example)

 

 

 

- There are 10 kinds of people in the world, those that know binary, and those that don't

0 Kudos
Message 14 of 45
(4,648 Views)
You are correct about the allowable ranges, however that should only generate an error in the error cluster, and appropriate error source text.
Range checking would be a pretty difficult operation in that in many cases you have multi variable dependence. My recomendation would be to simply perform the calculation and pick up any errors returned by Refprop.


 That being said, I believe the error that he described (LV crashes) is the result of an improper DLL call.
0 Kudos
Message 15 of 45
(4,639 Views)

As you say, I don’t think that it’s due to out of range values because sometimes it doesn’t give the error for several runs of the program, and then it appears even though the input values (and therefore the returned values) haven’t changed.

 

I tried to see if the error correlated with anything (time intervals between runs etc.) and the behaviour is pretty eratic – sometimes the program runs and sometimes it crashes.

 

One strange thing that happens if I’m editting the program that calls TPFLSHdll, is that

 when I go to save or close the changed program, I occasionally get a report of an “insane” object and then a message saying there has been a Fatal Internal Error. So, even when I don’t run the VI that links to the DLL, but simply edit the program that contains this VI, unusual errors can arise.

 

I will try to check the calls to the DLL, but they seem to be what’s documented by NIST. Also, would the fact that it works fine for pure substances not suggest that the calls are OK?

 

Regards, Will.

0 Kudos
Message 16 of 45
(4,625 Views)

Dear gsussman,

I have been using the VI's that you posted to this forum to extract properties for R404A from refprop, and I am delighted to say that they are working well. The files that I earlier got from NIST were giving intermittent errors, on which subject you commented previously in this thread. I am currently using the TPFLSH routine to extract enthalpy values when P and T values are input. I would like, now, to do a similar routine for for PHFLSH (as I cannot find entropy with a PT input pair for one of the points) and I was hoping to look at the code of your TPSLSH routine. All that I wish to check is what is different about your call to the DLL and the call in the VI posted by NIST, that makes your one stable, and the other one crash. Would it be possible to get a non-passworded version of TPFLSHdll.VI to check this? I know this is a bit cheeky, but many of the other VI's that you posted are not passworded, and it would probably unlock the reason for the errors and allow me to develop other similar VI's.

Regards,

Will

0 Kudos
Message 17 of 45
(4,564 Views)

Hi guys,

I see you have already come accross my problem before!

I am looking to get hold of the converter of refprop for use with simply converting nominal  density values into pressure. I have used all the SubVI measurements that you have sent me already but none of them see to have the function that i actually need. Was just wandering if I was going about this the wrong way or there was something else that might be helpful out there.

Basically I just want to use the pressure and density functions. of the dll. I have some VB code which seems to be doing it ok. Any ideas. Would be great to get in contact about this. Best regards Pete Davies

davies.pg@gmail.com

 

0 Kudos
Message 18 of 45
(4,200 Views)
Pete Just because the actual DLL call to the specific REFPROP function you need is not included in the supplied VIs, does not necessarily mean that it is not available in the REFPROP dll. The code developed was only those functions that I required when I built my original app. There was quite a number of functions that have not been included. If you can perform the function using the actual REFPROP exe file then there is a way to do it using the LabVIEW calls (some included, some you will have to build yourself). The key to doing it is to use the functions I posted earlier in this thread as a baseline for creating your own functions. Be very aware of the data sizes of the inputs to the DLL. Most of my code checks and formats it properly so don't strip that out by accident. Regards, Greg
Message 19 of 45
(4,174 Views)
Hello, I have downloaded your Refprop zipped file for LV 7, thak you very much for your time and effort here.  I am missing the Refprop.dll, I guessing that it is not included in your zipped folder but I wanted to be sure.  Where would I find the Refprop.dll?  Thanks.
0 Kudos
Message 20 of 45
(3,870 Views)