Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Adding a LabVIEW MathScript Node to a VI (Windows)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Complete the following steps to create and run a VI that uses a LabVIEW MathScript.

  1. Place a MathScript Node on the block diagram.



Note  You can create MathScript Nodes only in the LabVIEW Full and Professional Development Systems. If a VI contains a MathScript Node, you can run the VI in all LabVIEW packages.
  1. Use the Operating or Labeling tool to enter the following script in the MathScript Node:

    a = rand(50, 1)

    plot(a)
  2. Add an output to the MathScript Node and create an indicator for the output.
    1. Right-click the MathScript Node frame and select Add Output from the shortcut menu. Enter a in the output terminal to add an output for the a variable in the MathScript. By default, the MathScript Node includes one input and one output for the error in and error out parameters.
    2. Change the data type of the output terminal. In MathScript, the default data type for any new input or output is a Scalar»DBL. Right-click the a output and select Choose Data Type»Matrix»Real Matrix from the shortcut menu.
    3. Right-click the a output terminal and select Create»Indicator from the shortcut menu to create a matrix indicator labeled a.
  3. Right-click the error out output terminal and select Create»Indicator from the shortcut menu to create an error out cluster indicator.
  4. Run the VI. LabVIEW invokes the MathScript server, creates a vector of random values, plots that information to a graph, and displays the values that make up the vector in the Real Matrix front panel indicator.
  5. (Optional) Debug the MathScript.

You can display a scroll bar within a MathScript Node.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit