hschir Posted September 18, 2012 Share Posted September 18, 2012 Hi ! I have a tag for ambient air temperature: LJ_1.V01_C() and, one for releative humidity: LJ_1.V06_RH() I need to use it in the following formula and display the answer - how is this done ? Saturated vapor pressure = es = 6.107 * 10 ^ [ (7.5 * T) / ( 237.7+* T) ], where T = LJ_1.V01_C() Also; Actual vapor pressure = ea = RH * es / 100, where RH = LJ_1.V06_RH() Link to comment Share on other sites More sharing options...
AzeoTech Posted September 20, 2012 Share Posted September 20, 2012 Basically exactly how you wrote it, except with (), and replacing the power (^) with Math.pow(). These are pure javascript expressions, the syntax available anywhere on the web: Math.pow(6.107 * 10,((7.5 * LJ_1.V01_C()) / (237.7 + LJ_1.V01_C())) For the second one you'll need to replace es as well. Note if you want to trend this, you'll need to use math.pow() instead of Math.pow(). Link to comment Share on other sites More sharing options...
hschir Posted September 20, 2012 Author Share Posted September 20, 2012 Thanks, but I think you'll find this works: Saturated vapor pressure = 6.107 * Math.pow(10,((7.5 * LJ_1.V01_C()) / (237.7 + LJ_1.V01_C()))) Link to comment Share on other sites More sharing options...
hschir Posted September 21, 2012 Author Share Posted September 21, 2012 Next: I have a control (my tag is VPD for vapour pressure deficit) to display changing numeric value and it's Control ID: AutoGenID_30. It has the expression: (6.107 * math.pow(10,((7.5 * LJ_1.V01_C()) / (237.7 + LJ_1.V01_C()))))-((LJ_1.V06_RH()*(6.107 * math.pow(10,((7.5 * LJ_1.V01_C()) / (237.7 + LJ_1.V01_C())))))/100) I set up a trace but it won't display anything whether I use the expression directly or use AutoGenID_30 () ? Help ! Link to comment Share on other sites More sharing options...
AzeoTech Posted September 21, 2012 Share Posted September 21, 2012 Oops, sorry, you have it right. The 6.107 should be outside the pow(). As for your trend, did you try just trending LJ_1.V01_C()? AutoGenID_30 is not a tag and can't be trended. Its actually a CSS ID for the control on the webpage, which probably doesn't mean anything to you, but to any web developer would mean something. Most likely you have a typo, but start simple, with just a tag, then add to it. Link to comment Share on other sites More sharing options...
ethushara Posted January 28, 2018 Share Posted January 28, 2018 Hi, I tried the below using just a virtual channel in scripting V. aa = Math.pow(4, 3) But this doesn't result anything in scripting while V.aa = 10 then the V.aa results 10. Please check. Link to comment Share on other sites More sharing options...
AzeoTech Posted January 29, 2018 Share Posted January 29, 2018 DAQFactory or DAQConnect? I'm assuming you mean DAQFactory, where as the rest of this post is about DAQConnect. In DAQConnect, it is math.pow() as DAQConnect runs in JavaScript. DAQFactory scripting is completely different, and much similar. To do 4 raised the third power, you would just do: V.aa = 4 ^ 3 Link to comment Share on other sites More sharing options...
ethushara Posted February 6, 2018 Share Posted February 6, 2018 Thanks. Yes. Its Daqfactory. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.