Sedona XPRESSion Evaluator Reference Guide

Overview of XE API

The best way to begin familiarizing yourself with the capabilities of the XPRESSion Evaluator is to run the demonstration VI. This VI is called Expr Eval Demo VI and is located in the root directory where you installed the package. The benefits of studying the demo are two-fold. First, the VIs demonstrate the numerous features available with the XPRESSion Evaluator package. The user has an interactive tool for experimenting with expressions, variables, user-defined functions and other capabilities of the XPRESSion Evaluator. In addition, all of the source code (LabVIEW diagrams) used to build the various demo screens are provided. These provide excellent examples of how the XPRESSion Evaluator API may be integrated into an application. The support VIs for the demonstration are located in the \Demo directory of the XPRESSion Evaluator root directory.

Brief Overview of the High-Level API

Though the XPRESSion Evaluator provides an immense amount of flexibility and versatility in building applications, the functionality has been conveniently distilled down to a relatively small API (application programming interface). The XPRESSion Evaluator VIs are divided into a high-level API and a low-level API. The high-level VIs provide a level of functionality appropriate for most applications. These high-level VIs allow the user to compile, evaluate, and manipulate complex expressions. A brief overview of the high-level API follows here, with a more detailed description given later in this document.

Initialize XPRESSion Evaluator VI

This VI must be run before any of the other XPRESSion Evaluator VIs are run in an application. It initializes several internal data structures and loads all configuration information for the XPRESSion Evaluator, such as user function definitions, permanent user variable definitions, and physical unit descriptions.

Compile Expr VI

This VI takes an expression given in the form of a string and converts it into a postfix expression data structure that is used as the input to the Evaluate Expr VI. The VI performs syntax and grammar checking and resolves all references to user-defined variables and functions. An expression need only be compiled once when the actual form of the expression changes. Changes in the values of variables that appear in an expression do not require the expression to be recompiled. Separating this compile stage from the evaluation stage results in excellent run-time performance from the XPRESSion Evaluator.

Evaluate Expr VI

This VI takes a compiled postfix expression along with the current values of variables within that expression to produce a numerical result for the expression. The result of a given expression may be either a scalar or an array. Typically, this VI is executed repeatedly after Compile Expr VI to produce real-time results as the numerical values of variables in an expression change.

Calc Expr Units VI

This VI uses the internal database of physical units along with any physical units associated with variables in an expression to produce the resulting physical units for an entire expression. This capability is often very useful in identifying errors in calculations involving physical quantities.

Update Scalar Variable VI and Update Array Variable VI

These VIs are used to manipulate the real-time values of user-variables in the internal database. Variables may be added to the internal database interactively using the Expr Eval Config Utility VI or programmatically using the Define Variable VI.

Brief Overview of the Low-Level API

In addition to the high-level API, the XPRESSion Evaluator includes a small low-level API which provides programmatic access to some of the features found in the demo and in the Config Utility (discussed later). Again, these VIs are presented briefly here, with a more detailed description to be found later in this document.

Define Function VI

This VI compiles a user function definition given in a standard string format and stores the function definition in the internal database. Once the function has been stored, it can be used in any expression, or even in another function definition.

Define Unit VI

This VI takes several input parameters that define a physical unit and stores the information in the internal database of physical units. Once the unit definition has been stored, it can be associated with variables in expressions and it can even be used in defining other physical units.

Define Variable VI

This VI declares a variable so that it may appear in expressions. The VI is also used to associate a physical unit (if desired) with the variable so that physical unit calculations can be performed on expressions in which the variable appears.

UnDefine Function VI

This VI deletes a user function definition from the internal database of user-defined functions.

UnDefine Unit VI

This VI deletes a physical unit definition from the internal database of units.

UnDefine Variable VI

This VI deletes a variable definition from the internal database of user-defined variables.