Complete the following steps to create and run a VI that uses a LabVIEW MathScript.
- Add a MathScript Node to the block diagram.
- Use the Operating or Labeling tool to enter the following script in the MathScript Node:a = rand(50, 1)plot(a)
- Add an output to the MathScript Node and create an indicator for the output.
- Right-click the right side of 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.
- 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.
- Right-click the a output terminal and select Create»Indicator from the shortcut menu to create a matrix indicator labeled a.
- Right-click the error out output terminal and select Create»Indicator from the shortcut menu to create an error out indicator.
- 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.
- (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.