06-01-2020 03:38 AM
Hello Everyone,
I am getting data from several sensors and I want to do calculations with them via Labview. The equations are long. Whats the procedure or method to do this?
Regards,
Alexis Koulidis
Solved! Go to Solution.
06-01-2020 04:28 AM - edited 06-01-2020 04:30 AM
Just implement the equations using LabVIEW code. Length is irrelevant.
If you tell us a little more about the problem, maybe we can give more specific advice. What does the formula do? How many inputs does it have?
06-01-2020 05:09 AM
Hello,
Thank you very much for your reply. I am getting data from 4 sensors, and I want calculate an other parameter that combines the sensors data with some constants.
Initially I was thinking to do with several Numeric and to each part of the addition, subtract or division separate, but I want to do all the calculations in once..If it is possible
I am giving an example of the formula: X,Y,Z and C are my input data from the sensors and 120,12,50 and 30 are constants
A = (120*pi*X)/(12*Y) + (Z*50)/(C+30)
06-01-2020 05:44 AM - edited 06-01-2020 05:44 AM
Personally, I find the Formula Node easier to read equations from (and therefore implement). Others, like Altenbach, will go with the "pure" LabVIEW code (wire up all of the functions).
06-01-2020 06:18 AM
@crossrulz wrote:
Personally, I find the Formula Node easier to read equations from (and therefore implement). Others, like Altenbach, will go with the "pure" LabVIEW code (wire up all of the functions).
Excellent. A solution for everyone's tastes. 🙂
06-01-2020 10:57 PM
Your solution looks excellent. One last question if I may. In your VI you put the X,Y,Z and C that you can put the values. In my case, I will just connect my data output correct with the numeric?
-Alexis
06-02-2020 02:40 AM
Though, a quick test show the formula node is noticably slower, so depending on your requirements it might be needed to use the nodes.
06-02-2020 04:54 AM
@Yamaeda wrote:
Though, a quick test show the formula node is noticably slower, so depending on your requirements it might be needed to use the nodes.
I'd like to see your benchmark and results. I know the formula node will eliminate parallelism, but I have trouble believing it will be "noticeable" on a small equation like this.
06-02-2020 04:57 AM
@Alexis_Koul wrote:
Your solution looks excellent. One last question if I may. In your VI you put the X,Y,Z and C that you can put the values. In my case, I will just connect my data output correct with the numeric?
I would turn what I showed you into a VI on its own with the controls and indicator connected on the Connector Pane. This small block is then easily testable and reusable. Your main VI will then just call this equation VI, wiring up the values to the right inputs.
06-02-2020 05:11 AM
10M loops yields ~700 vs ~100ms (formula node in other case). So no, it's not noticable in a single run. But as i said, if the requirements are such that'll run many times in a tight loop, a factor of 8 is noticable. 🙂