LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mathscript / formula node precision

Hi i was hoping someone could tell me more about a formula node / mathscript node.  I want to emulate a cordic Algorithm implemented in hardware within LabVIEW.  since the hardware uses 16bit integers i want to do all the mathematics in this precision.  If i pass (or if it is possible to pass) 16 bit integers to a formula node, does the node stick with this precision or does it do the maths in floating point or whatever and return the result as a 16 bit integer?
 
Any suggestions on how to approach this problem would be great.
 
Thanks in advance
 
Craig
LabVIEW 2012
0 Kudos
Message 1 of 6
(3,851 Views)
I believe that this answer has been fully addressed here.  If not, please post back and we'll try to better address your question!

Respectfully,
0 Kudos
Message 2 of 6
(3,806 Views)

Hello,

 I have some doubts about the mathscript operation.

I am a .vi with diferente values calculated from a adquired signal. Then I have defined this values like local variable.

For example: A, B, C, dA, dB, dC

I would like to do a formula that uses these data and the result shows  in a Waveform graph thats change in the time.

For the example:  R= A*cos B- dA*senC

 I don´t know it is better to use the mathscript or a formula node and if I can call this variables instead of wiring the variables to the formula.

Thank you very much. I would be grateful for some idea.

John.

0 Kudos
Message 3 of 6
(3,647 Views)
Hi John,

no need for formula node nor mathscript!

Just take simple math functions provided by LabView... They work also on arrays and are (IMHO) faster than the other options.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,640 Views)

Thank you very much for your good answer.

I will make it with the math function althought the block diagram seems a bit chaos with so many wires.

Best regards Gerd.

John.

0 Kudos
Message 5 of 6
(3,622 Views)

Hi John,

Wherever possible always do it in Native LabVIEW.  The only reason i had to do this in mathscript was to emulate some VHDL code by using similar Bitwise maths.  LabVIEW does this fine natively although when you put them side by side in a review everyone shakes their heads.  Hence if you put two text languages side by side with the same or very similar syntax everyone "sees the light"  I actually ended up doing this using LabWindows and creating a dll which was then called from LabVIEW.  Everyones a winner 🙂

Craig

LabVIEW 2012
0 Kudos
Message 6 of 6
(3,572 Views)