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

LabVIEW MathScript Window (Windows, Not in Base Package)

Select Tools»MathScript Window to display this window.

Use this window to edit and execute mathematical commands, create mathematical scripts, and view numerical and graphical representations of variables. This window generates output from and maintains a history of commands that you call, lists variables that you define, and displays variables that you select. In LabVIEW MathScript, you generally can execute scripts written in the MATLAB® language syntax. However, the MathScript engine executes the scripts, and the MathScript engine does not support some functions that the MATLAB software supports. Scripts you run in the LabVIEW MathScript Window can generate errors.

You can save scripts you create in the LabVIEW MathScript Window or load scripts from file into the LabVIEW MathScript Window. You also can save and load data files.

Note  The MathScript Node and the MathScript Window can communicate only if they are in the same application instance.

Use the application instance name that appears in the bottom left corner of the LabVIEW MathScript Window to identify which application instance a LabVIEW MathScript Window belongs to. The application instance name includes the project name followed by the target name, such as Project 1.lvproj/My Computer.

This window includes the following components:

  • Output Window—Displays the commands you entered in the Command Window and the output that MathScript generates from those commands.
  • Command Window—Specifies the MathScript command you want LabVIEW to execute. Press the <Shift-Enter> keys to enter multi-line commands. You also can use the up and down arrow keys to display Command History items in the Command Window to edit the commands or execute the commands again.
  • Status—Displays the status of the compilation while MathScript processes the script or commands you executed.
  • Variables—Displays a list of all variables you define and previews variables that you select. This page includes the following components:
    • Variable List—Displays the name, dimension, and data type of all variables you define. The Variable List sorts the global and local variables and displays them alphabetically by name. Select a variable in the Variable List to view it in the Preview Pane. Double-click a variable in the Variable List to display the value in the Output Window. Use the <Shift> and <Ctrl> keys to select multiple variables. You can display multiple one-dimensional variables on the same graph in the Preview Pane.
    • Graphical first?—Specifies whether to display first the numerical or graphical representation of variables in the Preview Pane. You can view only the numerical representation of scalar variables.
    • Display Type—Specifies the format in which to display the variable you select. Display Type does not appear if you select a scalar variable. If you select multiple variables, Display Type lists only those formats that can display all the variables you select. This list can contain the following options:

      • Numeric—Displays the data in an array. You can edit a variable in the Preview Pane when Display Type is Numeric.
      • String—Displays the data in a character array. You can edit a variable in the Preview Pane when Display Type is String.
      • Graph—Displays the data on a waveform graph. This Display Type represents complex variables with two points, one for the real part and one for the imaginary part.
      • XY Graph—Displays the data on an XY graph. You can plot two one-dimensional variables against each other using this Display Type. You also can use this Display Type to plot the real parts of complex variables against their imaginary parts.
      • Sound—Plays the data as a sound. You can use this Display Type only for one-dimensional variables.
      • SurfaceWindows Displays the data on a 3D surface graph.
      • Picture—Displays the data on an intensity graph.
    • Preview Pane—Displays in numerical, string, graphical, or sound format the variables you select in the Variable List. Right-click the Preview Pane and select Undock Window from the shortcut menu to display the variable in a separate window that you can resize. Multiple Preview Pane windows that display a common variable update automatically when you edit that variable. If you display the variable in graphical format, you can right-click the graph and customize it using the shortcut menu items. You also can export data to Microsoft Excel.
      • Update—Updates a variable with changes you make in the Preview Pane. This button is available when Display Type is Numeric or String.
      • 3D style—Specifies the type of 3D graph to display. This drop-down menu is available only when Display Type is Surface.
      • Legend?—Specifies whether to display the legend for a graph. This checkbox is available when Display Type is Graph, XY Graph, or Sound.
      • Swap X-Y—Swaps the axes of the XY graph. This checkbox is available only when Display Type is XY Graph.
      • Color—Specifies the color scheme of the intensity graph. This drop-down menu is available only when Display Type is Picture.
      • Start Sound—Begins playing the data as a sound. This button is available only when Display Type is Sound.
      • rate—Specifies the frequency at which to play the sound. This box is available only when Display Type is Sound.
      • Continuous—Plays the data as a sound continuously. Click the Stop Sound button to stop playing the sound. This checkbox is available only when Display Type is Sound.
  • Script—Displays the script you create. This page includes the following components:
    • Script Editor—Displays the script you create. You can edit and execute commands directly in this window. You also can paste scripts from the Script Editor into the MathScript Node. Right-click the Script Editor and select Open in Editor from the shortcut menu to display the current script in a separate window that you can resize.
    • Position—Displays the location of the cursor in the Script Editor.
    • Save & CompileSaves the script in the Script Editor and compiles the script for future use.
    • SaveSaves the script in the Script Editor.
    • LoadLoads an existing script into the Script Editor.
    • Clear—Clears all commands in the Script Editor.
    • Run—Executes all commands in the Script Editor.
  • History—Displays a history of the commands you executed. This page includes the following component:
    • Command History—Lists all previous commands you entered in the Command Window. Double-click an item in the Command History list or select the item and press the <Enter> key to execute the command again. Use the <Shift> and <Ctrl> keys to select multiple commands. You also can drag and drop commands from the Command History list to the Command Window or to a floating Script Editor window.

Use the Preferences dialog box to configure settings for the LabVIEW MathScript Window.


Resources


 

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