LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing + -*/ function in LabVIEW and using recursion to solve such a problem

I remember when I was learning C++ I was able to "over write" the mathmatical operation of +-*/

I was wondering if there is a way to do that using LabVIEW.

E.g. if I wanted + A B C D=> A+B+C+D

Could I do that using LabVIEW?

What is I had a complicated string input that requires recursion?

Any ideas?

Thank you

Best

0 Kudos
Message 1 of 6
(2,440 Views)

Your question is not clear. Are you talking about doing this in the formula node, with the formula parser VIs, or with the VI functions? You cannot override the VI primitives, like Add and Subtract. You can create a polymorphic VI that can accept different kinds of inputs, but the primitives are already polymorphic, as they will accept numerics or arrays, for example. If you're talking about the formula node, it does not have that capability.

 

I also do not understand what you mean by a "complicated string input that requires recursion", as it's not clear whether you're talking about a string input to a VI, or something else.

0 Kudos
Message 2 of 6
(2,435 Views)

I wanted to know if I can use LabVIEW somehow.

My first thought was Formula node but your reply answered my question.

Is there another way?

Thank you

0 Kudos
Message 3 of 6
(2,430 Views)

@A.A.A. wrote:

I wanted to know if I can use LabVIEW somehow.


LabVIEW is a full featured programming language, so yes, with appropriate code you can do anything you want!

 

Do you want a VI that solves symbolic math, rewriting a formula according to some rules? For example a VI with a string input and a string output, and the user can type a formula, e.g. "+ A B C D" and it would convert it to "A + B + C + D"? Or do you want a VI that creates a numeric solution of a formula given in a weird syntax, e.g. if the users enters " + 1 2 3 4", it would give the result of 10?

 

Please clarify.

0 Kudos
Message 4 of 6
(2,418 Views)

altenbach, anyone of the suggestions would work but I would like to see the output or the result of th summation.

 

 

 

0 Kudos
Message 5 of 6
(2,398 Views)

Send in an array of operator, extract the first one to decide what to do wiht the array (use it as case selector), then convert string to numer and add the number array (send the array to +).

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 6
(2,385 Views)