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

Adding a LabVIEW MathScript Node to a VI (MathScript RT Module)

LabVIEW 2009 Help

Edition Date: June 2009

Part Number: 371361F-01

»View Product Info

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

  1. Add a MathScript Node to the block diagram.
  2. Use the Operating or Labeling tool to enter the following script in the MathScript Node:a = rand(50, 1)plot(a)
  3. Add an output to the MathScript Node and create an indicator for the output.
    1. Right-click the right side of the MathScript Node frame and select Add Output from the shortcut menu.
    2. Enter a in the output terminal to add an output for the a variable in the MathScript.
    3. Configure the data type of the output terminal. Right-click the a output and select Choose Data Type»All Types»Matrix»Real Matrix from the shortcut menu.
    4. Right-click the a output terminal and select Create»Indicator from the shortcut menu to create a matrix indicator labeled a.
  4. Right-click the error out output terminal and select Create»Indicator from the shortcut menu to create an error out indicator.
  5. Run the VI. LabVIEW invokes the MathScript RT Module 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.
  6. (Optional) Debug the MathScript.

You can display a scroll bar within a MathScript Node.

You also can enable or disable script highlighting for a MathScript Node.


 

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