# 有關&#070;ormula Node的應用....

Dar38482.515474537  Eval Formula Node的位置在這裡： Can I Programmatically Change an Equation Inside a Formula Node?

Primary Software: LabVIEW Development Systems>>Full Development System
Primary Software Version: 6.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem: I would like to be able to dynamically change the equation inside of a formula node. I do not want to have to edit the code between executions.

Solution: There are a number of ways to achieve this type of dynamic behavior in LabVIEW. If you have a limited number of equations that you would like to evaluate, you can simply use a case structure in which each case will contain an individual formula node. The case structure will allow you to dynamically decide which of the formulas to use. In the event that you have many formulas, or you would like to programmatically insert the code into a formula node, you may be able to use the Eval Formula Node.vi. This vi was introduced in LabVIEW 6.0 and it can be found in the Full and Professional Development Systems of LabVIEW.

This vi can be found on the functions palette by clicking on the following:

Functions»Anayze»Mathematics»Formula»Eval Formula Node.vi

If you are manipulating a polynomial equation and only the coefficients of the terms are changing, you can alter the coefficients dynamically using a formula node. The formula node is available in all of the LabVIEW Systems. To manipulate an equation in this fashion perform the following steps:

1. Add the coefficients as inputs to the Formula Node by right-clicking the border of the node and selecting Add Input from the shortcut menu.
2. Add an input for every coefficient you want to change.

For example, you can enter the equation y=ax^3+bx^2+cx+d in a Formula Node, and add inputs for a, b, c, d, and x. You can then change the values wired to the a, b, c, and d inputs with every call to the Formula Node.

Dar38482.5157291667

Dar38482.5156018519

[QUOTE=Dar]

[/QUOTE]

^^

ㄎㄎ....算是一個小小的試驗吧～