Skip to content Skip to navigation

Connexions

You are here: Home » Content » LabVIEW MathScript and Hybrid Programming

Navigation

Recently Viewed

This feature requires Javascript to be enabled.
 

LabVIEW MathScript and Hybrid Programming

Module by: Nasser Kehtarnavaz, Philipos Loizou, Mohammad Rahman. E-mail the authors

In signals and systems lab courses, .m file coding is widely used. LabVIEW MathScript is a feature of the newer versions of LabVIEW that allows one to include .m files within its graphical environment. As a result, one can perform hybrid programming, that is, a combination of textual and graphical programming, when using this feature. This chapter provides an introduction to MathScript or .m file textual coding. See (Reference) and (Reference) for advanced MathScript aspects.

MathScripting can be done via the LabVIEW MathScript interactive window or node. The LabVIEW MathScript interactive window, shown in Figure 1, consists of a Command Window, an Output Window and a MathScript Window. The Command Window interface allows one to enter commands and debug script or to view help statements for built-in functions. The Output Window is used to view output values and the MathScript Window interface to display variables and command history as well as edit scripts. With script editing, one can execute a group of commands or textual statements.

Figure 1: LabVIEW MathScript Interactive Window
Figure 1 (figure 2-1.png)

A LabVIEW MathScript node represents the textual .m file code via a blue rectangle as shown in Figure 2. Its inputs and outputs are defined on the border of this rectangle for transferring data between the graphical environment and the textual code. For example, as indicated in Figure 2, the input variables on the left side, namely lf, hf and order, transfer values to the .m file script, and the output variables on the right side, F and sH, transfer values to the graphical environment. This process allows .m file script variables to be used within the LabVIEW graphical programming environment.

Figure 2: LabVIEW MathScript Node Interface
Figure 2 (graphics2.png)

Content actions

Download module as:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks