Escolar Documentos
Profissional Documentos
Cultura Documentos
Declare an input variable by right-clicking the Formula Node border and selecting
Add Input from the shortcut menu. You cannot declare input variables inside the
Formula Node
Declare an output variable by right-clicking the Formula Node border and selecting
Add Output from the shortcut menu.
Formula Node
• You van select the Formula Node from:
Factions Palette >>Programming >>Structures
Formula Node Example 2
Solve the equation
AX^2 + BX + C = 0
Formula Node
When you work with variables, remember the following points:
Iteration
0 during the first iteration
1 during the second iteration
etc up to N-1
The left, topmost terminal holds the value from the previous iteration,
i-1. The terminal immediately under the uppermost terminal contains
the value from iteration i-2, and so on with each successive terminal.
Case Structures
• The Case Structure is a method of
executing conditional statements. The
Case Structure is similar
If (Condition) then
Do This
Else selector terminal
Do That
Endif
Case Structures
• A Case structure has two or more subdiagrams,
or cases. Only one subdiagram is visible at a
time.
• The selector terminal
can be
Boolean,
Numeric,
or String
Case Structures
A few things to remember about Case Structures and their data types:
• If the data type is Boolean, the structure can only have two cases:
True or False.
• If the data type is numeric or string, the structure can have many
cases.
• If the data type is numeric or string, the first case will have default in
the case structure name.
• Cases are not required to use input data or to supply output data,
but if any case supplies output data, all must do so
Case Structures Example
Sequence Structures
• The Sequence Structure is used to control the data flow
in a VI's Block Diagram. They are used to control the
order of execution of nodes
Sequence Structures
Sequence Structures
• To pass data from one frame to any subsequent frame,
use a sequence local terminal.
Sequence Structures
• An outward-pointing arrow appears in the
sequence local terminal of the frame that
contains the data source.
This function:
• Returns the value wired to the t terminal if the value at
the s terminal is TRUE
• Returns the value wired to the f terminal if the value at
the s terminal is FALSE.
Timing
Wait Until Next ms Multiple function
This function is used to synchronize activities. The function is placed within a loop
to control the loop execution rate.
Timing
Wait (ms) function
Adds the wait time to the code execution time, as illustrated. This can cause a
problem if code execution time is variable.
Feedback Nodes
• Appears automatically in a For Loop or While Loop if the output of a
subVI or functions are wired to the input of that same VI or function,
Like a shift register
Initial Condition
Assignments
• Write a VI that sums the first 10 terms of the series (32+i*cos(x)).
Where x in an input value and i=0,1,2,…
• Write a VI that solve any second order equation, you should use
the Formula Node and the case statement. The VI has three
inputs A,B, and C as in assignment 1, and two outputs, the real
part and the imaginary part.