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

Creating an Xmath Script

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 an Xmath script.

Note  You must have the Xmath software installed on your computer to use the Xmath script node because the script node invokes the Xmath script server to execute Xmath scripts.
  1. Place an Xmath script node on the block diagram.

  2. Use the Operating or Labeling tool to enter the following script in the Xmath script node.

    a = random(10, 10);
  3. Add an output to the Xmath script node and create an indicator for the output.
    1. Right-click the Xmath script 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 script. By default, the Xmath script node includes one input and one output for the error in and error out parameters.
    2. Verify the data type of the output terminal. In the Xmath script node, the default data type for any new input or output is Real Scalar. Right-click the a output terminal and select Choose Data Type»2-D Array of Real from the shortcut menu.
    3. Right-click the a output terminal and select Create»Indicator from the shortcut menu to create a 2D array of numeric indicators labeled 2-D Array of Real.
  4. Right-click the error out output terminal and select Create»Indicator from the shortcut menu to create an error out cluster indicator labeled error out.
  5. Resize the 2-D Array of Real front panel indicator so you can see all the numbers the script generates when the VI runs.
  6. Run the VI. LabVIEW invokes the Xmath script server, creates a 10 × 10 matrix of random values, plots that information to a graph, displays the matrix in the Xmath software, and displays the values that make up the matrix in the 2-D Array of Real front panel indicator.
  7. (Optional) Debug the Xmath script.

You can display a scroll bar within an Xmath script node.

Note  Except for the plot command, the quit command, and any graphical user interface command, a script inside an Xmath script node behaves as it does in the Xmath environment.

Resources


 

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