LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Refprop to calculate a refrigerant state


@syed.raza  a écrit :

Hi,

 

I finally manage to get the properties of Fluids in labView, procedure is lengthy but quite simple to do.

 

1) Installed matlab on my computer.

2) Installed Refprop on my computer (http://www.boulder.nist.gov/div838/theory/refprop/MINIREF/MINIREF.HTM )

3) Connect Refprop with Matlab (http://www.boulder.nist.gov/div838/theory/refprop/LINKING/Linking.htm#MatLabApplications). By doing this you should be able to call Refprop in to Matlab. If you can do it, then next step is fairly simple.

4) Afterward, call the matlab script in labView. Function>Mathematics>script and formulas>script nodes> Matlab script. Or simply search in funtion "Matlab. By doing this you will be able to do what ever you can do in Matlab.

 

I am currently using it. It is faily simple.

 

Let me know if you stuck some where.

 

Thanks

 

Syed


Hi @syed.raza I have matlab linked with refprop. I used Matlab script 

alhabeeb_0-1739435742026.png

as you said.

Would you share your VI or photo of your code. 

Thanks

 

0 Kudos
Message 11 of 18
(283 Views)

Hi alhabeeb,

 

please keep discussion in one place instead of scattering in several threads (and bringing back old threads)!

 

You cannot "add parameters" to a DLL function call on your own, you need to follow the DLL definitions (as already mentioned by Rolf)!

 

What's your intention to use an empty Matlab script node?

Best regards,
GerdW


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

@GerdW  a écrit :

Hi alhabeeb,

 

please keep discussion in one place instead of scattering in several threads (and bringing back old threads)!

 


I fully understand yours suggestion, but I'm looking for a solution.


 

What's your intention to use an empty Matlab script node?


I would would like to know how to feed the script with date and how to get out the outputs.

Thanks 

0 Kudos
Message 13 of 18
(262 Views)

Hi alhabeeb,

 


@alhabeeb wrote:
I would would like to know how to feed the script with date and how to get out the outputs.

Typically you define inputs and outputs in the Matlab node (like you do in the formula node or in the deprecated MathScript node)…

Best regards,
GerdW


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

What in the github repository doesn’t work for you? If it is about how to use the umpteen VIs it provides, then the answer is really RTFM for the RefProp library. Trying to do your own Call Library Node magic is similar to trying to build your own car because you need to go to an appointment while there is a public bus going almost to the location you need to be.

Trying to use a Matlab script would be about similar than going to the other side of the country to loan a car from a relative instead. Both are a very roundabout way to solve your problem and wrought with pit-holes on the long way.

 

Read the documentation to the RefProp DLL and look at theVIs in the github repository. If the RefProp dll can do what you try to do, the according wrapper is almost certainly in there and you can safe yourself from building your own car. You still need to learn reading the time schedule of the public bus of course!

Rolf Kalbermatter
My Blog
0 Kudos
Message 15 of 18
(255 Views)

Thanks for the advices.

@ 

I thought using Matlab script is very straightforward!

OK. I will stay with your opinion to take the publick bus instead of build my own car or going to the other side of the country ^_^.  

Unfortunately,  the github repository VIs didn't work!

alhabeeb_0-1739452843557.png

Thanks

 

 

0 Kudos
Message 16 of 18
(240 Views)

@GerdW  a écrit :

Typically you define inputs and outputs in the Matlab node (like you do in the formula node or in the deprecated MathScript node)…


I tried Matlab script Node, and it looks easy, but now I have an issue in my VI attached here that the value of the variable (T) not passing to the node! When I initialized it, it works. How can fix this issue?

Thanks 

0 Kudos
Message 17 of 18
(224 Views)

Hi,

Problem solved by using Matlab script node.

Thanks

0 Kudos
Message 18 of 18
(184 Views)