03-16-2011 08:14 AM
I want to take some rather small arrays (30 elements) and perform numerous linear and non-linear calculcations to them. The expressions are rather ugly (ex. [1097.8*X1*C1*X2*sqrt(X3/X4)]/[sqrt(1-C2*C3)]), where C's are constants and X's are arrays.
Assuming the code turns out to be somewhat large, in terms of the trade-off between time it takes to actually code these types of equations numerous times and the computational time saved, is it better to use the Formula Express VI or to code this the brute force way of entering each arithmetic operator seperately and wiring the constants and arrays to these operators.
I just began using LabVIEW, so I'm unsure of what may be more beneficial. The n00b in me says use the Formula VI.
03-16-2011 08:24 AM
Coding with LabVIEW primitives is usually faster. If you need to perform the same calculation numerous times, create a subVI containing the subVI. Use the subVI as often as required. Then if you need to change the calculation, you only need to change the subVI.
Lynn
03-16-2011 08:28 AM
Actually, adding to this question: I just discovered the Formula Node. This seems like it may be the best solution.
Also, as a note: I'm not doing the same calculation repeatedly. I'm doing several different nonlinear equations to obtain several different arrays for output. And I shouldn't have to use too many loops, but a couple will be required.