-1

Based on a question from: mathematical equations to create a virtual channel in labview

i have tried the following to parse and calculate several equations in order to produce virtual calculated channels for power measurements problem i am facing is that in the output of the parsed formula i get the same result for both equations

enter image description here

enter image description here

open for any other suggestions on how to calculate virtual (calculated) channels that are sampled from DAQ and that will be streamed to a graph or chart later on - MUST BE able to load equations dynamically

thanks Assaf

Assaf Baker
  • 151
  • 1
  • 1
  • 8

2 Answers2

1

As far as I can tell, the entirety of the problem here boils down to one decision in the solver VIs:

There is only ever expected to be one value left of the equals sign

With this in mind, when the VI does its parsing, it recognizes the brackets to the left of the equals sign and decides those are irrelevant and skips them entirely.

If you remove these brackets that are introduced by your 'Substitution' then the equations are actually solved correctly and the brackets introduced to the right of the equals have no impact on the functionality of the code call.

With all of that said, the solution to your problem basically comes down to how effectively you can parse your user input to ensure that there the equations follow the rules for operating the parser:

  1. Only allowable variable names are used
  2. No brackets left of the equals
  3. Only one variable left of the equals.

Operational solving of equations

Steve
  • 963
  • 5
  • 16
0

"Parse Formula Node.vi" has also "Variables Output" input. Please try to connect it and provide values "P_Tot" and "I_Total"

  • if you look inside the VI of "Parse Formula Node.vi" you will see that Variables Output is not connected to anything – Assaf Baker Oct 07 '21 at 11:00