LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI of the Day (11/4/2009) - Formula Node

Hi Tim,

 

usually Sin&Cos is slightly faster than Sin and Cos seperately.

If I remember right there is a special FPU command that computes Sin&Cos simultanously (they share the same lookup tables, it's just a different offset into the table...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 17
(1,460 Views)
For your LV8.6 viewing pleasure.  A few tweaks, but thanks to the beauty of a type def, not so bad.
Message 12 of 17
(1,455 Views)

Given the short time between idea and implementation there are bound to be a few boneheaded mistakes, but here is the unlocked LV9 version of my code.  I thought it was getting out-of-hand until I checked out the hierarchy for the Formula String Evaluation VIs.

 

 

Message 13 of 17
(1,409 Views)
could you post the unlock in 8.6? thanks
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 14 of 17
(1,393 Views)
Message 15 of 17
(1,385 Views)

A small bug was introduced in the backsave to 8.6 process, the parameters for the '^' operator should be -2 instead of 2, that is how I tell if I want to reverse the order. (In FindFunction.vi)

 

New version here.

 

 

Message Edited by Darin.K on 11-04-2009 06:10 PM
Message 16 of 17
(1,383 Views)

Found this thread looking for info on benchmark of formula node versus regular code and I gather that there is none.

This is brilliant, Darin.

There is an undocumented feature in the code though (or at least I did not find the doc), which I thought people might be interested in

to generate a VI with more than one inputs (e.g. for multiparameter functions) just declare those parameters with a predefined constant value, as in the example (x=1.0).

 

example: 

DBL x=1.0,y=2.0,z;

z=sin(x)/(3x^2-3*2x+y)^2;

 

results in:

 

ScreenHunter_001.jpg

 

very cool!

 

Question 2: how difficult would it be to translate the G diagram into a Formula Node? Just kidding.

 

Although this piece of code is probably superseded by your iPad winning Math Tool, I never could get the latter work in LV 2010, whereas this one seems to work just fine in LV 2011.

0 Kudos
Message 17 of 17
(892 Views)