Labview Function and Vi Reference Manual
Labview Function and Vi Reference Manual
Reference Manual
LabVIEW Function and VI Reference Manual
Fax-on-Demand Support
512 418 1111
International Offices
Australia 03 9879 5166, Austria 0662 45 79 90 0, Belgium 02 757 00 20, Brazil 011 288 3336,
Canada (Ontario) 905 785 0085, Canada (Québec) 514 694 8521, Denmark 45 76 26 00, Finland 09 725 725 11,
France 01 48 14 24 24, Germany 089 741 31 30, Hong Kong 2645 3186, Israel 03 6120092, Italy 02 413091,
Japan 03 5472 2970, Korea 02 596 7456, Mexico 5 520 2635, Netherlands 0348 433466, Norway 32 84 84 00,
Singapore 2265886, Spain 91 640 0085, Sweden 08 730 49 70, Switzerland 056 200 51 51, Taiwan 02 377 1200,
United Kingdom 01635 523545
Copyright
Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical,
including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part,
without the prior written consent of National Instruments Corporation.
Trademarks
DAQCard™, DAQ-STC™, DAQPad™, LabVIEW™, natinst.com™, National Instruments™, NI-DAQ™,
PXI™, RTSI™, and SCXI™, are trademarks of National Instruments Corporation.
Product and company names listed are trademarks or trade names of their respective companies.
Chapter 1
Introduction to the G Functions and VIs
Locating the G Functions and VIs ...................................................................................1-1
Function and VI Overviews .............................................................................................1-2
Structures...........................................................................................................1-2
Numeric Functions ............................................................................................1-3
Boolean Functions .............................................................................................1-3
String Functions.................................................................................................1-3
Array Functions .................................................................................................1-3
Cluster Functions...............................................................................................1-3
Comparison Functions.......................................................................................1-4
Time and Dialog Functions ...............................................................................1-4
File I/O Functions..............................................................................................1-4
Advanced Functions ..........................................................................................1-4
DAQ ..................................................................................................................1-5
Instrument I/O ...................................................................................................1-5
Communication .................................................................................................1-5
Analysis VIs ......................................................................................................1-5
Select A VI... .....................................................................................................1-6
Tutorial ..............................................................................................................1-6
Instrument Driver Library .................................................................................1-6
User Library.......................................................................................................1-6
Application Control ...........................................................................................1-7
PART I
G Functions and VIs
Chapter 2
G Function and VI Reference Overview
G Functions Overview..................................................................................................... 2-2
Introduction to Polymorphism......................................................................................... 2-2
Polymorphism ................................................................................................... 2-2
Unit Polymorphism ........................................................................................... 2-3
Numeric Conversion ......................................................................................... 2-4
Overflow and Underflow .................................................................................. 2-5
Wire Styles........................................................................................................ 2-6
Chapter 3
Structures
Structures Overview ........................................................................................................ 3-2
Chapter 4
Numeric Functions
Polymorphism for Numeric Functions ............................................................................ 4-2
Polymorphism for Transcendental Functions ................................................... 4-3
Polymorphism for Conversion Functions ......................................................... 4-3
Polymorphism for Complex Functions ............................................................. 4-4
Arithmetic Function Descriptions ................................................................................... 4-4
Conversion Functions Descriptions................................................................................. 4-9
Trigonometric and Hyperbolic Functions Descriptions .................................................. 4-14
Complex Function Descriptions ...................................................................................... 4-20
Additional Numeric Constants Descriptions ................................................................... 4-21
Chapter 5
Boolean Functions
Polymorphism for Boolean Functions............................................................................. 5-1
Boolean Function Descriptions ....................................................................................... 5-2
Chapter 6
String Functions
Overview of Polymorphism for String Functions............................................................6-1
Polymorphism for String Functions ..................................................................6-1
Polymorphism for Additional String to Number Functions ..............................6-2
Polymorphism for String Conversion Functions...............................................6-2
Format Strings Overview.................................................................................................6-2
String Function Descriptions ...........................................................................................6-6
String Conversion Function Descriptions........................................................................6-18
String Fixed Constants.....................................................................................................6-20
Chapter 7
Array Functions
Array Function Overview ................................................................................................7-2
Out-of-Range Index Values...............................................................................7-3
Polymorphism for Array Functions .................................................................................7-3
Array Function Descriptions............................................................................................7-3
Chapter 8
Cluster Functions
Cluster Function Overview ..............................................................................................8-2
Polymorphism for Cluster Functions ...............................................................................8-3
Setting the Order of Cluster Elements...............................................................8-3
Cluster Function Descriptions .........................................................................................8-4
Chapter 9
Comparison Functions
Comparison Function Overview ......................................................................................9-1
Boolean Comparison .........................................................................................9-1
String Comparison.............................................................................................9-2
Numeric Comparison.........................................................................................9-2
Cluster Comparison ...........................................................................................9-2
Comparison Modes............................................................................................9-2
Character Comparison .......................................................................................9-4
Polymorphism for Comparison Functions .......................................................................9-5
Comparison Function Descriptions .................................................................................9-6
Chapter 10
Time, Dialog, and Error Functions
Time, Dialog, and Error Functions Overview ................................................................. 10-2
Timing Functions .............................................................................................. 10-2
Error Handling Overview.................................................................................. 10-3
Error I/O and the Error State Cluster.................................................. 10-4
Time and Dialog Function Descriptions.......................................................................... 10-6
Error Handling VI Descriptions ...................................................................................... 10-10
Chapter 11
File Functions
File I/O VI and Function Overview................................................................................. 11-2
High-Level File VIs .......................................................................................... 11-2
Low-Level File VIs and File Functions ............................................................ 11-2
Byte Stream and Datalog Files.......................................................................... 11-3
Flow-Through Parameters................................................................................. 11-4
Error I/O in File I/O Functions ......................................................................... 11-5
Permissions ....................................................................................................... 11-5
File I/O Function and VI Descriptions ............................................................................ 11-6
Binary File VI Descriptions............................................................................................. 11-12
Advanced File Function Descriptions ............................................................................. 11-14
Configuration File VIs..................................................................................................... 11-20
File Constants Descriptions............................................................................................. 11-26
Chapter 12
Application Control Functions
Application Control Functions ........................................................................................ 12-2
Help Function Descriptions............................................................................................. 12-7
Menu Functions ............................................................................................................... 12 -8
Chapter 13
Advanced Functions
Advanced Function Descriptions .................................................................................... 13-2
Data Manipulation Function Descriptions....................................................................... 13-4
Memory VI Descriptions................................................................................................. 13-7
Synchronization VIs ........................................................................................................ 13-8
Notification VIs ............................................................................................................... 13-8
Queue VIs........................................................................................................................ 13-11
Rendezvous VIs............................................................................................................... 13-14
Semaphore VIs.................................................................................................................13-16
Occurrence Function Descriptions...................................................................................13-19
PART II
Data Acquisition VIs
Chapter 14
Introduction to the LabVIEW Data Acquisition VIs
Finding Help Online for the DAQ VIs ............................................................................14-2
The Analog Input VIs ......................................................................................................14-3
Easy Analog Input VIs ......................................................................................14-4
Intermediate Analog Input VIs..........................................................................14-5
Analog Input Utility VIs....................................................................................14-5
Advanced Analog Input VIs..............................................................................14-5
Locating Analog Input VI Examples.................................................................14-5
Analog Output VIs...........................................................................................................14-6
Easy Analog Output VIs....................................................................................14-7
Intermediate Analog Output VIs .......................................................................14-7
Analog Output Utility VIs .................................................................................14-7
Advanced Analog Output VIs ...........................................................................14-8
Locating Analog Output VI Examples ..............................................................14-8
Digital Function VIs ........................................................................................................14-8
Easy Digital I/O VIs ..........................................................................................14-9
Intermediate Digital I/O VIs..............................................................................14-9
Advanced Digital I/O VIs..................................................................................14-10
Locating Digital I/O VI Examples ....................................................................14-10
Counter VIs......................................................................................................................14-10
Easy Counter VIs...............................................................................................14-11
Intermediate Counter Input VIs.........................................................................14-11
Advanced Counter VIs ......................................................................................14-12
Locating Counter VI Examples .........................................................................14-12
Calibration and Configuration VIs ..................................................................................14-12
Signal Conditioning VIs ..................................................................................................14-12
Chapter 15
Easy Analog Input VIs
Easy Analog Input VI Descriptions .................................................................................15-1
Chapter 16
Intermediate Analog Input VIs
Handling Errors ............................................................................................................... 16-1
Intermediate Analog Input VI Descriptions .................................................................... 16-2
Chapter 17
Analog Input Utility VIs
Handling Errors ............................................................................................................... 17-2
Analog Input Utility VI Descriptions .............................................................................. 17-2
Chapter 18
Advanced Analog Input VIs
Advanced Analog Input VI Descriptions ........................................................................ 18-1
Chapter 19
Easy Analog Output VIs
Easy Analog Output VI Descriptions .............................................................................. 19-1
Chapter 20
Intermediate Analog Output VIs
Handling Errors ............................................................................................................... 20-1
Analog Output VI Descriptions....................................................................................... 20-2
Chapter 21
Analog Output Utility VIs
Handling Errors ............................................................................................................... 21-1
Analog Output Utility VI Descriptions ........................................................................... 21-2
Chapter 22
Advanced Analog Output VIs
Advanced Analog Output VI Descriptions...................................................................... 22-1
Chapter 23
Easy Digital I/O VIs
Easy Digital I/O Descriptions.......................................................................................... 23-1
Chapter 24
Intermediate Digital I/O VIs
Handling Errors................................................................................................................24-2
Intermediate Digital I/O VI Descriptions ........................................................................24-2
Chapter 25
Advanced Digital I/O VIs
Digital Port VI Descriptions ............................................................................................25-2
Digital Group VI Descriptions.........................................................................................25-3
Chapter 26
Easy Counter VIs
Easy Counter VI Descriptions .........................................................................................26-2
Chapter 27
Intermediate Counter VIs
Handling Errors................................................................................................................27-2
Intermediate Counter VI Descriptions .............................................................................27-2
Chapter 28
Advanced Counter VIs
Advanced Counter VI Descriptions .................................................................................28-2
Chapter 29
Calibration and Configuration VIs
Calibration and Configuration VI Descriptions...............................................................29-2
Channel Configuration VIs ..............................................................................................29-18
Chapter 30
Signal Conditioning VIs
Signal Conditioning VI Descriptions...............................................................................30-2
PART III
Instrument I/O Functions and VIs
Chapter 31
Introduction to LabVIEW Instrument I/O VIs
Instrument Drivers Overview .......................................................................................... 31-2
Instrument Driver Distribution.......................................................................... 31-3
CD-ROM Instrument Driver Distribution .......................................... 31-3
Instrument Driver Template VIs ....................................................................... 31-4
Introduction to VISA Library.......................................................................................... 31-4
Introduction to GPIB ....................................................................................................... 31-5
LabVIEW Traditional GPIB Functions ............................................................ 31-5
GPIB 488.2 Functions....................................................................................... 31-5
Single-Device Functions..................................................................... 31-6
Multiple-Device Functions ................................................................. 31-6
Bus Management Functions ............................................................... 31-6
Low-Level Functions.......................................................................... 31-7
General Functions............................................................................... 31-7
Serial Port VI Overview .................................................................................................. 31-7
Chapter 32
Instrument Driver Template VIs
Introduction to Instrument Driver Template VIs............................................................. 32-1
Instrument Driver Template VI Descriptions.................................................................. 32-2
Chapter 33
VISA Library Reference
Operations........................................................................................................................ 33-2
VISA Library Reference Parameters ................................................................ 33-2
VISA Operation Descriptions.......................................................................................... 33-4
Event Handling Functions ............................................................................................... 33-10
High Level Register Access Functions............................................................................ 33-12
Low Level Register Access Functions ............................................................................ 33-16
VISA Serial Functions..................................................................................................... 33-18
VISA Property Node ....................................................................................................... 33-19
VISA Property Node Descriptions .................................................................................. 33-20
Fast Data Channel ............................................................................................. 33-20
General Settings ................................................................................................ 33-20
GPIB Settings.................................................................................................... 33-20
Interface Information ........................................................................................ 33-21
Chapter 34
Traditional GPIB Functions
Traditional GPIB Function Parameters............................................................................34-2
Traditional GPIB Function Behavior...............................................................................34-3
Traditional GPIB Function Descriptions .........................................................................34-3
GPIB Device and Controller Functions ...........................................................................34-7
Device Functions .............................................................................................................34 -7
Controller Functions ........................................................................................................34-9
Chapter 35
GPIB 488.2 Functions
GPIB 488.2 Common Function Parameters ....................................................................35-1
GPIB 488.2 Function Descriptions (Single-Device Functions).......................................35-2
GPIB 488.2 Multiple-Device Function Descriptions ......................................................35-4
GPIB 488.2 Bus Management Function Descriptions.....................................................35-6
GPIB 488.2 Low-Level I/O Function Descriptions.........................................................35-8
GPIB 488.2 General Function Descriptions ....................................................................35-10
Chapter 36
Serial Port VIs
Serial Port VI Descriptions ..............................................................................................36-1
PART IV
Analysis VIs
Chapter 37
Introduction to Analysis in LabVIEW
Full Development System................................................................................................37-2
Analysis VI Overview .....................................................................................................37-2
Chapter 38
Signal Generation VIs
Signal Generation VI Descriptions.................................................................................. 38-2
Chapter 39
Digital Signal Processing VIs
Signal Processing VI Descriptions .................................................................................. 39-2
Chapter 40
Measurement VIs
Measurement VI Descriptions......................................................................................... 40-2
Chapter 41
Filter VIs
Filter VI Descriptions ...................................................................................................... 41-2
Chapter 42
Window VIs
Window VI Descriptions................................................................................................. 42-2
Chapter 43
Curve Fitting VIs
Curve Fitting VI Descriptions ......................................................................................... 43-2
Chapter 44
Probability and Statistics VIs
Probability and Statistics VI Descriptions....................................................................... 44-2
Chapter 45
Linear Algebra VIs
Linear Algebra VI Descriptions ...................................................................................... 45-2
Chapter 46
Array Operation VIs
Array Operation VI Descriptions.....................................................................................46-2
Chapter 47
Additional Numerical Method VIs
Additional Numerical Method VI Descriptions...............................................................47-1
PART V
Communication VIs and Functions
Chapter 48
TCP VIs
TCP VI Description .........................................................................................................48-2
TCP/IP Functions.............................................................................................................48-2
Chapter 49
UDP VIs
UDP VI Descriptions .......................................................................................................49-1
Chapter 50
DDE VIs
DDE Client VI Descriptions ............................................................................................50-2
DDE Server VI Descriptions ...........................................................................................50-3
Chapter 51
ActiveX Automation Functions
ActiveX Automation Function Descriptions ...................................................................51-2
Data Conversion Function ...............................................................................................51-4
Chapter 52
AppleEvent VIs
General AppleEvent VI Behavior....................................................................................52-2
The User Identity Dialog Box ...........................................................................52-2
Target ID ...........................................................................................................52-3
Send Options .....................................................................................................52-4
Targeting VI Descriptions ...............................................................................................52-4
Chapter 53
Program to Program Communication VIs
PPC VI Descriptions ........................................................................................................53-2
Appendix A
Error Codes
Numeric Error Codes .......................................................................................................A-1
Appendix B
DAQ Hardware Capabilities
MIO and AI Device Hardware Capabilities.....................................................................B-1
Lab and 1200 Series and Portable Devices Hardware Capabilities.................................B-10
54xx Devices....................................................................................................................B-14
SCXI Module Hardware Capabilities ..............................................................................B-16
Analog Output Only Devices Hardware Capabilities......................................................B-20
Dynamic Signal Acquisition Devices Hardware Capabilities .........................................B-21
Digital Only Devices Hardware Capabilities...................................................................B-22
Timing Only Devices Hardware Capabilities ..................................................................B-23
5102 Devices Hardware Capabilities...............................................................................B-24
Appendix C
GPIB Multiline Interface Messages
Multiline Interface Messages...........................................................................................C-1
Message Definitions ..........................................................................................C-6
Appendix D
Customer Communication
Index
Figures
Figure 27-1. Setup Mode in ICTR Control.................................................................. 27-5
Figure 27-2. Setup Mode 1 in ICTR Control............................................................... 27-6
Figure 27-3. Setup Mode 2 in ICTR Control............................................................... 27-6
Figure 27-4. Setup Mode 3 in ICTR Control............................................................... 27-6
Figure 27-5. Setup Mode 4 in ICTR Control............................................................... 27-6
Figure 27-6. Setup Mode 5 in ICTR Control............................................................... 27-7
Tables
Table 6-1. Special Escape Codes ............................................................................. 6-3
Table 6-2. String Syntax........................................................................................... 6-4
Table 6-3. Possible Format into String Errors.......................................................... 6-7
Table 6-4. Format Specifiers .................................................................................... 6-7
Table 6-5. Special Characters for Match Pattern ..................................................... 6-9
Table 6-6. Strings for the Match Pattern Examples ................................................. 6-10
Table 25-1. Device Specific Parameters and Legal Ranges for Devices....................25-6
Table 28-1. Counter Chips and Their Available DAQ Devices .................................28-2
Table 28-2. Valid Counter Numbers for CTR Group Config Devices.......................28-3
Table 28-3. Adjacent Counters ...................................................................................28-9
This manual is a supplement to the LabVIEW User Manual and you should
be familiar with that material.
<> Angle brackets enclose the name of a key on the keyboard — for example,
<shift>. Angle brackets containing numbers separated by an ellipsis
represent a range of values associated with a bit or signal name —
for example, DBIO<3..0>.
» The » symbol leads you through nested menu items and dialog box options
to a final action. The sequence File»Page Setup»Options»Substitute
Fonts directs you to pull down the File menu, select the Page Setup item,
select Options, and finally select the Substitute Fonts options from the
last dialog box.
bold Bold text denotes the names of menus, menu items, parameters, dialog
boxes, dialog box buttons or options, icons, windows, Windows 95 tabs,
or LEDs.
bold italic Bold italic text denotes an activity objective, note, caution, or warning.
italic monospace Italic text in this font denotes that you must supply the appropriate words
or values in the place of these items.
monospace Text in this font denotes text or characters that you should literally enter
from the keyboard, sections of code, programming examples, and syntax
examples. This font is also used for the proper names of disk drives, paths,
directories, programs, subprograms, subroutines, device names, functions,
operations, variables, filenames and extensions, and for statements and
comments taken from programs.
monospace bold Bold text in this font denotes the messages and responses that the computer
automatically prints to the screen. This font also emphasizes lines of code
that are different from the other examples.
paths Paths in this manual are denoted using backslashes (\) to separate drive
names, directories, folders, and files.
Related Documentation
You might find the following documentation helpful as you read this
manual:
• LabVIEW User Manual
• G Programming Reference Manual
• LabVIEW Data Acquisition Basics Manual
• LabVIEW QuickStart Guide
• LabVIEW Online Reference, available by selecting
Help»Online Reference
• LabVIEW Online Tutorial (Windows only), which you launch from
the LabVIEW dialog box.
• LabVIEW Getting Started Card
• G Programming Quick Reference Card
• LabVIEW Release Notes
• LabVIEW Upgrade Notes
Customer Communication
National Instruments wants to receive your comments on our products
and manuals. We are interested in the applications you develop with our
products, and we want to help if you have problems with them. To make it
easy for you to contact us, this manual contains comment and configuration
forms for you to complete. These forms are in Appendix D, Customer
Communication, at the end of this manual.
The development system includes collections of VIs that work with your
G programming language, data acquisition (DAQ) hardware devices,
instrument devices, and other communication interfaces.
You select functions from the Functions palette in the block diagram.
When the block diagram window is active, select Windows»
Show Functions Palette. You also can access the Functions palette by
popping up on the area in the block diagram window where you want to
place the function.
The following illustration shows the functions and VIs available from the
Functions palette.
Select a VI
Structures
G Structures include While Loop, For Loop, Case, and Sequence
structures. This palette also contains the global and local variable nodes,
and the formula node.
Numeric Functions
Numeric functions perform arithmetic operations, conversions,
trigonometric, logarithmic, and complex mathematical functions. This
palette also contains additional numeric constants, such as π.
Boolean Functions
Boolean functions perform Boolean and logical operations.
String Functions
String functions manipulate strings and convert numbers to and from
strings. This palette also includes Additional String To Number functions
and String Conversion functions.
Array Functions
Array functions assemble, disassemble, and process arrays.
Cluster Functions
Cluster functions assemble, access, and change elements in a cluster.
Comparison Functions
Comparison functions compare data (greater than, less than, and so on) and
operations that are based on a comparison, such as finding the minimum
and maximum ranges for a group or array of values.
Advanced Functions
Advanced functions are functions that are highly specialized. The Code
Interface Node is an example of an advanced function. The Advanced
palette also contains Data Manipulation functions and Occurrences
functions.
DAQ
DAQ VIs acquire and generate real-time analog and digital data as well as
perform counting operations. See Chapter 14, Introduction to the LabVIEW
Data Acquisition VIs, for more information.
Instrument I/O
Instrument I/O VIs communicate with instruments using GPIB, VISA, or
serial communication. See Chapter 31, Introduction to LabVIEW
Instrument I/O VIs, for more information.
Communication
Communication VIs network to other applications using TCP/IP, DDE,
ActiveX, Apple Events, PPC, or UDP. See Chapter 48, TCP VIs, through
Chapter 53, Program to Program Communication VIs, for more
information.
Analysis VIs
Analysis VIs perform measurement, signal generation, digital signal
processing, filtering, windowing, probability and statistics, curve fitting,
linear algebra, array operations, and VIs which perform additional
numerical methods. See Chapter 37, Introduction to Analysis in LabVIEW,
for more information.
Select A VI...
The Select a VI... allows you to select any VI using a file dialog box and
then place it on a diagram.
Tutorial
The Tutorial VIs provide examples for you to use while working through
the LabVIEW User Manual.
User Library
The User Library palette automatically includes any VIs in your
user.lib directory, making it more convenient to gain access to
commonly used sub-VIs you have written.
Application Control
The Application Control palette includes the Help functions, Menu
functions, Print VIs, and VI Server VIs.
VIs are “virtual instruments,” so called because they model the appearance
functions of a physical instrument.
You select G Functions from the Functions palette, in the block diagram.
When the block diagram window is active, you can display the Functions
palette by selecting Windows»Show Functions Palette. You also can
access the Functions palette by popping up on the area in the block
diagram window where you want to place the function.
The following illustration shows the G functions and VIs available on the
Functions palette.
G Functions Overview
For brief descriptions of each of the eleven G Function and VI palettes
available, refer to Chapter 1, Introduction to the G Functions and VIs.
Introduction to Polymorphism
The following sections provide some general information about
polymorphism in G functions.
Polymorphism
Polymorphism is the ability of a function to adjust to input data of different
types or representations. Most functions are polymorphic. VIs are not
polymorphic. All functions that take numeric input can accept any numeric
Unit Polymorphism
If you want to create a VI that computes the root, mean square value of a
waveform, you have to define the unit associated with the waveform.
You would need a separate VI for voltage waveforms, current waveforms,
temperature waveforms, and so on. LabVIEW has polymorphic unit
capability so that one VI can perform the same calculation, regardless of
the units received by the inputs.
You can use $1 in combinations just like any other unit. For example, if the
input is multiplied by 3 seconds and then wired to an indicator, the indicator
must be $1 s units. If the indicator has different units, the block diagram
shows a bad wire. If you need to use more than one polymorphic unit, you
can use the abbreviations $2, $3, and so on.
Numeric Conversion
You can convert any numeric representation to any other numeric
representation. When you wire two or more numeric inputs of different
representations to a function, the function usually returns output in the
larger or wider format. The functions coerce the smaller representations to
the widest representation before execution.
The block diagram places a coercion dot on the border of a terminal where
the conversion takes place to indicate that automatic numeric conversion
occurred, as in the following example.
Because VIs and functions can have many terminals, a coercion dot can
appear inside an icon if the wire crosses an internal terminal boundary
before it leaves the icon/connector, as the following illustration shows.
Moving a wired icon stretches the wire. Coercion dots can cause a VI to use
more memory and increase its execution time. You should try to keep data
types consistent in your VIs.
Wire Styles
The wire style represents the data type for each terminal, as the following
table shows. Polymorphic functions show the wire style for the most
commonly used data type.
Structures Overview
The following Structures are available in G.
Case Structure
Has one or more subdiagrams, or cases, exactly one of which executes when the structure
executes. Whether it executes depends on the value of the Boolean, string, or numeric scalar
you wire to the external side of the terminal or selector.
For more information on how to use the Case structure in LabVIEW, see Chapter 4, Case and
Sequence Structures and the Formula Node, in the LabVIEW User Manual.
Sequence Structure
Consists of one or more subdiagrams, or frames, that execute sequentially. As an option, you
can add sequence locals that allow you to pass information from one frame to subsequent
frames by popping up on the edge of the structure.
For more information on how to use the Sequence structure in LabVIEW, see Chapter 4,
Case and Sequence Structures and the Formula Node, in the LabVIEW User Manual.
For Loop
Executes its subdiagram n times, where n equals the value contained in the count terminal.
As an option, you can add shift registers so that you can pass information from one iteration
to the next by popping up on the edge of the structure.
For more information on how to use For Loop in LabVIEW, see Chapter 3, Loops and Charts,
in the LabVIEW User Manual.
While Loop
Executes its subdiagram until a Boolean value you wire to the conditional terminal is FALSE.
As an option, you can add shift registers so you can pass information from one iteration to the
next by popping up on the edge of the structure.
For more information on how to use While Loop in LabVIEW, see Chapter 3, Loops and
Charts, in the LabVIEW User Manual.
Formula Node
Executes mathematical formulae on the block diagram.
For more information on the Formula Node, see Chapter 4, Case and Sequence Structures and
the Formula Node, in the LabVIEW User Manual.
Global Variable
A built-in LabVIEW object that you define by creating a special kind of VI, with front panel
controls that define the datatype of the global variable. You can read and write values to the
global variable.
For more information on the Global Variable, see Chapter 23, Global and Local Variables,
in the G Programming Reference Manual.
Local Variable
Lets you read or write to one of the controls or indicators on the front panel of your VI.
Writing to a local variable has the same result as passing data to a terminal, except that you
can write to it even though it is a control, or read from it even though it is an indicator.
For more information on the Local Variable, see Chapter 23, Global and Local Variables, in
the G Programming Reference Manual.
Arrays can have any number of dimensions of any size. Clusters can have
any number of elements. For functions with one input, the functions operate
on each element of the structure.
For functions with two inputs, you can use the following input
combinations:
• Similar—both inputs have the same structure, and the output has the
same structure as the inputs.
• One scalar—one input is a numeric scalar, the other is an array or
cluster, and the output is an array or cluster.
• Array of—one input is a numeric array, the other is the numeric type
itself, and the output is an array.
Note You cannot use the multiply function to do matrix multiplication. If you use the
multiply function with two matrices, G takes the first number in the first row of the
first matrix, multiplies it by the first number in the first row of the second matrix,
and so on.
For operations that involve a numeric type and an array of that type,
G performs the function on each array element. For example, a graph is an
array of points, and a point is a cluster of two numeric types, x and y. To
offset a graph by 5 units in the x direction and 8 units in the y direction, you
can add a point, (5, 8), to the graph.
When you compare signed and unsigned integers and the signed integer is
negative, the negative integer is changed to positive before the comparison
occurs. Therefore, you do not get the expected results. For example, if you
enter –1 with representation I32 for one input and 5 with a representation
U32 as the other input, the result returned states that the minimum value
is 5, because 5 is less than 4294967295.
Absolute Value
Returns the absolute value of the input.
Add
Computes the sum of the inputs.
Compound Arithmetic
Performs arithmetic on two or more numeric, cluster, or Boolean inputs.
You select the operation (multiply, AND, or OR) by popping up on the function and selecting
Change Mode.
You can invert the inputs or the output of this function by popping up on the individual
terminals, and selecting Invert. For Add, select Invert to negate an input or the output. For
Multiply, select Invert to use the reciprocal of an input or to produce the reciprocal of the
output. For AND or OR, select Invert to logically negate an input or the output.
Note You add inputs to this node by popping up on an input and selecting Add Input or
by placing the Positioning tool in the lower left or right corner of the node and
dragging it.
Decrement
Subtracts 1 from the input value.
Divide
Computes the quotient of the inputs.
Increment
Adds 1 to the input value.
Multiply
Returns the product of the inputs.
Negate
Negates the input value.
If the integer input value of y is zero, the quotient is zero and the remainder is dividend x. For
floating point inputs, if y is zero, the quotient is infinity and the remainder defaults to NaN.
Reciprocal
Divides 1 by the input value.
Round To +Infinity
Rounds the input to the next highest integer. For example, if the input is 3.1, the result is 4.
If the input is –3.1, the result is –3.
Round To –Infinity
Rounds the input to the next lowest integer. For example, if the input is 3.8, the result is 3.
If the input is –3.8, the result is –4.
Round To Nearest
Rounds the input to the nearest integer. If the value of the input is midway between two
integers (for example, 1.5 or 2.5), the function returns the nearest even integer (2).
Scale By Power Of 2
Multiplies one input (x) by 2 raised to the power of the other input (n). If n is a floating-point
number, this function rounds n prior to scaling x (0.5 rounds to 0; 0.51 rounds to 1). If x is an
integer, this function is the equivalent of an arithmetic shift.
Sign
Returns 1 if the input value is greater than 0, returns 0 if the input value is equal to 0, and
returns –1 if the input value is less than 0. Other programming languages typically call this
function the signum or sgn function.
Square Root
Computes the square root of the input value. If x is negative, the square root is NaN unless
x is complex.
Subtract
Computes the difference of the inputs.
Numeric Constant
Use this constant to supply a constant numeric value to the block diagram. Set this value by
clicking in the constant with the Operating tool and typing a value. You can change the data
format and representation.
The value of the numeric constant cannot be changed while the VI executes. You can assign
a label to this constant.
Enumerated Constant
Enumerated values associate unsigned integers to strings. If you display a value from an
enumerated constant, the string is displayed, instead of the number associated with it. If you
need a set of strings that do not change, then use this constant. Set the value by clicking in the
constant with the Operating Tool. Set the string with the Labeling Tool and enter the string.
To add another item, click the constant and choose Add Item Before or Add Item After.
The value of the enumerated constant cannot be changed while the VI executes. You can
assign a label to this constant.
Ring Constant
Rings associate unsigned integers to strings. If you display a value from a ring constant, the
number is displayed, instead of the string associated with it. If you need a set of strings that
do not change, then use this constant. Set the value by clicking the constant with the Operating
tool. Set the string with the Labeling tool and enter the string. To add another item, pop up on
the constant and choose Add Item Before or Add Item After.
The value of the Ring constant cannot be changed while the VI executes. You can assign a
label to this constant.
When these functions convert a floating-point number to an integer, they round the output to
the nearest integer, or the nearest even integer if the fractional part is 0.5. If the result is out
of range for the integer, these functions return the minimum or maximum value for the integer
type. When these functions convert an integer to a smaller integer, they copy the
least-significant bits without checking for overflow. When they convert an integer to a larger
integer, they extend the sign of a signed integer and pad an unsigned integer with zeros.
Use caution when you convert numbers to smaller representations, particularly when
converting integers, because the G conversion routines do not check for overflow.
Boolean To (0,1)
Converts a Boolean value to a word integer— 0 and 1 for the input values FALSE and TRUE,
respectively.
Convert Unit
Converts a physical number (a number that has a unit) to a pure number (a number with no
units), or a pure number to a physical number.
You can edit the string inside the unit by highlighting the string with the Operating tool then
entering the text.
If the input is a pure number, the output receives the specified units. For example, given an
input of 13 and a unit specification of seconds(s), the resulting value is 13 seconds.
If the input is a physical number and unit is a compatible unit, the output is the input measured
in the specified units. For example, if you specify 37 meters(m), and unit is meters, the result
is 37 with no associated units. If unit is feet (ft), the result is 121.36 with no associated units.
To Byte Integer
Converts number to an 8-bit integer in the range –128 to 127.
To Long Integer
Converts number to a 32-bit integer in the range –231 to 231 –1
To Word Integer
Converts number to a 16-bit integer in the range –32,768 to 32,767.
Cosecant
Computes the cosecant of x, where x is in radians. Cosecant is the reciprocal of sine.
Cosine
Computes the cosine of x, where x is in radians.
Cotangent
Computes the cotangent of x, where x is in radians. Cotangent is the reciprocal of tangent.
Hyperbolic Cosine
Computes the hyperbolic cosine of x.
Hyperbolic Sine
Computes the hyperbolic sine of x.
Hyperbolic Tangent
Computes the hyperbolic tangent of x.
Inverse Cosine
Computes the arccosine of x in radians. If x is not complex and is less than –1 or greater
than 1, the result is NaN.
Inverse Sine
Computes the arcsine of x in radians. If x is not complex and is less than –1 or greater than 1,
the result is NaN.
Inverse Tangent
Computes the arctangent of x in radians (which can be between –π/2 and π/2).
Secant
Computes the secant of x, where x is in radians.
Sinc
Computes the sine of x divided by x, where x is in radians.
Sine
Computes the sine of x, where x is in radians.
Tangent
Computes the tangent of x, where x is in radians.
Exponential
Computes the value of e raised to the x power.
Exponential (Arg) –1
Computes 1 less than the value of e raised to the x power. When x is very small, this function
is more accurate than using the Exponential function then subtracting 1 from the output.
Logarithm Base 2
Computes the base-2 logarithm of x. If x is 0, log2(x) is –∞. If x is not complex and is less
than 0, log2(x) is NaN.
Logarithm Base 10
Computes the base-10 logarithm of x. If x is 0, log(x) is –∞. If x is not complex and is less
than 0, log(x) is NaN.
Logarithm Base X
Computes the base x logarithm of y (x>0, y>0). If y is 0, the output is –∞. When x and y are
both not complex and x is less than or equal to 0, or y is less than 0, the output is NaN.
Natural Logarithm
Computes the natural base e logarithm of x. If x is 0, ln(x) is –∞. If x is not complex and is
less than 0, ln(x) is NaN.
Power Of 2
Computes 2 raised to the x power.
Power Of 10
Computes 10 raised to the x power.
Power Of X
Computes x raised to the y power. If x is not complex, it must be greater than zero unless y is
an integer value. Otherwise, the result is NaN. If y is zero, x^y is 1 for all values of x,
including zero.
The functions Polar To Complex and Re/Im To Complex create complex numbers from two
values given in rectangular or polar notation. The functions Complex To Polar and Complex
To Re/Im break a complex number into its rectangular or polar components.
Complex Conjugate
Produces the complex conjugate of x + iy.
Complex To Polar
Breaks a complex number into its polar components.
Complex To Re/Im
Breaks a complex number into its rectangular components.
Polar To Complex
Creates a complex number from two values in polar notation.
Re/Im To Complex
Creates a complex number from two values in rectangular notation.
The value of the Color Box constant cannot be changed while the VI executes. You can assign
a label to this constant.
Fixed Constants
The following constants are fixed.
Base 10 Logarithm of e
Returns the value 0.43429448190325183.
e
Returns the value 2.7182818284590452e+0.
Natural Logarithm of Pi
Returns the value 1.14472988584940020.
Natural Logarithm of 2
Returns the value 0.69314718055994531.
Natural Logarithm of 10
Returns the value 2.30234095236904570.
Negative Infinity
Returns the value –∞.
Pi
Returns the value 3.14159265358979320.
Pi divided by 2
Returns the value 1.57079632679489660.
Pi multiplied by 2
Returns the value 6.28318530717958650.
Positive Infinity
Returns the value ∞.
Reciprocal of e
Returns the value 0.36787944117144232.
Reciprocal of Pi
Returns the value 0.31830988618379067.
The following illustration shows the Boolean palette, which you access by
selecting Functions»Boolean.
Logical functions with two inputs can have the same input combinations as
the arithmetic functions. However, the logical functions have the further
restriction that the base operations can only be between two Boolean values
or two numbers. For example, you cannot have an AND between a Boolean
value and a number. See the example below for an illustration of some
combinations of Boolean values for the And function.
And
Computes the logical AND of the inputs.
Boolean To (0,1)
Converts a Boolean value to a word integer — 0 and 1 for the input values FALSE and TRUE,
respectively.
Compound Arithmetic
Performs arithmetic on two or more numeric, cluster, or Boolean inputs.
You choose the operation (multiply, AND, or OR) by popping up on the function and selecting
Change Mode.
You can invert the inputs or the output of this function by popping up on the individual
terminals and selecting Invert. For Add, select Invert to negate an input or the output. For
Multiply, select Invert to use the reciprocal of an input or to produce the reciprocal of the
output. For AND or OR, select Invert to logically negate an input or the output.
Note You add inputs to this node by popping up on an input and selecting Add Input or
by placing the Positioning tool in the lower left or right corner of the node and
dragging it.
Exclusive Or
Computes the logical exclusive OR of the inputs.
Implies
Computes the logical OR of y and of the logical negation of x. The function negates x then
computes the logical OR of y and of the negated x.
Not
Computes the logical negation of the input.
Not And
Computes the logical NAND of the inputs.
Not Exclusive Or
Computes the logical negation of the logical exclusive OR of the inputs.
Not Or
Computes the logical NOR of the inputs.
Or
Computes the logical OR of the inputs.
Or Array Elements
Returns FALSE if all the elements in Boolean array are false; otherwise it returns TRUE.
Boolean Constant
Use this function to supply a constant TRUE/FALSE value to the block diagram. Set this
value by clicking the T or F portion of the constant with the Operating tool. This value cannot
be changed while the VI executes. You can assign a label to this constant.
The following illustration shows the String palette, which you access by
selecting Functions»String.
Table 6-1 displays the special escape codes. A code does not exist for the
platform-dependent end-of-line (EOL) character. If you need to append
one, use the End-of-Line constant from the String palette.
Code Meaning
\r Carriage Return
\t Tab
\b Backspace
\n Newline
\f Form Feed
\s space
\xx character with hexadecimal ASCII code xx
(using 0 through 9 and upper case A through F)
\\ \
%% %
Notice that for the Scan From String and Format & Strip functions, a space
in the format string matches any amount of whitespace (spaces, tabs, and
form feeds) in the input string.
The Format & Append, Format & Strip, Array To Spreadsheet String, and
Spreadsheet String To Array functions use only one format specifier in the
format string because these functions have only one input that can be
converted. Any extraneous specifiers inserted into these functions are
treated as literal strings with no special meaning.
For functions that produce a string as output, such as Format Into String,
Format & Append, and Array To Spreadsheet String, a format specifier has
the following syntax. Double brackets ( [] ) enclose optional elements.
%[–][+][^][0][Width][.Precision][{unit}]Conversion Code
For functions that scan a string, such as Scan From String, Format & Strip,
and Spreadsheet String to Array, a format specifier has the following,
simplified syntax:
%[Width]Conversion Code
For complex numbers, you can use the format specifier to process both the
real and imaginary parts as a single parameter.
You can use the s conversion code to process string or path parameters or
enums.
Notice that you can use either a numeric or string conversion code with an
enum, depending on whether you want the numeric value or symbolic
(string) value of the enum.
For examples of format string usage, see the Format Into String and Scan
From String function descriptions later in this chapter.
Concatenate Strings
Concatenates input strings and one-dimensional arrays of strings into a single, output string.
For array inputs, this function concatenates each element of the array.
Table 6-3 shows the errors that can appear in error out by the Format Into String function.
Note If an error occurs, the source component of the error out cluster contains a string
of the form “Format Into String (arg n),” where n is the first argument
for which the error occurred.
If you wire a block diagram constant string to format string, G checks for errors in format
string at compile time. You must correct these errors before you can run the VI. In this case,
no errors can occur at run time.
The last table entry shows the output when the unit in the format specifier is in conflict with
the input unit.
Match Pattern
Searches for regular expression in string beginning at offset, and if it finds a match, splits
string into three substrings.
\b backspace
\f form feed
\n newline
\s space
\r carriage return
\xx any character, where xx is the hex code using 0 through 9
and upper case A through F
\t tab
^ If ^ is the first character of regular expression, it anchors the match
to the offset in string. The match fails unless regular expression
matches that portion of string that begins with the character at
offset. If ^ is not the first character, it is treated as a regular
character.
[ ] Encloses alternates. For example, [abc] matches a, b, or c.
The following character has special significance when used within
the brackets:
– (dash) Indicates a range when used between digits, or lowercase
or uppercase letters (for example, [0–5],[a–g], or [L–Q])
The following characters have significance only when they are the
first character within the brackets:
~ Excludes the set of characters, including nondisplayable
characters. [~0–9] matches any character other than 0 through 9.
^ Excludes the set with respect to all the displayable characters
(and the space characters). [^0–9] gives the space characters and all
displayable characters except 0 through 9.
Table 6-6 shows examples of the Strings for the Match Pattern functions.
Reverse String
Produces a string whose characters are in reverse order of those in string.
Rotate String
Places the first character of string in the last position of first char last, shifting the other
characters forward one position. For example, the string abcd becomes bcda.
Use Scan From String when you know the exact format of the input string.
Note If an error occurs, the source component of the error out cluster contains a string
of the form “Scan From String (arg n),” where n is the first argument for
which the error occurred.
If you wire a block diagram constant string to format string, G checks for errors in format
string at compile time. You must correct these errors before you can run the VI. In this case,
only the Scan-failed error can occur at run time.
Format Remaining
Input String String Default(s) Output(s) String
abc xyz %s — abc 00
12.3+56i 7200 %s%f%2d — xyz
0&0i (CDB) 12.3+56i
— 72
Q+1.27E–3 tail Q%f t — 1.27E–3 ail
Format Remaining
Input String String Default(s) Output(s) String
0123456789 %3d%3d — 12 6789
345
X:9.860 Z:3.450 X:%fY:%f 100 (I32) 10 Z: 3450
100.0 (DBL) 100.0
set49.4.2 set%d — 49 .4.2
See the online reference for more information about the Scan String for Tokens function and
parameters.
Split String
Splits the string at offset or searches for the first occurrence of search char in string,
beginning at offset, and splits the string at that point.
String Length
Returns in length the number of characters (bytes) in string.
String Subset
Returns substring of the original string beginning at offset and containing length number of
characters.
To Lower Case
Converts all alphabetic characters in string to lowercase characters. This function does not
affect non-alphabetic characters.
To Upper Case
Converts all alphabetic characters in string to uppercase characters. This function does not
affect non-alphabetic characters.
The following illustration displays the options available on the Additional String to Number
Functions subpalette.
Note The Format Into String function has the same functionality as Format & Append
but can use multiple inputs, so you can convert information simultaneously.
Consider using Format Into String instead of this function to simplify your block
diagram.
From Decimal
Converts the numeric characters in string, starting at offset, to a decimal integer and returns
it in number.
From Exponential/Fract/Eng
Interprets the characters 0 through 9, plus, minus, e, E, and the decimal point (usually period)
in string starting at offset as a floating-point number in engineering notation, or exponential
or fractional format and returns it in number.
Note If you wire the characters Inf or NaN to string, this function returns the G values
Inf and NaN, respectively.
From Hexadecimal
Interprets the characters 0 through 9, A through F, and a through f in string starting at offset
as a hex integer and returns it in number.
From Octal
Interprets the characters 0 through 7 in string starting at offset as an octal integer and returns
it in number. This function also returns the index in string of the first character following the
number.
To Decimal
Converts number to a string of decimal digits width characters wide, or wider if necessary.
To Engineering
Converts number to an engineering format, floating-point string width characters wide, or
wider if necessary. Engineering format is similar to E format, except the exponent is a
multiple of three (–3, 0, 3, 6).
To Exponential
Converts number to an E-format (exponential notation), floating-point string width
characters wide, or wider if necessary.
To Fractional
Converts number to an F-format (fractional notation), floating-point string width characters
wide, or wider if necessary.
To Hexadecimal
Converts number to a string of hexadecimal digits width characters wide, or wider if
necessary.
To Octal
Converts number to a string of octal digits width characters wide, or wider if necessary.
Array Of Strings To Path accepts one-dimensional (1D) arrays of strings, Path To Array Of
Strings accepts paths, Path To String accepts paths, and String To Path accepts strings.
If you have an empty string in the array, the directory location before the empty string is
deleted in the path output. Think of this change as moving up a level in directory hierarchy.
Path To String
Converts path into a string describing a path in the standard format of the platform.
Refnum To Path
Returns the path associated with the specified refnum.
String To Path
Converts a string, describing a path in the standard format for the current platform, to a path.
String Constant
Use this constant to supply a constant ASCII string to the block diagram. Set this string by
clicking the constant with the Operating tool and typing the value. You can change the display
mode so you can see non-displayable characters or the hex equivalent to the characters.
You also can set the constant in password display mode so asterisks are displayed when you
type characters.
The value of the string constant cannot be changed while the VI executes. You can assign a
label to this constant.
Carriage Return
Consists of a constant string containing the ASCII CR value.
Empty String
Consists of a constant string that is empty. Length is zero.
End of Line
Consists of a constant string containing the platform-dependent, end-of-line value. For
Windows, the value is CRLF; for Macintosh, the value is CR; and for UNIX, the value is LF.
Line Feed
Consists of a constant string containing the ASCII LF value.
Tab
Consists of a constant string containing the ASCII HT (horizontal tab) value.
The following illustration shows the Array palette, which you access by
selecting Functions»Array.
Some of the array functions also are available from the Array Tools palette
of most terminal or wire pop-up menus. The illustration below shows this
pop-up menu.
If you select functions from this palette, they appear with the correct
number of terminals to wire to the object on which you popped up.
You can shrink the node if doing so does not delete wired terminals.
The Add Element Input or Add Array Input command inserts a terminal
directly after the one on which you popped up. The Remove Input
command removes the terminal on which you popped up, even if it is wired.
The following illustration shows the two ways to add more terminals to the
Build Array function.
If a numeric array has one dimension, the max index and min index outputs are scalar
integers. If a numeric array has more than one dimension, these outputs are 1D arrays that
contain the indices of the maximum and minimum values.
The function compares each datatype according to the rules referred to in Chapter 9,
Comparison Functions.
Array Size
Returns the number of elements in each dimension of array.
Array Subset
Returns a portion of array starting at index and containing length elements.
Array To Cluster
Converts a 1D array to a cluster of elements of the same type as the array elements. Pop up
on the node to set the number of elements in the cluster. The default is nine. The maximum
cluster size for this function is 256.
Build Array
Appends any number of array or element inputs in top-to-bottom order to create array with
appended element.
To change an element input to an array input, pop up on the input and select Change to Array.
In general, to build an array of n-dimensions, each array input must be of the same
dimension, n, and each element input must have n – 1 dimensions. To create a 1D array,
connect scalar values to the element inputs and 1D arrays to the array inputs. To build a
2D array, connect 1D arrays to element inputs and 2D arrays to the array inputs.
Cluster To Array
Converts a cluster of identically typed components to a 1D array of elements of the same type.
Decimate 1D Array
Divides the elements of array into the output arrays.
Index Array
Returns the element of array at index. If array is multidimensional, you must add additional
index terminals for each dimension of array.
In addition to extracting an element of the array, you can slice out a higher-dimensional
component by disabling one or more of the index terminals.
Initialize Array
Creates an n-dimensional array in which every element is initialized to the value of element.
Interleave 1D Arrays
Interleaves corresponding elements from the input arrays into a single output array.
Interpolate 1D Array
Uses the integer part of fractional index or x to index the array and the fractional part of
fractional index or x to linearly interpolate between the values of the indexed element and
its adjacent element.
Reshape Array
Changes the dimension of an array according to the value of dimension size. The function is
resizable; m-dim array has one dimension for each dimension size input. For example, you
can use this function to change a 1D array into a 2D array or vice versa. You also can use it
to increase and decrease the size of a 1D array.
Reverse 1D Array
Reverses the order of the elements in array.
Rotate 1D Array
Rotates the elements of array by the number of places and in the direction indicated by n.
Search 1D Array
Searches for element in 1D array starting at start index.
Sort 1D Array
Returns a sorted version of array with the elements arranged in ascending order. The rules
for comparing each datatype are described in Chapter 9, Comparison Functions.
Split 1D Array
Divides array at index and returns the two portions.
Threshold 1D Array
Compares threshold y to the values in array of numbers or points starting at start index
until it finds a pair of consecutive elements such that threshold y is greater than the value of
the first element and less than or equal to the value of the second element.
The function then calculates the fractional distance between the first value and threshold y
and returns the fractional index at which threshold y would be placed within array of
numbers or points using linear interpolation.
For example, suppose array of numbers or points is an array of four numbers [4, 5, 5, 6],
start index is 0, and threshold y is 5. The fractional index or x is 1, corresponding to the
index of the first value of 5 the function finds. Suppose the array elements are 6, 5, 5, 7, 6, 6,
the start index is 0, and the threshold y is 6 or less. The output is 0. If threshold y is greater
than 7 for the same set of numbers, the output is 5. If threshold y is 14.2, start index is 5,
and the values in the array starting at index 5 are 9.1, 10.3, 12.9, and 15.5, threshold y falls
between elements 7 and 8 because 14.2 is midway between 12.9 and 15.5. The value for
fractional index or x is 7.5, that is, halfway between 7 and 8.
If the array input consists of an array of points where each point is a cluster of x and y
coordinates, the output is the interpolated x value corresponding to the interpolated position
of threshold y rather than the fractional index of the array. If the interpolated position of
threshold y is midway between indices 4 and 5 of the array with x values of –2.5 and 0
respectively, the output is not an index value of 4.5 as it would be for a numeric array, but
rather an x value of –1.25.
Transpose 2D Array
Rearranges the elements of 2D array such that 2D array[i,j] becomes transposed array[j,i].
The following illustration shows the Cluster palette that you access by
selecting Functions»Cluster.
Some of the cluster functions also are available from the Cluster Tools
palette of most terminal or wire pop-up menus. The following illustration
shows the pop-up menu.
If you select the functions from this palette, they appear with the correct
number of terminals to wire to the object on which you popped up.
You can shrink the node if doing so does not delete wired terminals.
The Add Input option inserts a terminal directly after the one on which
you popped up. The Remove Input option removes the terminal on which
you popped up, even if it is wired.
The following illustration shows the two ways to add more terminals to the
Bundle function.
Clicking an element with the cluster order cursor sets the place of the
element in the cluster order to the number displayed inside the Tools
palette. You change this order by typing a new number into that field.
When the order is as you want it, click the Enter button to set it and exit
the cluster order edit mode. Click the X button to revert to the old order.
The cluster order determines the order in which the elements appear as
terminals on the Bundle and Unbundle functions in the block diagram.
The Bundle By Name and Unbundle By Name functions give you more
flexible access to data in clusters. With these functions, you can access
specific elements in clusters by name and access only the elements you
want to access. Because these functions reference components by name and
not by cluster position, you can change the data structure of a cluster
without breaking wires, as long as you do not change the name of or remove
the component you reference on the block diagram.
Array To Cluster
Converts a 1D array to a cluster of elements of the same type as the array elements. Pop up
on the node or resize it to set the number of elements in the cluster. The default is nine.
The maximum cluster size for this function is 256.
Bundle
Assembles all the individual input components into a single cluster.
Bundle By Name
Replaces components in an existing cluster. After you wire the node to a cluster, you pop up
on the name terminals to choose from the list of components of the cluster.
You must always wire the cluster input. If you are creating a cluster for a cluster indicator,
you can wire a local variable of that indicator to the cluster input. If you are creating a cluster
for a cluster control of a subVI, you can place a copy of that control (possibly hidden) on the
front panel of the VI and wire the control to the cluster input.
Cluster To Array
Converts a cluster of identically typed components to a 1D array of elements of the same type.
This function is equivalent to the following block diagram and is useful for converting a
cluster of arrays to an array of clusters.
Unbundle
Disassembles a cluster into its individual components.
Unbundle By Name
Returns the cluster elements whose names you specify. You select the element you want to
access by popping up on the name output terminals and selecting a name from the list of
elements in the cluster.
The following illustration shows the Comparison palette that you access
by selecting Functions»Comparison.
Boolean Comparison
The Comparison functions treat the Boolean value TRUE as greater than
the Boolean value FALSE.
String Comparison
These functions compare strings according to the numerical equivalent of
the ASCII characters. Therefore, a (with a decimal value of 97) is greater
than A (65), which is greater than the numeral 0 (48), which is greater than
the space character (32). These functions compare characters one by one
from the beginning of the string until an inequality occurs, at which time
the comparison ends. For example, LabVIEW compares the strings abcd
and abef until it finds c, which has a value less than the value of e.
The presence of a character is greater than the absence of one. Therefore,
the string abcd is greater than abc because the first string is longer.
The functions that test the category of a string character (for example, the
Decimal Digit? and Printable? functions) evaluate only the first character
of the string.
Numeric Comparison
Most of the Comparison functions test one input or compare two inputs
and return a Boolean value. The functions convert numbers to the same
representation before comparing them. Comparisons with a value of
not a number (NaN) return a value that indicates inequality.
Cluster Comparison
The Comparison functions compare clusters the same way they compare
strings, one element at a time starting with the 0th element until an
inequality occurs. Clusters must have the same number of elements, of
the same type, and in the same order if you want to compare them.
Comparison Modes
Some of the Comparison functions have two modes for comparing arrays
or clusters. In the Compare Aggregates mode, if you compare two arrays
or clusters, the function returns a single value. In the Compare Elements
mode, the function compares the elements individually. Then returns an
array or cluster of Boolean values. The following illustration shows the
two modes.
When you use the Compare Aggregates mode to compare two arrays, the
following occurs: (1) LabVIEW searches for the first set of corresponding
elements in the two inputs that differ, and uses those to determine the
results of the comparison. (2) If all elements are identical except that one
has more elements, LabVIEW considers the longer array to be greater than
the shorter array. (3) If no elements of the two arrays differ and the arrays
have the same length, the arrays are equal. Therefore, LabVIEW considers
the array [1, 2, 3] to be greater than the array [1, 2] and returns a single
Boolean value in the Compare Aggregates mode.
Arrays must have the same number of dimensions (for example, both
two-dimensional), and, for the comparison between multidimensional
arrays to make sense, each dimension must have the same size.
Character Comparison
You can use the functions that compare characters to determine the type of
a character. The following functions are character-comparison functions.
• Decimal Digit?
• Hex Digit?
• Lexical Class
• Octal Digit?
• Printable?
• White Space?
If the input is a string, the functions test the first character. If the input is an
empty string, the result is FALSE. If the input is a number, the functions
interpret it as a code for an ASCII character.
See Appendix C, GPIB Multiline Interface Messages, for the numbers that
correspond to each ASCII character.
The functions that compare values to zero accept numeric scalars, clusters,
and arrays of numbers. These functions release Boolean values as output in
the same data structure as the input.
The functions Decimal Digit?, Hex Digit?, Octal Digit?, Printable?, and
White Space? accept a scalar string or number input, clusters of strings or
non-complex numbers, arrays of strings or non-complex numbers, and
so on. The output consists of Boolean values in the same data structure as
the input.
You can use the Equal?, Not Equal?, Not A Number/Path/Refnum?, Empty
String/Path?, and Select functions with paths and refnums, but no other
comparison functions accept paths or refnums as inputs.
Decimal Digit?
Returns TRUE if char is a decimal digit ranging from 0 through 9. Otherwise, this function
returns FALSE.
Empty String/Path?
Returns TRUE if string/path is an empty string or path. Otherwise, this function returns
FALSE.
Equal?
Returns TRUE if x is equal to y. Otherwise, this function returns FALSE.
Equal To 0?
Returns TRUE if x is equal to 0. Otherwise, this function returns FALSE.
Greater?
Returns TRUE if x is greater than y. Otherwise, this function returns FALSE.
Greater Or Equal?
Returns TRUE if x is greater than or equal to y. Otherwise, this function returns FALSE.
Greater Or Equal To 0?
Returns TRUE if x is greater than or equal to 0. Otherwise, this function returns FALSE.
Greater Than 0?
Returns TRUE if x is greater than 0. Otherwise, this function returns FALSE.
Hex Digit?
Returns TRUE if char is a hex digit ranging from 0 through 9, A through F, or a through f.
Otherwise, this function returns FALSE.
In Range?
Returns TRUE if x is greater than or equal to lo and less than hi. Otherwise, this function
returns FALSE.
Note This function always operates in the Compare Aggregates mode. To produce a
Boolean array as an output, you must execute this function in a loop structure.
Less?
Returns TRUE if x is less than y. Otherwise, this function returns FALSE.
Less Or Equal?
Returns TRUE if x is less than or equal to y. Otherwise, this function returns FALSE.
Less Or Equal To 0?
Returns TRUE if x is less than or equal to 0. Otherwise, this function returns FALSE.
Less Than 0?
Returns TRUE if x is less than 0. Otherwise, this function returns FALSE.
Lexical Class
Returns class number for char.
Class
Number Lexical Class
0 Extended characters with a Command- or Option- key prefix
(codes 128 through 255)
1 Non-displayable ASCII characters (codes 0 to 31 excluding 9 through 13)
2 White space characters: Space, Tab, Carriage Return, Form Feed,
Newline, and Vertical Tab (codes 32, 9, 13, 12, 10, and 11, respectively)
Class
Number Lexical Class
3 Digits 0 through 9
4 Uppercase characters A through Z
5 Lowercase characters a through z
6 All printable ASCII non-alphanumeric characters
Not A Number/Path/Refnum?
Returns TRUE if number/path/refnum is not a number (NaN), not a path, or not a refnum.
Otherwise, this function returns FALSE. NaN can be the result of dividing by 0, calculating
the square root of a negative number, and so on.
Not Equal?
Returns TRUE if x is not equal to y. Otherwise, this function returns FALSE.
Not Equal To 0?
Returns TRUE if x is not equal to 0. Otherwise, this function returns FALSE.
Octal Digit?
Returns TRUE if char is an octal digit ranging from 0 through 7. Otherwise, this function
returns FALSE.
Printable?
Returns TRUE if char is a printable ASCII character. Otherwise, this function returns
FALSE.
Select
Returns the value connected to the t input or f input, depending on the value of s. If s is TRUE,
this function returns the value connected to t. If s is FALSE, this function returns the value
connected to f.
White Space?
Returns TRUE if char is a white space character, such as Space, Tab, Newline,
Carriage Return, Form Feed, or Vertical Tab. Otherwise, the function returns FALSE.
The following illustration shows the Time & Dialog palette that you access
by selecting Functions»Time & Dialog.
Timing Functions
The Date/Time To Seconds and the Seconds To Date/Time functions have
a parameter called date time rec, which is a cluster that consists of signed
32-bit integers in the following order.
The Wait (ms) and Wait Until Next ms Multiple functions make
asynchronous system calls, but the nodes themselves function
synchronously. Therefore, they do not complete execution until the
specified time has elapsed. The functions use asynchronous calls, so other
nodes can execute while the timing nodes wait.
Note Time values outside the range 2082844800 to 4230328447 seconds or 12:00 a.m.,
Jan. 1, 1970, Universal Time to 3:14 a.m., Jan. 19, 2038, Universal Time might not
convert to the same date on all platforms. This exception primarily exists on
Windows 3.x, which does not support dates prior to Jan. 1, 1970, Universal Time.
Rigorous error checking, especially for I/O operations (file, serial, GPIB,
data acquisition, and communication), is invaluable in all phases of a
project. This section describes three I/O situations in which errors can
occur.
The first type of error can occur when you have initialized your
communications incorrectly or have written improper data to your external
device. This type of problem usually occurs during program development
and disappears once you finish debugging your program. However, you can
spend a lot of time tracking down a simple programming mistake because
you have not incorporated error checks. Without error checks, you only
know that your program does not work. You do not know why the error
occurred or where it is.
The second type of error can occur because your external device might be
powered off, broken down, or otherwise unable to complete its normal
tasks. This type of problem can occur at any time, but if you have
incorporated error checking, your program notifies you immediately
when such operational failures occur.
The third kind of error can occur when you upgrade LabVIEW or your
operating system software and you notice a bug in either a G program or a
system program. This type of error means you should check errors that you
might have felt safe ignoring, such as those from functions that close files
or clear DAQ operations. Be sure to check all I/O operations for errors.
It might seem easier to ignore error checking when you must add error
handling code to test and report errors. The VIs described here are designed
to make it easier for you to create programs with error checking and
handling.
G functions and library VIs return errors in one of two ways—with numeric
error codes or with an error state cluster. Typically, functions release output
error codes while VIs incorporate the error cluster, usually within a
framework called error input/output (error I/O).
Error I/O has an additional benefit—you can use it to control the execution
order of independent operations. While you can use the DAQ taskID to
control the order of DAQ operations for one group, you cannot use it to
control the order for multiple groups. The DAQ taskID does not work with
other types of I/O operations such as file operations.
The following diagram from the File Utility VI, Read Characters From
File.vi, shows how error I/O is implemented in a simple VI.
on this block diagram is the error wire and the General Error Handler. It is
neither cumbersome nor distracting.
The error state consists of three pieces of information that are combined
into the error cluster. The status is a Boolean value—TRUE if an error
exists, FALSE if it does not. The code consists of a signed 32-bit integer
that identifies the error. A non-zero error code coupled with a FALSE
error status signals a warning rather than a fatal error. For example, a
DAQ timeout event (code 10800) typically is reported as a warning. The
source consists of a string that identifies where the error occurred.
The error in and error out state clusters for the Open File+.vi, where
the error shown in the preceding example originated, are shown in the
following illustration. The error in cluster, whose default value is no
error does not need to be wired if it is the first in the chain.
You can find the error in and error out clusters by selecting
Controls»Array & Cluster on the front panel.
The following illustration shows the message you receive from the General
Error Handler if you pass an invalid path.
The General Error Handler is one of the three error-handling utility VIs.
It contains a database of error codes and descriptions, from which it creates
messages like the previous one. The Simple Error Handler performs the
same basic operation but has fewer options. The third VI, Find First Error,
creates the error I/O cluster from functions or VIs that output only scalar
error codes.
Date/Time To Seconds
Converts a cluster of nine, signed 32-bit integers assumed to specify the local time (second,
minute, hour, day, month, year, day of the week, day of the year, and Standard or Daylight
Savings Time) in the configured time zone for your computer into a time-zone-independent
number of seconds that have elapsed since 12:00 a.m., Friday, January 1, 1904,
Universal Time.
The day of week, day of year, and DST integers are ignored. If any of the other integers are
out of the ranges specified in Table 10-1, the results are unpredictable.
When used as an integer, the day of month integer has a valid range of 1 to 366. Thus, you
can specify Julian dates by setting the month to January and the current day to the day of the
year. For example, use January 150 for the 150th day of the year.
The date/time string is determined from the seconds (now), which is the number of seconds
since 12:00 a.m., January 1, 1904, Universal Time, and time format string is the format of
the output string.
If seconds is not wired, the current time is used. If time format string is not wired, the default
is %c, which corresponds to the date/time representation appropriate for the current locale.
The Format Date/Time String function calculates date/time string by copying time format
string and replacing each of the format codes with the corresponding values in the following
table.
Characters appearing in time format string that are not part of a format code are copied to
the output string verbatim. Time format codes (beginning with %) that are not recognized
output the character literally.
Time format codes always have leading zeros as necessary to ensure a constant field width.
An optional # modifier before the format code letter removes the leading zeros from the
following format codes:
%#d, %#H, %#I, %#j, %#m, %#M, %#S, %#S, %#U, %#w, %#W, %X, %#y, %#Y.
The # modifier does not modify the behavior of any other format codes.
Note The %c, %x, %X, and %Z format codes depend on operating system locale support;
the output of these codes is platform dependent. Interpretation of the Daylight
Savings Time rule also can vary per platform.
Seconds To Date/Time
Converts a time-zone-independent number calculated to be the number of seconds that have
elapsed since 12:00 a.m., Friday, January 1, 1904, Universal Time, to a cluster of nine, signed
32-bit integers that specify the local time (second, minute, hour, day of the month, month,
year, day of the week, day of the year, and Standard or Daylight Savings Time) in the
configured time zone for your computer. The Standard or Daylight Savings time parameter
is set according to the operating system setting for Daylight Savings and indicates whether
the date/time cluster was adjusted due to Daylight Savings Time.
Wait (ms)
Waits the specified number of milliseconds then returns the value of the millisecond timer.
If this VI finds an error, it sets the parameters in the error out cluster. You can wire this cluster
to the Simple or General Error Handler to identify the error and describe it to the user.
The following illustration shows how you can use Find First Error in the example VI Write
Binary File. Find First Error creates the error cluster from individual error numbers, and
Simple Error Handler reports any errors to the user.
Simple Error Handler calls General Error Handler and has the same basic functionality as
General Error Handler, but with fewer options.
The high-level file VIs described here call the low-level file functions to
perform complete, easy-to-use file operations. These VIs open or create a
file, write or read to it, and close it. If an error occurs, these VIs display a
dialog box that describes the problem and gives you the option to halt
execution or to continue.
The high-level file VIs are located on the top row of the palette and consist
of the following VIs:
• Binary File VIs—located in the subpalette
• Read Characters from File
• Read from Spreadsheet File
• Read Lines from File
• Write Characters to File
• Write to Spreadsheet File
When creating or opening a file, you must specify its location. Different
computers describe the location of files in different ways, but most
computer systems use a hierarchical system to specify the location of files.
In a hierarchical file system, the computer system superimposes a hierarchy
on the storage media. You can store files inside directories, which can
contain other directories.
When you specify a file or directory in a hierarchical file system, you must
indicate the name of the file or directory, as well as its location in the
hierarchy. In addition, some file systems support the connection of multiple
discrete media, called volumes. For example, Windows systems support
multiple drives connected to a system; for most of these systems, you must
include the name of the volume to create a complete specification for the
location of a file. On other systems, such as UNIX, you do not need to
specify the storage media locations for files because the operating system
hides the physical implementation of the file system from you.
A byte stream file, as the name implies, is a file whose fundamental unit is
a byte. A byte stream file can contain anything from a homogeneous set
of one G datatype to an arbitrary collection of datatypes—characters,
numbers, Booleans, arrays, strings, clusters, and so on. An ASCII text file,
a file containing this paragraph, for example, is perhaps the simplest byte
stream file. A similar byte stream file is a basic spreadsheet text file, which
consists of rows of ASCII numbers, with the numbers separated by tabs and
the rows separated by carriage returns.
You write a byte stream file typically by appending new strings, numbers,
or arrays of numbers of any length to the file. You can also overwrite data
anywhere within the file. You write a datalog file by appending one record
at a time. You cannot overwrite the record.
You read a byte stream file by specifying the byte offset or index and the
number of instances of the specified byte stream type you want to read. You
read a datalog file by specifying the record offset or index and the number
of records you want to read.
You use byte stream files typically for text or spreadsheet data that other
applications may need to read. You can use byte stream files to record
continuously acquired data that you need to read sequentially or randomly
in arbitrary amounts. You use datalog files typically to record multiple test
results or waveforms that you read one at a time and treat individually.
Datalog files are difficult to read from non-G applications.
Flow-Through Parameters
Many file functions contain flow-through parameters, which return the
same value as an input parameter. You can use these parameters to control
the execution order of the functions. By wiring the flow-through output of
the first node you want to execute to the corresponding input of the next
node you want to execute, you create artificial data dependency. Without
these flow-through parameters, you would often have to use Sequence
structures to ensure that file I/O operations take place in the correct order.
Although the error I/O clusters specify whether an error has occurred, you
may want to use error handlers to report the error to the user. For more
information on error I/O, see Chapter 10, Time, Dialog, and
Error Functions, in this manual.
Permissions
Some of the file functions have a 32-bit integer parameter called
permissions or new permissions. These functions use only the least
significant nine bits of the 32-bit integer to determine file and directory
access permissions.
(Windows) The permissions are ignored for directories. For files, only bit 7
(the UNIX user write permission bit) is used. If this bit is clear, the file is
read-only. Otherwise, you can write to the file.
(Macintosh) All 9 bits of permissions are used for directories. The bits
that control read, write, and execute permissions, respectively, on a
UNIX system are used to control See Files, Make Changes, and
See Folders access rights, respectively, on the Macintosh. For files, only
bit 7 (the UNIX user write permission bit) is used. If this bit is clear, the
file is locked. Otherwise, the file is not locked.
(UNIX) The nine bits of permissions correspond exactly to the nine UNIX
permission bits governing read, write, and execute permissions for users,
groups, and others. The following illustration shows the permission bits on
a UNIX system.
Build Path
Creates a new path by appending a name (or relative path) to an existing path.
Close File
Writes all buffers of the file identified by refnum to disk, updates the directory entry of the
file, closes the file, and voids refnum for subsequent file operations.
Note The Close File VI handles error I/O differently than other file functions;
it executes even when its error in indicates that an error has occurred in a
preceding function.
Open/Create/Replace File
Opens an existing file, creates a new file, or replaces an existing file, programmatically or
interactively using a file dialog box. You can optionally specify a dialog prompt, default file
name, start path, or filter pattern. Use this VI with the Write File or Read File functions.
Read File
Reads data from the file specified by refnum and returns it in data. Reading begins at a
location specified by pos mode and pos offset and depends on the format of the specified file.
of the requested data, it returns as many whole instances of the designated byte stream type
as it finds.
Reading Characters
To read characters from a byte stream file (typically a text file), do not wire the byte stream
type. The following paragraphs describe the manner in which the line mode, count, convert
eol, and data parameters function when reading from a byte stream file.
line mode, in conjunction with count, determines when the read stops.
If line mode is TRUE, and if you do not wire count or count equals 0, Read File reads until it
encounters an end of line marker—a carriage return, a line feed, or a carriage return followed
by a line feed, or it encounters end of file. If line mode is TRUE, and count is greater than 0,
Read File reads until it encounters an end of line marker, it encounters end of file, or it reads
count characters.
If line mode is FALSE, Read File reads count characters. In this case, if you do not wire
count, it defaults to 0. line mode defaults to FALSE.
convert eol (F) determines whether the function converts the end of line markers it reads into
G end of line markers. The system-specific end of line marker is a carriage return followed
by a line feed on Windows, a carriage return on Macintosh, and a line feed on UNIX. The
G end of line marker is a line feed.
If convert eol is TRUE, the function converts all end of line markers it encounters into line
feeds. If convert eol is FALSE, the function does not convert the end of line markers it reads.
convert eol defaults to FALSE.
byte stream type can be any datatype. Read File interprets the data starting at the designated
byte offset to be count instances of that type. If the type is variable-length, that is, an array,
a string, or a cluster containing an array or string, the function assumes that each instance of
the type contains the length or dimensions of that instance. If they do not, the function
misinterprets the data. If Read File determines that the data does not match the type, it sets
the value of data to the default value for its type and returns an error.
count is the number of instances of byte stream type to read. If count is unwired, the
function returns a single instance of byte stream type.
If you wire count, it can be a scalar number, in which case the function returns a 1D array of
instances of byte stream type. Or it can be a cluster of N scalar numbers, in which case the
function returns an N-dimension array of instances of byte stream type.
If the wired count is a scalar number and the byte stream type is something other than an
array, the function returns that number of instances in a 1D array. For example, if the type is
a single-precision, floating point number and count is 3, the function returns an array of three,
single-precision, floating point numbers. However, if the type is an array, the function returns
the instances in a cluster array, because G does not have arrays of arrays. Therefore, if the type
is an array of single-precision, floating point numbers and count is 3, the function returns a
cluster array of three, single-precision, floating point number arrays.
If the wired count is a cluster of N numbers, the function returns an N-dimension array of
instances of the type. The size of each dimension is the value of the corresponding number
according to its cluster order. The number of instances returned in this manner is the product
of the N numbers. Thus, you can return 20, single-precision, floating point numbers as a
2D array of two columns and 10 rows by wiring a two-element cluster with element 0 = 2 and
element 1 = 10 to count.
data contains the data read from the file. Refer to the previous description of count for an
explanation of the structures data can have.
The number of records read can be less than specified by count if this function encounters the
end of the file. The function sets the file mark to the record following the last record read.
(You should never encounter a partial record; if you do, the file is corrupt.)
Do not wire convert eol, line mode, and byte stream type. They do not pertain to datalog
files. The count and data parameters function in the following manner.
count is the number of records to read and may be wired or unwired. If you do not wire count,
the function returns a single record of the datalog type specified when the file is created or
opened. For example, if the type is a 16-bit integer, the function returns one 16-bit integer.
If the type is an array of 16-bit integers, the functions returns one array of 16-bit integers.
(Your records typically consist of clusters of diverse elements, but the rules for simple types
used in these examples apply to those as well.)
If you wire count, it can be a scalar number, in which case the function returns a 1D array of
records. Or it can be a cluster of N scalar numbers, in which case the function returns an
N-dimension array of records.
If the wired count is a scalar number, and the datalog type is something other than an
array, the function returns that number of records in a 1D array. For example, if the type
is a single-precision, floating-point number and count is 3, the array contains three,
single-precision, floating-point numbers. However, if the type is an array, the function returns
the records in a cluster array because G does not have arrays of arrays. Therefore, if the
datalog type is an array of single-precision, floating-point numbers and count is 3, the
function returns a cluster array of three, single-precision, floating-point number arrays.
If the wired count is a cluster of N numbers, the function returns an N-dimension array of
records. The size of each dimension is the value of the corresponding number according to its
cluster order. The number of records returned in this manner is the product of the N numbers.
Therefore, you can return 20 records as a 2D array of two columns and ten rows by wiring a
two-element cluster with element 0 = 2 and element 1 = 10 to count.
Strip Path
Returns the name of the last component of a path and the stripped path that leads to that
component.
Write File
Writes data to the file specified by refnum. Writing begins at a location specified by
pos mode and pos offset for byte stream file and at the end of file for datalog files. data,
header, and the format of the specified file determine the amount of data written.
data must be either a datatype that matches the datatype specified when you open or create
the file, or an array of such datatypes. In the former case, this function writes data as a single
record in the datalog file. Representation of numeric data is coerced to the representation of
the datatype if necessary. In the latter case, this function writes each element of data as a
separate record in the datalog file in row-major order.
Access Rights
Sets and returns the owner, group, and permissions of the file or directory specified by path.
If you do not specify new owner, new group, or new permissions, this function returns the
current settings unchanged.
(Windows) The Access Rights function ignores new owner and new group and returns empty
strings for owner and group because Windows does not support owners and groups.
(Macintosh) If path refers to a file, the Access Rights function ignores new owner and new
group and returns empty strings for owner and group because Macintosh does not support
owners or groups for files.
Copy
Copies the file or directory specified by source path to the location specified by target path.
If you copy a directory, this function copies all its contents recursively.
Delete
Deletes the file or directory specified by path. If path specifies a directory that is not empty
or if you do not have write permission for both the file or directory specified by path and its
parent directory, this function does not remove the directory and returns an error.
EOF
Sets and returns the logical EOF (end-of-file) of the file identified by refnum. pos mode and
pos offset specify the new location of the EOF. If you do not specify pos mode or pos offset,
this function returns the current unchanged EOF. This function always returns the location of
the EOF relative to the beginning of the file.
You cannot set the EOF of a datalog file. If refnum identifies a datalog file, you cannot wire
pos mode and pos offset. However, you still can get the EOF of a datalog file, which tells you
how many records exist in the file.
File Dialog
Displays a dialog box with which you can specify the path to a file or directory. You can use
this dialog box to select existing files or directories or to select a location and name for a new
file or directory.
File/Directory Info
Returns information about the file or directory specified by path, including its size, its last
modification date, and whether it is a directory.
Flush File
Writes all buffers of the file identified by refnum to disk and updates the directory entry of
the file associated with refnum. The file remains open, and refnum remains valid.
Data written to a file often resides in a buffer until the buffer fills up or until you close the file.
This function forces the operating system to write any buffer data to the file.
List Directory
Returns two arrays of strings listing the names of all files and directories found in directory
path, filtering both arrays based upon pattern and filtering the file names array based upon
the specified datalog type.
Lock Range
Locks or unlocks a range of a file specified by refnum. Locking a range of a file prevents both
reading and writing by other users, overriding permissions for the file, and the deny mode
associated with refnum. See the File I/O VI and Function Overview section in this chapter
for a full discussion of permissions. Unlocking a range of a file removes the override caused
by locking a range, so that the file’s permissions and the deny mode associated with refnum
determine whether other users can read from or write to that range of the file.
Move
Moves the file or directory specified by source path to the location specified by target path.
New Directory
Creates the directory specified by directory path. If a file or directory already exists at the
specified location, this function returns an error instead of overwriting the existing file or
directory.
New File
Creates the file specified by file path and opens it for reading and writing (regardless of
permissions).
Open File
Opens the file specified by file path for reading and/or writing.
Path To String
Converts path into a string describing a path in the standard format of the platform.
Path Type
Returns the type of the specified path, indicating whether it is an absolute, relative, or
invalid path. This function checks only the format of the path, not whether the path refers
to an existing file or directory. Therefore, this function only indicates an invalid path for
Not A Path.
Refnum To Path
Returns the path associated with the specified refnum.
Seek
Moves the current file mark of the file identified by refnum to the position indicated by
pos offset according to the mode chosen by pos mode.
String To Path
Converts string, describing a path in the standard format for the current platform, to path.
Windows and UNIX do not support file types and creators. Trying to set the type or creator
of a file in these platforms results in an error; however, you can get the file type and creator
in these platforms. If the specified file has a name ending with characters that Type and
Creator recognizes as specifying a file type (such as .vi for the LVIN file type and .llb for
the LVAR file type), this function returns that type in type and LBVW in creator. Otherwise,
the function returns ???? in both type and creator.
Volume Info
Returns information about the volume containing the file or directory specified by path,
including the total storage space provided by the volume, the amount used, and the amount
free in bytes.
The Configuration File VIs work with a platform-independent configuration file similar in
format to the standard Windows initialization (.ini) file.
The file is divided into sections, denoted by a name enclosed in brackets. Each section in a
file must have a unique name. Within each section are key and value pairs. Each key within a
section must have a unique name.
String data in the file must be enclosed in double quotes. Any unprintable characters in the
string are stored in the file with their equivalent hexadecimal escape codes (for example,
\0D for carriage return). In addition, backslash characters are stored in the file as
double-backslashes (for example, \\ for \).
Path data is stored in a platform-neutral format. This format is the standard UNIX format for
paths. The VIs will interpret the absolute path /c/temp/data.dat as follows on the various
G platforms:
• Windows: c\temp\data.dat
• MacOS: c:temp:data.dat
• UNIX: /c/temp/data.dat
Remove Key
Removes a key in a specified section from the configuration data identified by refnum.
Remove Section
Removes a section from the configuration data identified by refnum.
Empty Path
Returns an empty path.
Not A Path
Returns a path whose value is Not A Path. You can use this path as an output from structures
and subVIs when an error occurs.
Not A Refnum
Returns a refnum whose value is Not A Refnum. You can use this refnum as an output from
structures and subVIs when an error occurs.
Path Constant
Use this to supply a constant directory or file path to the block diagram. Set this value by
clicking inside the constant with the Operating tool and typing in the value. Use the standard
file path syntax for a given platform. You can set the value of the path constant to Not a Path
by clicking on the path symbol with the Operating tool and selecting Not a Path from the
resulting menu. See the Paths and Refnums section of Chapter 6, Strings and File I/O, in the
LabVIEW User Manual for more information on using the Not a Path value.
The value of the path constant cannot be changed while the VI executes. You can assign a
label to this constant.
VI Library Constant
Returns the path to the VI library directory for the current development library on the
current computer. The Preferences dialog box (Edit»Preferences), under Paths, defines this
directory. If you build an application using the Application Builder libraries, this path is the
path of the directory containing the application.
With the Call By Reference node, the end user determines what VI is called at runtime
via the reference input. The Call By Reference node could call a VI that resides on a
different computer.
At the top of the Call By Reference node are four terminals: an input/output pair of flow
through VI reference terminals, and an input/output pair of flow through error clusters.
The VI reference input accepts wires only from strictly-typed VI references. Below these
terminals is an area within which a connector pane resides that is identical to that of a VI
with its terminals showing (rather than its icon). The connector pane of the strictly-typed VI
reference input determines the pattern and data types of this connector pane. You should wire
to these terminals just as you would to a normal subVI.
As long as none of the terminals of the connector pane have wires attached to them, the
connector pane adapts automatically to the connector pane of the input VI reference.
However, if any of them are wired, the node does not adapt automatically, and you must
explicitly change the connector pane (possibly breaking those wires) by popping up on the
node and selecting the Adapt To Reference Input menu item.
At run time there is a small amount of overhead in calling the VI that is not necessary in a
normal subVI call. This overhead comes from validating the VI reference and a few
other details. However, for a call to a VI in the local LabVIEW, this overhead should be
insignificant for all but the smallest subVIs. Calling a VI located in another LabVIEW
application (across the network) involves considerably more overhead. The reference input
determines the VI that is called by the Call by Reference node.
Call Chain
Returns a reference to a LabVIEW application or a VI.
Invoke Node
Invokes a method or action on a VI. Most methods have parameters associated with them.
To select the method, pop up anywhere on the node and select Methods. Once you select the
method, the associated parameters appear in the following illustration. You can set and get the
parameter values. Parameters with a white background are required inputs and the parameters
with a gray background are recommended inputs.
You can use the application reference output as an input to the Property and Invoke nodes to
get or set properties and invoke methods on the application. Using it as the input to the Open
VI Reference function lets you get references to VIs in that application. Close the reference
with the Close Application or VI Reference function. If you forget to close this reference, it
closes automatically when the top-level VI associated with this function finishes executing.
However, it is good practice to conserve the resources involved in maintaining the connection
by closing the reference when you finish using it.
Open VI Reference
Returns a reference to a VI specified by a name string or path to the VI's location on disk.
You can get references to VIs in another LabVIEW application by wiring an application
reference (obtained from the Open Application Reference function) to this function. In this
case, path input refers to the file system on the remote LabVIEW computer. If you wire a
reference to the local LabVIEW application you get the same behavior as if you had not wired
anything to the application reference input.
If you intend to perform editing operations on the referenced VI, and the VI has a
password-protected diagram, you can provide the password to the password string input.
If you provide the incorrect password, the Open VI Reference function returns an error and
an invalid VI reference. If you provide no password when opening a reference to a VI that is
password protected, you can still get the reference, but you can only perform operations that
do not edit the VI.
If you intend to call the specified VI through the Call By Reference function, wire a
strictly-typed VI reference to the type specifier input. The function ignores the value of this
input. Only the input's type—the connector pane information—is used. By specifying this
type, the Open VI Reference function verifies at run time that the referenced VI’s connector
pane matches that of the type specifier input.
Note It is possible to wire a Generic VI refnum type to the type specifier input. Doing
this results in the same behavior as if you had not wired the type specifier input
at all.
If you wire the type specifier input with a strictly-typed VI refnum, the VI must meet several
requirements before the VI reference is returned successfully:
• The VI cannot be broken for any reason.
• The VI must be runnable as a subVI; that is, it cannot be active as a top-level VI (unless
the VI is re-entrant).
• The connector pane of the VI must match that of the type specifier.
If you forget to close this reference, it closes automatically when the top-level VI associated
with this function finishes executing. However, it is good practice to conserve the resources
involved in maintaining the connection by closing the reference when you finish using it.
If you get a strictly-typed reference to a reentrant VI, a dedicated data space is allocated for
that reference. This data space is always used in conjunction with the output VI reference.
This can lead to some new behaviors that you may not be accustomed to in LabVIEW.
For example, parallel calls (using the Call By Reference node) to a reentrant VI using the
same VI reference do not execute in parallel, but execute serially, one after the other.
Notice that a VI reference is similar to what is known as a function pointer in other languages.
However, in LabVIEW, these function pointers also can be used to call VIs across the
network.
Print Panel
Produces the same printout as programmatic print at completion, but can be called from other
VIs and at times other than at completion. By default, it prints the entire panel, not just what
is visible in the window. This VI assumes that the VI is loaded but does not require the
window to be open.
Property Node
Sets (writes) or gets (reads) VI and application property information. To select the VI or
application class, pop up on the node and select from the Select VI Server Class submenu.
To select an application class, select Application. To select a VI class, select Virtual
Instrument, or wire the VI or application refnum to reference and the node choices change
accordingly.
To select a specific property, pop up on one of the name terminals and select Properties.
To set property information, pop up and select Change to Write, and to get property
information pop up and select Change to Read. Some properties are read only, so you cannot
see Change to Write in the pop-up menu. The Property node works the same way as
Attribute nodes. If you want to add items to the node, pop up and select Add Element or click
and drag the node to expand the number of items in the node. When this node executes,
properties are handled in the order from top to bottom. If an error occurs on one of the
properties, the node stops at that property and returns an error. No further properties are
handled. The error string reports which property caused the error. Remember if the small
direction arrow on a property is on the left, you are setting the property value. If the small
direction arrow on the property is on the right, you are getting the property value. Each
property name has a short or long name which can be changed by popping up and selecting
Name Format. Another name format is no name where only the type is displayed for each
property.
Quit
Stops all executing VIs and ends the current session of LabVIEW. This function shuts down
only LabVIEW; the function does not affect other applications. The function stops all running
VIs the same way the Stop function does.
Stop
Stops the VI in which it executes, just as if you clicked the Stop button in the toolbar. If you
wired the input, stop occurs only if the input value is TRUE. If you leave the input unwired,
the stop occurs as soon as the node that is currently executing finishes.
If you need to abort execution of all VIs in a hierarchy from the block diagram, you can use
this function, but you must use it with caution. Before you call the Stop function with a TRUE
input, be sure to complete all final tasks for the VI first, such as closing files, setting save
values for devices being controlled, and so on. If you put the Stop function in a subVI, you
should make its behavior clear to other users of the VI because this function causes their
VI hierarchies to abort execution.
In general, avoid using the Stop function when you have a built-in termination protocol in
your VI. For example, I/O operations should be performed in While Loops so that the VI can
terminate the loop on an I/O error. You should also consider using a front panel Stop Boolean
control to terminate the loop at the request of the user rather than using the Stop function.
Menu Functions
The following illustration displays the options available on the Menu subpalette.
The Menu functions operate on menus identified by a refnum. A VI's menu refnum is
obtained through the constant Current VI's menu. Items are identified by an item tag (string)
and sometimes by an item path (string), which is a list of item tags from the menu tree root
up to the item and separated by colons.
If menu tag is specified, the items are deleted from the submenu specified by menu tag, or
else the items are deleted from the menubar. The function returns an error if menu tag or one
of the items specified is not found.
items can be a tag (string) of an existing item, an array of tags of existing items, a position
index (zero-based integer) of an item in the menu or an array of position indices of items in
the menu. If you do not wire items, all the items in the menu are deleted. If there is a submenu
in any of the specified items, the submenu and all its contents are deleted automatically.
Because separators do not have unique tags, they are best deleted by using their positional
indices.
Item attributes are item name (the string that appears in the menu), enabled (false designates
that the item is grayed out), checked (specifies whether there is a check mark next to the
item), and short cut (key accelerator). If the item has a submenu, its item tags are returned as
an array of strings in submenu tags. If item tag is unwired, the menubar items are returned.
If item tag is not valid, an error is returned.
short cut consists of a string (key) and a Boolean (specifies whether the shift key is included
or not).
menu tag specifies the submenu where items are inserted. If you do not specify menu tag,
the items are inserted into the menubar.
item names and item tags identify the items to be inserted into the menu. The type of item
names and item tags can be an array of strings (for inserting multiple items) or just a string
(for inserting a single item). You can wire in either item names or item tags, in which case
both names and tags get the same values. If you require each item to have different name and
tag, you must wire in separate values for item names and item tags.
after item specifies the position where the items are inserted. after item can be a tag (string)
of an existing item or a position index (zero based integer) in the menu. To insert at the
beginning of the menu, wire a number less than 0 to after item. To insert at the end of the
menu, wire a number larger than the number of items in the menu. You can insert a separator
using the application tag APP_SEPARATOR. The function always ensures that the tags of all
the inserted menu items are unique to the menu hierarchy by appending numbers to the
supplied tags, if necessary.
item tags out returns the actual tags of the inserted items. If menu tag or after item (tag) is
not found, the function returns an error.
Beep
Causes the system to issue an audible tone. You can specify the tone frequency in Hertz,
the duration in milliseconds, and the intensity as a value from 0 to 255, with 255 being the
loudest. Although this VI appears on all platforms, the frequency, duration, and intensity
parameters work only on the Macintosh.
CINs are resizable and show datatypes for the connected inputs and outputs, similar to the
Bundle function. The following illustration shows the CIN function.
The LabVIEW interface to external code is very powerful. You can pass any number of
parameters to or from external code, and each parameter can be of any arbitrary G datatype.
LabVIEW provides several libraries of routines that make working with G datatypes easier.
These routines support memory allocation, file manipulation, and datatype conversion.
If you convert a VI that contains a CIN to another platform, you need to recompile the code
for the new platform because CINs use code compiled in another programming language. You
can write source code for a CIN so that it is machine-independent, requiring only a recompile
to convert it to another platform. For examples of CINs, see examples\cins.
For more information on the Code Interface Node, see the LabVIEW Code Interface
Reference Manual, available in portable document format (PDF) only.
This node supports a large number of datatypes and calling conventions. You can use it to call
functions from most standard and custom-made libraries.
The Call Library Function node, shown in the following illustration, looks similar to a
Code Interface node.
The Call Library Function consists of paired input/output terminals with input on the left and
output on the right. You can use one or both. The return value for the function is returned in
the right terminal of the top pair of terminals of the node. If there is no return value, then this
pair of terminals is unused. Each additional pair of terminals corresponds to a parameter in
the functions parameter list. You pass a value to the function by wiring to the left terminal of
a terminal pair. You read the value of a parameter after the function call by wiring from the
right terminal of a terminal pair.
If you select Configure... from the pop-up menu of the node, you see a Call Library Function
dialog box from which you can specify the library name or path, function name, calling
conventions, parameters, and return value for the node. When you click on OK, the node
automatically increases in size to have the correct number of terminals. It then sets the
terminals to the correct datatypes. For more information on Call Library Function refer to
Chapter 25, Calling Code From Other Languages, in the G Programming Reference Manual.
Flatten To String
Converts anything to a string of binary values. type string is a type descriptor that describes
the datatype of anything. data string is the flattened form of anything. For more information
on type descriptors and flattened data, see Flattened Data, in Appendix A, Data Storage
Formats, of the G Programming Reference Manual.
Join Numbers
Creates a number from the component bytes or words.
Logical Shift
Shifts x the number of bits specified by y.
Rotate
Rotates x the number of bits specified by y.
Split Number
Breaks a number into its component bytes or words.
The following illustration shows an example of how to use the Split Number function.
The function splits the signed 32-bit number 100,000 into the high word component, 1,
and the low word component, 34,464.
Swap Bytes
Swaps the high-order 8 bits and the low-order 8 bits for every word in anything.
Swap Words
Swaps the high-order 16 bits and the low-order 16 bits for every long integer in anything.
Type Cast
Casts x to the datatype, type.
Casting data to a string converts it into machine-independent, big endian form. That is, the
function puts the most significant byte or word first and the least significant byte or word last,
removes alignment, and converts extended-precision numbers to 16 bytes. Casting a string to
a 1D array converts the string from machine-independent form to the native form for that
platform.
Memory VI Descriptions
The following illustration displays the options available on the Memory subpalette.
Synchronization VIs
You can synchronize tasks executing in parallel by using the Synchronization VIs.
You can also use the Synchronization VIs to pass data between parallel tasks. You access
the Synchronization palette by choosing Functions»Advanced»Synchronization.
The following illustration displays the options available on the Synchronization palette.
Notification VIs
You can use the Notification VIs to pass data from one task to one or more separate, parallel
tasks. In particular, you use these VIs when you want one or more VIs or parts of block
diagrams to wait until another VI or part of a block diagram sends them some data.
The Notification VIs differ from the Queue VIs in that the data sent is not buffered. That is,
if there is no one waiting on a notification when it is sent, the data will be “lost” if another
notification is sent. Also, more than one Wait On Notification VI can receive the same data.
The notification VIs use the Notifier RefNum control from the Controls»Path & Refnum
palette.
Cancel Notification
Cancels and returns a previously sent notification.
This prevents a call to the Wait On Notification VI with ignore previous set to FALSE to see
the previously sent notification.
Create Notifier
Looks up an existing notifier or creates a new notifier and returns a refnum that you can use
when calling other Notification VIs.
If name is specified, the VI first searches for an existing notifier with the same name and
will return its refnum if it exists. If a named notifier with the same name does not already exist
and the return existing input is FALSE, the VI will create a new notifier and return its
refnum. The created new output returns TRUE if the VI creates a new notifier.
Destroy Notifier
Destroys the specified notifier and returns the last notification that was sent. All Wait on
Notification VIs that are currently waiting on this notifier time out immediately and return
an error.
Not A Notifier
Returns TRUE if notifier is not a valid notifier refnum.
Send Notification
Sends notification to the specified notifier. All Wait On Notification VIs that are currently
waiting on this notifier stop waiting and return the specified notification.
Wait On Notification
Waits for the Send Notification VI to send notification to the specified notifier.
If ignore previous is FALSE and a notification was sent since the last time this VI was called,
the VI returns immediately with the value of the old notification and with timed out as
FALSE. If the ignore previous input is TRUE, the VI will wait timeout milliseconds
(default –1, or forever) before timing out. If a notification is sent, timed out will return
FALSE. If a notification is not sent or if notifier is not valid, timed out will return TRUE.
If ignore previous is FALSE and a notification was sent to any of the specified notifiers since
the last time this VI was called, the VI returns immediately with the value(s) of the old
notification(s) and with timed out=FALSE. If the ignore previous input is TRUE, the VI
will wait ms timeout milliseconds (default –1, or forever) before timing out. If at least one
notification is sent, timed out will return FALSE. If no notification is sent, timed out will
return TRUE.
Queue VIs
You can use the Queue VIs to pass an ordered sequence of data elements from one task to
another separate, parallel task. In particular, you use these VIs when you want one task to wait
until another task provides it with some data. You can also use these VIs when you want one
task to wait until another task has processed some data that the first task has provided.
The queue VIs differ from the notification VIs in that the data sent is buffered. That is, if there
is no one waiting to read from the queue when an element is inserted, the element stays in the
queue until it is explicitly removed. Also, when data is inserted into a queue and there are two
VIs waiting to remove it from the queue, only one of them receives the data.
The Queue VIs use the Queue RefNum control from the Controls»Path & Refnum palette.
Create Queue
Looks up an existing queue or creates a new queue and returns a refnum that you can use when
calling other queue VIs.
If you specify a size > 0, the queue size is limited to that many elements. If the Insert Queue
Element VI tries to insert an element into a full queue, it must wait until an element is removed
with the Remove Queue Element VI. The default size is –1 for an unbounded queue.
If a name is specified, the VI first searches for an existing queue with the same name and will
returns its refnum if it exists. If a named queue with the same name does not already exist and
the return existing input is FALSE, the VI creates a new queue and return its refnum.
The created new output returns TRUE if the VI creates a new queue.
Destroy Queue
Destroys the specified queue and returns any elements that are in the queue. All Insert Queue
Element and Remove Queue Element VIs that are currently waiting on this queue time out
immediately and return an error.
Flush Queue
Removes all elements from queue.
The at begining parameter specifies whether the element is inserted at the end (default) or the
front of the queue. If the queue is full, the VI waits timeout milliseconds (default –1, or
forever) before timing out. If space becomes available during the wait, the element is inserted
and timeout returns FALSE. If the queue remains full or the queue is not valid, timeout
returns TRUE.
Not A Queue
Returns TRUE if queue is not a valid queue refnum.
The from end parameter specifies whether the returned element is taken from the front
(default) or the end of the queue. If the queue is empty, the VI waits timeout milliseconds
(default –1, or forever) before timing out. If an element becomes available during the wait,
the element is returned and timed out returns FALSE. If no element becomes available or the
queue is not valid, timed out returns TRUE.
Rendezvous VIs
You can use the Rendezvous VIs to synchronize two or more separate, parallel tasks at
specific points of execution. Each task that reaches the rendezvous waits until the specified
number of tasks are waiting, at which point all tasks proceed with execution.
The Rendezvous VIs use the Rendezvous RefNum control from the Controls»
Path & Refnum palette.
Create Rendezvous
Looks up an existing rendezvous or creates a new rendezvous and returns a refnum that you
can use when calling other Rendezvous VIs.
The size specifies how many tasks have to meet at the rendezvous in order to continue
execution. The default size is 2.
If name is specified, the VI first searches for an existing rendezvous with the same name and
returns its refnum if it exists. If a named rendezvous with the same name does not already
exist and the return existing input is FALSE, the VI creates a new rendezvous and return its
refnum. The created new output returns TRUE if the VI creates a new rendezvous.
Destroy Rendezvous
Destroys the specified rendezvous. All Wait at Rendezvous VIs that are currently waiting on
this rendezvous time out immediately and return an error.
Not A Rendezvous
Returns TRUE if rendezvous is not a valid rendezvous refnum.
Resize Rendezvous
Changes the size of rendezvous by size change and returns new size.
If the number of tasks currently waiting at rendezvous is less than or equal to new size, the
first size tasks stop waiting and continue execution.
Wait at Rendezvous
Waits until a sufficient number of tasks have arrived at the rendezvous.
If the number of tasks, including the new one, waiting at rendezvous is less than the
rendezvous size, the VI waits timeout milliseconds (default –1, or forever) before timing out.
If enough tasks arrive at the rendezvous during the wait, timed out returns FALSE. If enough
tasks do not arrive or the rendezvous is not valid, timed out returns TRUE.
Semaphore VIs
Semaphores, also known as Mutex, are used to limit the number of tasks that may
simultaneously operate on a shared (protected) resource. A protected resource or critical
section may include writing to global variables or communicating with external instruments.
You can use the Semaphore VIs to synchronize two or more separate, parallel tasks so that
only one task at a time executes a critical section of code protected by a common semaphore.
In particular, you use these VIs when you want other VIs or parts of block diagram to wait
until another VI or part of a block diagram is finished with the execution of a critical section.
The semaphore VIs use the Semaphore RefNum control from the Controls»
Path & Refnum palette.
Acquire Semaphore
Acquires access to a semaphore.
If the semaphore is already acquired by the maximum number of tasks, the VI waits timeout
milliseconds (default –1, or forever) before timing out. If the semaphore becomes available
during the wait, timed out returns FALSE. If the semaphore does not become available or the
semaphore is not valid, timed out returns TRUE.
Create Semaphore
Looks up an existing semaphore or creates a new semaphore and returns a refnum that you
can use when calling other semaphore VIs.
size specifies how many tasks may acquire the semaphore at the same time. The default size
is 1.
If a name is specified, the VI first searches for an existing semaphore with the same name and
returns its refnum if it exists. If a named semaphore with the same name does not already exist
and the return existing input is FALSE, the VI creates a new semaphore and return its
refnum. The created new output returns TRUE if the VI creates a new semaphore.
Destroy Semaphore
Destroys the specified semaphore. All Acquire Semaphore VIs that are currently waiting on
this semaphore will time out immediately and return an error.
Not A Semaphore
Returns TRUE if semaphore is not a valid semaphore refnum.
Release Semaphore
Releases access to a semaphore.
If there is an Acquire Semaphore VI waiting for this semaphore, it stops waiting and
continues execution. If you call the Release Semaphore VI on a semaphore that you have not
acquired, you effectively increment the semaphore size.
You can perform the same task using global variables, with one loop polling the value of the
global until its value changes. However, global variables add overhead, because the loop that
pulls the global variable uses execution time. With occurrences, the polling loop is replaced
with a Wait on Occurrence function and does not use processor time. When some diagram
sets the occurrence, LabVIEW activates all Wait on Occurrence functions in any block
diagrams that are waiting for the specified occurrence.
The following illustration displays the options available on the Occurrences subpalette.
Generate Occurrence
Creates an occurrence that you can pass to the Wait on Occurrence and Set Occurrence
functions.
Ordinarily, only one Generate Occurrence node is connected to any set of Wait on Occurrence
and Set Occurrence functions. You can connect a Generate Occurrence function to any
number of Wait on Occurrence and Set Occurrence functions. You do not have to have the
same number of Wait on Occurrence and Set Occurrence functions.
Unlike other synchronization VIs, each Generate Occurrence function on a block diagram
represents a single, unique occurrence. In this way, you can think of the Generate Occurrence
function as a constant. When a VI is running, every time a Generate Occurrence function
executes, the node produces the same value. For example, if you place a Generate Occurrence
function inside of a loop, the value produced by Generate Occurrence is the same for every
iteration of the loop. If you place a Generate Occurrence function on the block diagram of a
reentrant VI, Generate Occurrence produces a different value for each caller.
Set Occurrence
Triggers the specified occurrence. All block diagrams that are waiting for this occurrence
stop waiting.
Wait On Occurrence
Waits for the Set Occurrence function to set or trigger the given occurrence.
common analog output problems. The Analog Output Utility VIs are
intermediate-level VIs, so they rely on the advanced-level VIs.
• Chapter 22, Advanced Analog Output VIs, contains reference
descriptions of the Advanced Analog Output VIs. These VIs are the
interface to the NI-DAQ software and are the foundation of the Easy,
Utility, and Intermediate Analog Output VIs.
• Chapter 23, Easy Digital I/O VIs, describes the Easy Digital I/O VIs,
which perform simple digital I/O operations.
• Chapter 24, Intermediate Digital I/O VIs, describes the Intermediate
Digital I/O VIs. These VIs are single VI solutions to common digital
problems.
• Chapter 25, Advanced Digital I/O VIs, describes the Advanced Digital
I/O VIs, which include the digital port and digital group VIs. You use
the digital port VIs for immediate reads and writes to digital lines and
ports. You use the digital group VIs for immediate, handshaked, or
clocked I/O for multiple ports. These VIs are the interface to the
NI-DAQ software and the foundation of the Easy and Intermediate
Digital I/O VIs.
• Chapter 26, Easy Counter VIs, describes the Easy Counter VIs that
perform simple counting operations.
• Chapter 27, Intermediate Counter VIs, describes Intermediate Counter
VIs you can use to program counters on MIO, TIO, and other devices
with the DAQ-STC or Am9513 counter chips. These VIs call the
Advanced Counter VIs to configure the counters for common
operations and to start, read, and stop the counters. You can configure
these VIs to generate single pulses and continuous pulse trains, to
count events or elapsed time, to divide down a signal, and to measure
pulse width or period. The Easy Counter VIs call the Intermediate
Counter VIs for several pulse generation, counting, and measurement
operations.
• Chapter 28, Advanced Counter VIs, describes the VIs that configure
and control hardware counters. You can use these VIs to generate
variable duty cycle square waves, to count events, and to measure
periods and frequencies.
• Chapter 29, Calibration and Configuration VIs, describes the VIs that
calibrate specific devices and set and return configuration information.
• Chapter 30, Signal Conditioning VIs, describes the data acquisition
Signal Conditioning VIs, which you use to convert analog input
voltages read from resistance temperature detectors (RTDs), strain
gauges, or thermocouples into units of strain or temperature.
LabVIEW includes a collection of VIs that work with your DAQ hardware
devices. With LabVIEW DAQ VIs you can develop acquisition and control
applications.
You can find the DAQ VIs in the Functions palette from your block
diagram in LabVIEW. The DAQ VIs are located near the bottom of the
Functions palette.
The Data Acquisition palette contains six subpalette icons that take you
to the different classes of DAQ VIs. The following illustration shows what
each of the icons in the Data Acquisition palette means.
Calibration and
Configuration VIs
This part of the manual is organized in the order that the DAQ VI icons
appear in the Data Acquisition palette from left to right. For example,
in this section, the Analog Input VI chapters are followed by the Analog
Output VI chapters, which are followed by the Digital I/O VI chapters, and
so on. Most often, there are several chapters devoted to one class of
DAQ VIs in the palette, because many of the VI palettes also contain
several subpalettes.
Note Use only the inputs you need on each VI. LabVIEW sets all unwired inputs to their
default values. Many of the DAQ function inputs are optional and do not appear
in the Simple Diagram Help window. These inputs typically specify rarely-used
options. If an input is required, your VI wiring remains “broken” until a value
is wired to the input. Required inputs appear in bold in the Help window,
recommended inputs appear in plain text, and optional inputs are in gray text.
The default values for inputs appear in parentheses beside the input name in the
Help window.
Note Some DAQ VIs use an enumerated data type as a control or indicator terminal.
If you connect a numeric value to an enumerated indicator, LabVIEW converts
the number to the closest enumeration item. If you connect an enumerated control
to a number value, the value is the enumeration index.
There are four classes of Analog Input VIs found in the Analog Input
palette. The Easy Analog Input VIs, Intermediate Analog Input VIs,
Analog Input Utility VIs, and Advanced Analog Input VIs. The following
illustrates these VI classes.
Intermediate
Analog Input VIs
Advanced
Analog Input VIs
The Easy Analog Input VIs provide a basic, convenient interface with
only the most commonly used inputs and outputs. For more complex
applications, you should use the Intermediate Analog Input VIs and
Advanced Analog Input VIs for more functionality and performance.
Refer to Chapter 15, Easy Analog Input VIs, for specific VI information.
Refer to Chapter 17, Analog Input Utility VIs, for specific VI information.
There are four classes of Analog Output VIs found in the Analog Output
palette: the Easy Analog Output VIs, Intermediate Analog Output VIs,
Analog Output Utility VIs, and the Advanced Analog Output VIs.
The following illustrates these VI classes.
Easy Analog
Output VIs
Intermediate
Analog Output VIs
Advanced
Analog Output VIs
You can use each VI by itself to perform a basic analog output operation.
Unlike intermediate- and advanced-level VIs, Easy Analog Output VIs
automatically alert you to errors with a dialog box that asks you to stop the
execution of the VI or to ignore the error.
The Easy Analog Output VIs provide a basic, convenient interface with
only the most commonly used inputs and outputs. For more complex
applications, you should use the Intermediate Analog Output VIs and
Advanced Analog Output VIs for more functionality and performance.
Refer to Chapter 19, Easy Analog Output VIs, for specific VI information.
Refer to Chapter 21, Analog Output Utility VIs, for specific VI information.
There are three classes of Digital I/O VIs found in the Digital I/O palette.
The Easy Digital I/O VIs, Intermediate Digital I/O VIs, and Advanced
Digital I/O VIs. The following illustrates these VI classes.
Intermediate
Digital I/O VIs
Advanced
Digital I/O VIs
You can use each VI by itself to perform a basic digital operation. Unlike
intermediate- and advanced-level VIs, Easy Digital I/O VIs automatically
alert you to errors with a dialog box that asks you to stop the execution of
the VI or to ignore the error.
The Easy Digital I/O VIs are actually composed of Advanced Digital I/O
VIs. The Easy Digital I/O VIs provide a basic, convenient interface with
only the most commonly used inputs and outputs. For more complex
applications, you should use the intermediate- or advanced-level VIs for
more functionality and performance.
Refer to Chapter 23, Easy Digital I/O VIs, for specific VI information.
Counter VIs
These VIs perform counting operations.
There are three classes of Counter VIs found in the Counter palette: the
Easy, Intermediate, and Advanced Counter VIs. The following illustrates
these VI classes.
Advanced
Counter VIs
You can use each VI by itself to perform a basic counting operation. Unlike
intermediate- and advanced-level VIs, Easy Counter VIs automatically
alert you to errors with a dialog box that asks you to stop the execution of
the VI or to ignore the error.
The Easy Counter VIs are actually composed of Intermediate Counter VIs,
which are in turn composed of Advanced Counter VIs. The Easy Counter
VIs provide a basic, convenient interface with only the most commonly
used inputs and outputs. For more complex applications, you should use the
intermediate- or advanced-level VIs for more functionality and
performance.
See Chapter 30, Signal Conditioning VIs, for information on locating these
VIs and examples.
You can access the Easy Analog Input VIs by choosing Functions»Data
Acquisition»Analog Input. The Easy Analog Input VIs are the VIs on the
top row of the Analog Input palette, as shown below.
AI Acquire Waveform
Acquires a specified number of samples at a specified sample rate from a single input channel
and returns the acquired data.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel numbers and input limits
available with your DAQ device.
AI Acquire Waveforms
Acquires data from the specified channels and samples the channels at the specified scan rate.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel numbers and input limits
available with your DAQ device.
AI Sample Channel
Measures the signal attached to the specified channel and returns the measured value.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel numbers and input limits
available with your DAQ device.
AI Sample Channels
Performs a single reading from each of the specified channels.
The AI Sample Channels VI measures a single value from each of the specified analog input
channels. If an error occurs, a dialog box appears, giving you the option to stop the VI or
continue.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel numbers and input limits
available with your DAQ device.
Intermediate
Analog Input VIs
Handling Errors
LabVIEW makes error handling easy with the Intermediate Analog Input
VIs. Each intermediate-level VI has an error in input cluster and an error
out output cluster. The clusters contain a Boolean that indicates whether an
error occurred, the error code for the error, and the name of the VI that
returned the error. If error in indicates an error, the VI returns the error
information in error out and does not continue to run.
Note The AI Clear VI is an exception to this rule—this VI always clears the acquisition
regardless of whether error in indicates an error.
When you use any of the Intermediate Analog Input VIs in a While Loop,
you should stop the loop if the status in the error out cluster reads TRUE.
If you wire the error cluster to the General Error Handler VI, the VI
deciphers the error information and describes the error to you.
AI Clear
Clears the analog input task associated with taskID in.
The AI Clear VI stops an acquisition associated with taskID in and release associated internal
resources, including buffers. Before beginning a new acquisition, you must call the AI Config
VI. Refer to Chapter 18, Advanced Analog Input VIs, for description of the AI Control VI.
Note The AI Clear VI always clears the acquisition regardless of whether error in
indicates that an error occurred.
When you use any of the Intermediate Analog Input VIs in a While Loop, you should stop the
loop if the status in the error out cluster reads TRUE. If you wire the error cluster to the
General Error Handler VI, the VI deciphers the error information and describes the error
to you.
The General Error Handler VI is in Functions»Time and Dialog in LabVIEW. For more
information on this VI, refer to Chapter 10, Time, Dialog, and Error Functions.
AI Config
Configures an analog input operation for a specified set of channels. This VI configures the
hardware and allocates a buffer for a buffered analog input operation.
You can allocate more than one buffer only with the following devices.
• (Macintosh) NB-A2000, NB-A2100, and NB-A2150
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges, input limits, and
scanning order you can use with your National Instruments DAQ device.
AI Read
Reads data from a buffered data acquisition.
The AI Read VI calls the AI Buffer Read VI to read data from a buffered analog input
acquisition.
AI Single Scan
Returns one scan of data from a previously configured group of channels.
If you have already started an acquisition with the AI Start VI, this VI reads one scan from
the acquisition buffer data, or the onboard FIFO if the acquisition is not buffered. If you have
not started an acquisition, this VI starts an acquisition, retrieves a scan of data, and then
terminates the acquisition. The group configuration determines the channels the VI samples.
If you do not call the AI Start VI, this VI initiates a single scan using the fastest safe channel
clock rate. You can alter the channel clock rate with the AI Config VI.
If you run the AI Start VI, a clock signal initiates the scans.
You must use the AI Start VI to set the clock source to external, for externally-clocked
conversions.
If clock sources are internal and you do not allocate memory, a timed nonbuffered acquisition
begins when you run the AI Start VI. You use this type of acquisition for synchronizing analog
inputs and outputs in a point-to-point control application. The following devices do not
support timed, nonbuffered acquisitions.
• (Macintosh) NB-A2000, NB-A2100, and NB-A2150
Note LabVIEW restarts the device in the event of a FIFO overflow during a timed,
nonbuffered acquisition.
When you set opcode to 1 for a nonbuffered acquisition, the VI reads one scan from the FIFO
and returns the data. If opcode is 2, the VI reads the FIFO until it is empty and returns the last
scan read.
AI Start
Starts a buffered analog input operation. This VI sets the scan rate, the number of scans to
acquire, and the trigger conditions. The VI then starts an acquisition.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges, input limits,
scanning order, triggers, and clocks you can use with your National Instruments DAQ device.
Handling Errors
LabVIEW makes error handling easy with the intermediate-level Analog
Input Utility VIs. Each intermediate-level VI has an error in input cluster
and an error out output cluster. The clusters contain a Boolean that
indicates whether an error occurred, the error code for the error, and the
name of the VI that returned the error. If error in indicates an error, the VI
returns the error information in error out and does not continue to run.
When you use any of the Analog Input Utility VIs in a While Loop, you
should stop the loop if the status in the error out cluster reads TRUE.
If you wire the error cluster to the General Error Handler VI, the VI
deciphers the error information and describes the error to you.
AI Continuous Scan
Makes continuous, time-sampled measurements of a group of channels, stores the data in a
circular buffer, and returns a specified number of scan measurements on each call.
Also wire the condition that terminates the loop to the clear acquisition input, inverting the
signal if necessary so that it reads TRUE on the last iteration. On iteration 0, the VI calls the
AI Config VI to configure the channel group and hardware and allocates a data buffer; the VI
calls the AI Start VI to set the scan rate and start the acquisition. On each iteration, the VI
calls the AI Read VI to retrieve the number of measurements specified by number of scans
to read, scales them, and returns the data as an array of scaled values. On the last iteration
(when clear acquisition is TRUE) or if an error occurs, the VI calls the AI Clear VI to clear
any acquisition in progress. You should not need to call the AI Continuous Scan VI outside
of a loop, but if you do, you can leave the iteration and clear acquisition inputs unwired.
When calling the AI Continuous Scan VI in a loop to read portions of the data from the
ongoing acquisition, you must read the data fast enough so that newly acquired data does
not overwrite it. The scan backlog output tells you how much data acquired by the VI, but
remains unread. If the backlog increases steadily, your new data may eventually overwrite old
data. Retrieve data more often, or adjust the buffer size, the scan rate, or the number of
scans to read to fix this problem
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges, input limits, and
scanning order you can use with your National Instruments DAQ device.
On iteration 0, this VI calls the AI Config VI to configure the channel group and hardware,
then calls the AI Single Scan VI to measure and report the results. On subsequent iterations,
the VI avoids unnecessary configuration and calls only the AI Single Scan VI. If you call the
AI Read One Scan VI once to take a single measurement from the group of channels, the
iteration parameter can remain unwired.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges, input limits, and
scanning order available with your DAQ device.
AI Waveform Scan
Acquires the specified number of scans at the specified scan rate and returns all the data
acquired. You can trigger the acquisition.
Also wire the condition that terminates the loop to the VI clear acquisition input, inverting
the signal if necessary so that it reads TRUE on the last iteration. On iteration zero, this VI
calls the AI Config VI to configure the channel group and hardware and allocate a data buffer.
On each iteration, this VI calls the AI Start and AI Read VIs. The AI Start VI sets the scan
rate and trigger conditions and starts the acquisition. The VI stores the measurements in the
buffer as they are acquired, and the AI Read VI retrieves them from the buffer, scales them,
and returns all the data as an array of scaled values. On the last iteration (when clear
acquisition is TRUE) or if an error occurs, the VI also calls the AI Clear VI to clear the
acquisition in progress. If you call the AI Waveform Scan VI only once, you can leave
iteration and clear acquisition unwired.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges, input limits,
scanning order, triggers, and clocks you can use with your National Instruments DAQ device.
Note These VIs use an uninitialized shift register as local memory to remember the
taskID for the group of channels between VI calls. You normally use one VI in one
place on your diagram, but if you use it more than once, the multiple instances of
the VI share the same taskID. All calls to one of these VIs configure, read data
from, or clear the same acquisition. Occasionally you may want to use each VI in
multiple places and have each instance refer to a different taskID (for example,
when you measure two devices simultaneously). Save a copy of the VI with a new
name (for example, AI Waveform Scan R) and make your new VI reentrant.
Note For all Analog Input Utility VIs, if your program iterates more than 231 – 1 times,
do not wire the iteration input to the loop iteration terminal. Instead, set iteration
to 0 on the first loop, then to any positive value on all other iterations. The VI
reconfigures and restarts if iteration ≤0.
Advanced
Analog Input VIs
AI Buffer Config
Allocates memory for LabVIEW to store analog input data until the AI Buffer Read VI can
deliver it to you. LabVIEW refers to the buffer(s) allocated by the AI Buffer Config VI as
internal buffers because you do not have direct access to them.
Note When you run the AI Control VI with control code set to 4 (clear), the VI performs
the equivalent of running the AI Buffer Config VI with allocation mode set to 1.
That is, both VIs deallocate the internal analog input data buffers. However,
acquisitions that use DSP or expansion card memory are an exception. The AI
Control VI does not deallocate DSP memory when clearing an acquisition. You
must explicitly call the AI Buffer Config VI to deallocate DSP acquisition buffers.
Table 18-1 lists default settings and ranges for the AI Buffer Config VI. The first row gives
the values for most devices, and the other rows give the values for devices that are exceptions
to the rule.
AI Buffer Read
Returns analog input data from the internal data buffer(s).
Note When the VI reads from the trigger mark, it does not return data until the
acquisition completes for the buffer containing the trigger.
AI Clock Config
Sets the channel and scan clock rates.
Refer to Appendix B, DAQ Hardware Capabilities, for the clocks available with your
DAQ device.
For devices that have only a channel clock (Lab-LC, Lab-NB, NB-MIO-16, Lab-PC+,
PCI-1200, PC-LPM-16, DAQCard-500, DAQCard-700, and DAQCard-1200), you cannot
set independent channel and scan clock rates. Setting one resets the other because the channel
rate equals scan rate/number of channels to scan.
For devices that have no channel clock (NB-A2000, NB-A2100, and NB-A2150), setting the
channel clock produces an error.
If you specify a value of 0 for the scan clock rate, interval scanning turns off, and channel
scanning (or round-robin scanning) proceeds at the channel clock rate. This option is
meaningful only for devices with independent channel and scan clocks.
The clock rate is the rate at which LabVIEW samples data or acquires scans. You can express
the clock rate three ways—with clock frequency, with clock period, or with timebase
source, timebase signal, and timebase divisor. The VI searches these parameters in that
order and sets the clock rate using the first one with a value not equal to –1.
Table 18-2 lists default settings and ranges for the controls of the AI Clock Config VI.
Table 18-2. Device-Specific Settings and Ranges for Controls in the AI Clock Config VI
Configuration Retrigger
Mode Mode Which Clock Clock Source
Default Default Default Default
Device Setting Range Setting Setting Range Setting Range
AT-MIO-16E1 1 1, 3 no 1 1, 2 1 1, 2
AT-MIO-16E-2 support 4≤n≤11
AT-MIO-64E-1
NEC-MIO-16E-4
PCI-MIO-16E-1
PCI-MIO-16E-4
PCI-MIO-16XE-10
PCI-6110E 1 1, 3 no 1 1 1 1, 2
PCI-6111E support 4≤n≤11
AT-MIO-16E-10 1 1, 3 no 1 1, 2 1 1, 2
AT-MIO-16DE-10 support 4≤n≤9
AT-MIO-16XE-50
PCI-MIO-16XE-50
NB-A2150 1 1, 3 no 1 1 1 1≤n≤3
NB-A2100 support
NB-A2000
DSA Devices 1 1, 3 no 1 1 1 1
support
PC-LPM-16 1 1, 3 no 1 1, 2 1 1, 2
DAQCard-500 support
DAQCard-516
DAQCard-700
Lab-PC
Lab-LC 1 1, 3 no 1 2 1 1, 2
Lab-NB support
NB-MIO-16
5102 1 1, 3 no 1 1 1 1, 6
support
Table 18-2. Device-Specific Settings and Ranges for Controls in the AI Clock Config VI (Continued)
Configuration Retrigger
Mode Mode Which Clock Clock Source
Default Default Default Default
Device Setting Range Setting Setting Range Setting Range
5911, 5912 1 1, 3 no 1 1,2 1 1≤n≤3
support
All Other Devices 1 1, 3 no 1 1, 2 1 1≤n≤3
support
AI Control
Controls the analog input tasks and specifies the amount of data to acquire.
Note You cannot use this VI to start an acquisition when you use a PC-LPM-16,
DAQCard-500, or a DAQCard-700 device to scan multiple SCXI channels in
multiplexed mode. For this special case, you must use the AI SingleScan VI to
acquire data. (For more information about the AI SingleScan VI, refer to
its description in this chapter.) However, you can use the AI Control VI for a Lab
and 1200 Series device, PC-LPM-16, DAQCard-500, or DAQCard-700 device
when you scan SCXI channels in parallel mode or sample a single SCXI channel
in multiplexed mode. You can use this VI for an MIO device scanning
SCXI channels in either mode.
Note Nonbuffered acquisitions are not supported for the following devices.
• (Macintosh) NB-A2000
• (Macintosh) NB-A2100
• (Macintosh) NB-A2150
Table 18-3 lists default settings and ranges for the AI Control VI.
Minimum Number of
Control Total Scans Pretrigger Buffers to
Code to Acquire Scans to Acquire Acquire
Device DS* R* DS* R* DS* R* DS* R*
NB-A2000 0 0, 1, 4 0 0, n≥0 0 0, n≥3 1 n≥0
NB-A2150
PC-LPM-16 0 0, 1, 4 0 0, n≥3 0 no 1 1
DAQCard-500 support
DAQCard-700
MIO-E Series 0 0, 1, 4 0 0, n≥3 0 0, n≥3 1 1
5102 Devices 0 0, 1, 4 0 n≥0 0 n≥0 1 1
5911, 5912 0 0, 4 0 n≥1 0 n≥0 1 1
All Other 0 0, 1, 4 0 0, n≥3 0 n≥0 1 1
Devices
* DS = Default Setting; R = Range
AI Group Config
Defines what channels belong to a group and assigns them.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges and scanning order
available with your DAQ device.
Table 18-4 lists default settings and ranges for the AI Group Config VI. The first row of the
table gives the values for most devices, and the other rows give the values for devices that are
exceptions to the rule.
Table 18-4. Device-Specific Settings and Ranges for the AI Group Config VI
The channel scan list range shown above is for single-ended mode. Please refer to
Appendix B, DAQ Hardware Capabilities, to determine the valid range for
channels in differential mode.
SCXI modules in multiplexed mode must scan channels in ascending consecutive order,
starting from any channel on the module. The module order you specify can be arbitrary.
SCXI modules in parallel mode must follow the DAQ device restrictions on the order of
channel scan lists. Refer to the Channel, Port, and Counter Addressing section of Chapter 3,
Basic LabVIEW Data Acquisition Concepts, in the LabVIEW Data Acquisition Basics
Manual for information about SCXI channel string syntax.
AI Hardware Config
Configures either the upper and lower input limits or the range, polarity, and gain.
The AI Hardware Config VI also configures the coupling, input mode, and number of
AMUX-64T devices. The configuration utility determines the default settings for the
parameters of this VI.
You can use this VI to retrieve the current settings by wiring taskID only or by wiring both
taskID and channel list. If channel list is empty, the VI configures channels on a per group
basis. This means that the configuration applies to all the channels in the group. When you
specify one or more channels in channel list, the VI configures channels on a per channel
basis. This means that the configuration applies only to the channels you specify. This VI
always returns the current settings for the entire group.
When the configuration is on a per channel basis, channel list can contain one or more
channels. The channels in channel list must belong to the group named by taskID. You
specify channels the same way you specify them for the AI Group Config VI. If you
take multiple samples of a channel within a scan and you want to change the hardware
configuration for that channel at each sample, you must supply the settings for each instance
of the channel within the scan. If an element of channel list specifies more than one channel,
the corresponding element of the other arrays applies to all those channels.
The VI applies the values contained in the configuration arrays (upper input limits, lower
input limits, coupling, range, polarity, gain, and mode) to the channels in the group (if you
configured on a per group basis) or the channels in channel list (if you configured on a per
channel basis) in the following way. The VI applies the values listed first in the arrays (at
index 0) to the first channel in the group or the channel(s) listed in index 0 of channel list.
The VI applies the values listed second in the configuration arrays (at index 1) to the second
channel in the group or channel(s) listed in index 1 of channel list. The VI continues to apply
the values in this fashion until the arrays are exhausted. If channels in the group or channel
list remain unconfigured, the VI applies the final values in the arrays to all the remaining
unconfigured channels.
Table 18-5 gives examples of this method. The parameter channel scan list, which is part of
the AI Group Config VI, is used in the following table.
Configuration
Basis Array Values Results
Group Group channel scan list = 1, 3, 4, 5, 7 All channels in the group have
channel list is empty input limits of –1.0 to +1.0.
lower input limit [0] = –1.0
upper input limit [0] = +1.0
Group Group channel scan list = 1, 3, 4, 5, 7 Channel 1 has input limits of
channel list is empty –1.0 to +1.0. Channel 3 has
lower input limit [0] = –1.0 input limits 0.0 to +5.0.
upper input limit [0] = +1.0 Channels 4, 5, and 7 have input
lower input limit [1] = 0.0 limits of –10.0 to +10.0.
upper input limit [1] = +5.0
lower input limit [2] = –10.0
upper input limit [2] = +10.0
Channel Group channel scan list = 1, 3, 4, 5, 7 Channels 1, 3, 4, and 5 have
channel list [0] = 1 input limits of –1.0 to +1.0.
channel list [1] = 3:5 Channel 7 has the default input
lower input limit [0] = –1.0 limits set by the configuration
upper input limit [0] = +1.0 utility. It is unchanged because
it is not listed in channel list.
Channel Group channel scan list = 1, 3, 4, 5, 7 Channel 1 has input limits of
channel list [0] = 1 –1.0 to +1.0. Channels 3, 4,
channel list [1] = 3:5 and 5 have input limits of 0.0
lower input limit [0] = –1.0 to +5.0. Channel 7 has the
upper input limit [0] = +1.0 default input limits set by the
lower input limit [1] = 0.0 configuration utility.
upper input limit [1] = +5.0
Group Group channel scan list = 0, 1, 0, 1 Channels 0 and 1 have input
channel list is empty limits of –1.0 to +1.0 the first
lower input limit [0] = –1.0 time they are sampled and
upper input limit [0] = +1.0 input limits of –10.0 to +10.0
lower input limit [1] = –1.0 the second time they are
upper input limit [1] = +1.0 sampled.
lower input limit [2] = –10.0
upper input limit [2] = +10.0
lower input limit [3] = –10.0
upper input limit [3] = +10.0
The range, polarity, and gain determine the lower and upper input limits. When you wire
valid input limit arrays (that is, arrays of lengths greater than zero) the VI chooses suitable
input ranges, polarities, and gains to achieve these input limits. The VI ignores the range,
polarity, and gain arrays.
If you do not wire the input limit arrays, the VI checks range, polarity, and gain. Where the
VI finds an array, it sets the corresponding input property to the values in the array. Where
the VI does not find an array, it leaves the corresponding input property unchanged.
For some devices and SCXI modules, onboard jumpers set range, polarity, and/or gain.
LabVIEW does not alter the settings of jumpered parameters when you specify input limits.
If LabVIEW cannot achieve the desired input limits using the current jumpered settings,
it returns a warning.
To override the current jumper values, you must call the AI Hardware Config VI and specify
range, polarity, and/or gain explicitly. The configuration utility determines the initial setting
for these parameters (the default value is the factory jumper setting).
If a pair of input limits values are both 0, the VI does not change the input limits.
SCXI channel hardware configurations are actually a combination of SCXI module and
DAQ device settings and require special considerations. The way you specify channels
indicates whether LabVIEW alters the SCXI module settings and/or the DAQ device settings.
The input limits parameter always applies to the entire acquisition path.
When you configure on a per group basis, LabVIEW may alter both SCXI module and
DAQ device settings. In this case, gain applies to the entire path and is the product of the
SCXI channel gain and acquisition device channel gain. LabVIEW sets the highest gain
needed on the SCXI module, then adds DAQ device gain if necessary.
When configuration is on a per channel basis, you can specify the channels in one of three
ways. The first way is to specify the entire path, as in the following example.
OB0!SC1!MD1!CH0:7
Also, you can specify the path using channel names configured in the DAQ Channel Wizard,
as in the following example.
temperature
If you use either of these methods, LabVIEW can alter both SCXI and DAQ device settings,
and gain applies to the product of the SCXI channel gain and the DAQ device gain. LabVIEW
sets the highest gain needed on the SCXI module, then adds DAQ device gain if necessary.
The second method is to specify the SCXI channel only, as in the following example.
SC1!MD1!CH0:7
This specification indicates that LabVIEW should alter SCXI settings only. Additionally,
gain applies only to the SCXI channel.
The third way is to specify the acquisition device channel only, as in the following example.
OB0
In this case, LabVIEW alters only DAQ device settings. The gain parameter applies to the
onboard channel only.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges, input limits, and
scanning order available with your DAQ device.
Tables 18-6 through 18-9 list default settings and ranges for the AI Hardware Config VI.
A tilde (~) indicates that the parameter is configurable on a per group basis only. This means
you cannot configure it by channel. The first row of these tables gives the values for most
devices, and the other rows give the values for devices that are exceptions to the rule. If you
did not set the default settings with the configuration utility, use the default settings shown in
these tables.
Table 18-6. Device-Specific Settings and Ranges for the AI Hardware Config VI
Channel Input
Configuration Cluster
Number Channel
Coupling Input Mode ~ of AMUX List
Device DS* R* DS* R* DS* R* DS*
Most Devices 1 1 1 1 ≤n≤3 0 0 ≤n≤4 empty
NB-A2000 2 1, 2 2 2 0 0 empty
PC-LPM-16, 1 1 2 2 0 0 empty
Lab-LC,
Lab-NB
Lab and 1200 1 1 2 1 ≤n≤3 0 0 empty
Series devices
AT-MIO-16X, 1 1 1 (no ~) 1 ≤n≤3 0 0 ≤n≤4 empty
AT-MIO-64F-5
NB-A2100, 1 1, 2 2 2 0 0 empty
NB-A2150
DAQCard-500, 1 1 2 1, 2 0 0 empty
DAQCard-516,
DAQCard-700
Table 18-6. Device-Specific Settings and Ranges for the AI Hardware Config VI (Continued)
Channel Input
Configuration Cluster
Number Channel
Coupling Input Mode ~ of AMUX List
Device DS* R* DS* R* DS* R* DS*
5102 Devices 1 1, 2 2 2 0 0 empty
PCI-6110E, 1 1, 2 1 1 0 0 empty
PCI-6111E,
PCI-4451,
PCI-4551,
PCI-4452,
PCI-4552
* DS = Default Setting; R = Range
Note Channels 0 and 1 and channels 2 and 3 must have the same coupling for the
NB-A2150.
AI Parameter
Configures and retrieves miscellaneous parameters associated with Analog Input of an
operation of a device that are not covered with other AI VIs.
AI SingleScan
Returns one scan of data. If you started an acquisition with the AI Control VI, this VI
reads one scan of the data from the internal buffer. On the Macintosh and in Windows, the
VI reads from the onboard FIFO if the acquisition is nonbuffered. If you have not started an
acquisition, this VI starts an acquisition, retrieves a scan of data, and then terminates the
acquisition. The group configuration determines the channels the VI sample. This VI does not
support 5102, DSA, and 59xx devices.
If you do not call the AI Control VI, this VI initiates a single scan using the fastest and most
safe channel clock rate. You can, however, alter the channel clock rate with the AI Clock
Config VI.
If you run the AI Control VI with control code set to 0 (Start), a clock signal initiates
the scans.
If you want externally clocked conversions, you must use the AI Clock Config VI to set the
clock source to external.
If clock sources are internal and you do not allocate memory, a timed, nonbuffered acquisition
begins when you run the AI Control VI with control code set to 0. This type of acquisition is
useful for synchronizing analog inputs and outputs in a point-to-point control application.
The following devices do not support timed, nonbuffered acquisitions:
• (Macintosh) Lab-NB, Lab-LC, NB-A2000, NB-A2100, and NB-A2150
Table 18-7 lists default settings and ranges for the AI SingleScan VI.
AI Trigger Config
Configures the trigger conditions for starting the scan and channel clocks and the scan
counter.
Refer to Appendix B, DAQ Hardware Capabilities, for information on the triggers available
with your DAQ device. Refer to your E Series device user manual for a detailed description
of the triggering capabilities of the device.
The following is a detailed description of trigger types 1 (analog trigger), 2 (digital trigger A),
and 3 (digital trigger B) as they apply to three types of applications: posttrigger, pretrigger
with software start, and pretrigger with hardware start. The other trigger types are discussed
at the end of this section.
With E-Series devices, if you are using an analog trigger and the analog signal is connected
to one of the analog input channels, that channel must be first in the scan list. This restriction
does not apply if you connect the analog signal to PFI0.
In the above illustration, total scans to acquire is 1000 and pretrigger scans to acquire
is 0. The start trigger can come from digital trigger A or an analog trigger (trigger or pause
condition = 1: Trigger on a rising edge or slope, level = 5.5, window size = 0.2).
In the previous illustration, total scans to acquire is 1000 and pretrigger scans to acquire
is 900. The stop trigger can come from digital trigger A or an analog trigger (trigger or pause
condition = 1: Trigger on rising edge or slope, level = 3.7, window size = 0.5).
With E Series devices, if you are using an analog trigger and the analog signal is connected
to an analog input channel, that channel must be the only channel in the scan list (no multiple
channel scan allowed). This restriction does not apply if you connect the analog signal
to PFI0.
On MIO devices, you can enable both the start trigger and the stop trigger. (You must call the
AI Trigger Config VI twice to do this.) In this case, a digital or analog trigger signal starts the
acquisition rather than a software strobe. This is a hardware start pretriggered acquisition.
You provide both the start trigger (as described in Application Type 1) and the stop trigger
(as described in Application Type 2). Refer to Tables 18-11 and 18-12 to determine the
default pin to which you connect your trigger signal. On some devices, you can specify an
alternative source through the trigger source parameter.
In the above illustration, total scans to acquire is 1000 and pretrigger scans to acquire
is 900. The start trigger can come from digital trigger B or an analog trigger (trigger or pause
condition = 1: Trigger on rising edge or slope, level = 5.5, window size = 0.2). The stop
trigger can come from digital trigger A or an analog trigger (trigger or pause condition = 1:
Trigger on rising edge or slope, level = 4.0, window size = 0.2). Notice that some of the
data after the start trigger has been discarded, because all 900 pretrigger scans have been
collected and the stop trigger is more than 900 scans away from the start trigger.
When using analog triggering on E Series devices, there are several restrictions that apply, as
shown in Table 18-8.
Start Stop
Trigger Trigger Restrictions
Digital A Digital B None
Digital B Analog Analog signal must be connected to PFI0, unless you are
scanning only one channel, in which case the input to that
channel can be used.
Analog Digital A Analog signal must be first in scan list if it is connected to an
analog input channel.
A trigger type of 4 (digital scan clock gating) enables an external TTL signal to gate the scan
clock on and off, effectively pausing and resuming an acquisition.
Channel clock and scan clock are the same on the NB-MIO-16. Therefore, if the scan clock
gate becomes FALSE, the current scan does not complete and the scan clock ceases operation.
When the scan clock gate becomes TRUE, the scan clock immediately begins operation
again, where it left off previously. You wire your signal to the EXTGATE pin.
A trigger type of 5 (analog scan clock gating) enables an external analog signal to gate the
scan clock on and off, effectively pausing and resuming an acquisition. A trigger type of 6
allows you to use the output of the analog trigger circuitry (ATCOUT) as a general purpose
signal. For example, you can use ATCOUT to start an analog output operation, or you can
count the number of analog triggers appearing at ATCOUT.
Note Trigger types 1, 5, and 6 on E-Series devices use the same analog trigger circuitry.
All three types can be enabled at the same time, but the last one enabled dictates
how the analog trigger circuitry behaves. The E Series restrictions described in the
trigger applications apply to all three trigger types.
Trigger type 5 on E-Series devices uses the digital scan clock gate and the analog trigger
circuitry. Therefore, enabling trigger type 5 overwrites any settings made for trigger type 4.
For some devices, digital triggering is supported, but for these devices the source is
predetermined. Therefore, the trigger source parameter is invalid. Table 18-9 shows the pin
names on the I/O connector to which you should connect your digital trigger signal.
Table 18-9. Digital Trigger Sources for Devices with Fixed Digital Trigger Sources
Posttriggering Pretriggering
Start Start Stop
Device Trigger Pin Trigger Pin Trigger Pin
MIO-16L/H, MIO-16DL/DH STARTTRIG* STARTTRIG* STOPTRIG
NB-MIO-16L/H STARTTRIG* no support no support
AT-MIO-16X, AT-MIO-16F-5, EXTTRIG* EXTTRIG* EXTTRIG*
AT-MIO-64F-5
Lab and 1200 Series devices EXTTRIG no support EXTTRIG
PC-LPM-16, DAQCard-500, no support no support no support
DAQCard-700
NB-A2000, NB-A2100, EXTTRIG* no support EXTTRIG*
NB-A2150
DSA 45xx EXTTRIG* EXTTRIG* EXTTRIG*
* On the AT-MIO-16X, AT-MIO-16F-5, and AT-MIO-64F-5, the same pin is used for both the start trigger and the
stop trigger. Refer to your hardware user manual for more details.
Table 18-10 lists the default settings and ranges for the AI Trigger Config VI. The first row
of each table gives the values for most devices, and the other rows give the values for devices
that are exceptions to the rule.
Table 18-10. Device-Specific Settings and Ranges for the AI Trigger Config VI (Part 1)
Trigger or
Trigger Pause
Type Mode Condition Level
Device DS* R* DS* R* DS* R* DS* R*
Most Devices 2 2, 3 1 1≤n≤3 no support no support
AT-MIO-16E-10, 2 2≤n≤4 1 1≤n≤3 1 1, 2, no support
AT-MIO-16DE-10, 7, 8
AT-MIO-16XE-50,
PCI-MIO-16XE-50
AT-MIO-16E-2, 2 1≤n≤6 1 1≤n≤3 1 1≤n≤8 0 –10
AT-MIO-64E-3, ≤n≤
NEC-MIO-16E-4 10
Lab and 1200 Series 2 2 1 1≤n≤3 no support no support
devices
PC-LPM-16, no support no support no support no support
DAQCard-500,
DAQCard-700
NB-A2100, 1 1, 2 1 1≤n≤3 1 1, 2 0 –2.828
NB-A2150 ≤n≤
2.828
NB-A2000 1 1, 2 1 1≤n≤3 1 1, 2 0 –5.12
≤n≤
5.12
5102 Devices 1 1, 2, 3, 1 1≤n≤3 1 1, 2, 3, 0 –5≤n≤5
6 4
5911, 5912 1 1, 2, 3, 1 1≤n≤3 1 1, 2, 3, 0 –10≤n≤
6 4 10
DSA Devices 1 1, 2, 3 1 1≤n≤3 1 1≤n≤4 0 –42≤n≤
42
* DS = Default Setting; R = Range
Table 18-11. Device-Specific Settings and Ranges for the AI Trigger Config VI (Part 2)
Additional Trigger
Specifications Cluster
Trigger Source
(Analog) Window Size Coupling
Default Default Default
Device Setting Range Setting Range Setting Range
AT-MIO-16E-1 0 0≤n≤15, 0 0≤n≤20 no support
AT-MIO-16E-2 PFI0
NEC-MIO-16E-4
PCI-MIO-16E-1
PCI-MIO-16E-1
PCI-MIO-16XE-10
AT-MIO-64E-3 0 0≤n≤63, 0 0≤n≤20 no support
PFI0
NB-A2000 0 0 ≤n≤ 3 no support 2 1, 2
NB-A2100 0 0 ≤n ≤3 0 0 ≤n≤ 1 1, 2
NB-A2150 5.656
5102 Devices 0 1, 1, 0 0 ≤n≤ 10 1 1, 2
TRIG
PCI-6110E 0 0 ≤n≤ 4 0 0 ≤n≤ 80 1 1, 2
PFI0
PCI-6111E 0 0 ≤n≤ 2 0 0 ≤n≤ 80 1 1, 2
PFI0
4451, 4551 0 0, 1 0 0 ≤n≤ 84 no support
4452, 4552 0 0 ≤n≤ 4 0 0 ≤n≤ 84 no support
All Other Devices no support no support no support
Table 18-12. Device-Specific Settings and Ranges for the AI Trigger Config VI (Part 3)
Table 18-13. Device-Specific Settings and Ranges for the AI Trigger Config VI (Part 4)
You can access the Easy Analog Output VIs by choosing Functions»
Data Acquisition»Analog Output. The Easy Analog Output VIs are the
VIs on the top row of the Analog Output palette, as shown below.
AO Generate Waveform
Generates a voltage waveform on an analog output channel at the specified update rate.
AO Generate Waveforms
Generates multiple waveforms on the specified analog output channels at the specified
update rate.
If an error occurs, a dialog box appears, giving you the option to stop the VI or continue.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel numbers you can use with
your DAQ device.
AO Update Channel
Writes a specified value to an analog output channel.
The AO Update Channel VI writes a single update to an analog output channel. If an error
occurs, a dialog box appears, giving you the option to stop the VI or continue.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel numbers and output limits
available with your DAQ device.
AO Update Channels
Writes values to each of the specified analog output channels.
The AO Update Channels VI updates multiple analog output channels with single values. If
an error occurs, a dialog box appears, giving you the option to stop the VI or continue.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel numbers you can use with
your DAQ device.
Intermediate
Analog Output VIs
Handling Errors
LabVIEW makes error handling easy with the Intermediate Analog Output
VIs. Each intermediate-level VI has an error in input cluster and an error
out output cluster. The clusters contain a Boolean that indicates whether an
error occurred, the error code for the error, and the name of the VI that
returned the error. If error in indicates an error, the VI returns the error
information in error out and does not continue to run.
Note The AO Clear VI is an exception to this rule—this VI always clears the acquisition
regardless of whether error in indicates an error.
When you use any of the Intermediate Analog Output VIs in a While Loop,
you should stop the loop if the status in the error out cluster reads TRUE.
If you wire the error cluster to the General Error Handler VI, the VI
deciphers the error information and describes the error to you.
AO Clear
Clears the analog output task associated with taskID in.
The AO Clear VI always clears the generation regardless of whether error in indicates
an error.
AO Config
Configures the channel list and output limits, and allocates a buffer for analog output
operation.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges and output limits
available with your DAQ device.
AO Start
Starts a buffered analog output operation. This VI sets the update rate and then starts the
generation.
AO Wait
Waits until the waveform generation of the task completes before returning.
Use the AO Wait VI to wait for a buffered, finite waveform generation to finish before calling
the AO Clear VI. The AO Wait VI checks the status of the task at regular intervals by calling
the AO Write VI and checking its generation complete output. The AO Wait VI waits
asynchronously between intervals to free the processor for other operations. The VI calculates
the wait interval by dividing the check every N updates input by the update rate. You should
not use the AO Wait VI when you generate data continuously, because the generation never
finishes. The AO Clear VI stops a continuous waveform generation.
AO Write
Writes data into the buffer for a buffered analog output operation.
Handling Errors
LabVIEW makes error handling easy with the intermediate-level Analog
Output Utility VIs. Each intermediate-level VI has an error in input cluster
and an error out output cluster. The clusters contain a Boolean that
indicates whether an error occurred, the error code for the error, and the
name of the VI that returned the error. If error in indicates an error, the VI
returns the error information in error out and does not continue to run.
When you use any of the Analog Output Utility VIs in a While Loop, you
should stop the loop if the status in the error out cluster reads TRUE. If
you wire the error cluster to the General Error Handler VI, the VI deciphers
the error information and describes the error to you.
AO Continuous Gen
Generates a continuous, timed, circular-buffered waveform for the given output channels at
the specified update rate. The VI updates the output buffer continuously as it generates the
data. If you simply want to generate the same data continuously, use the AO Waveform Gen
VI instead.
You use the AO Continuous Gen VI when your waveform data resides on
disk and is too large to hold in memory, or when you must create your
iteration
terminal
waveform in real time. Place the VI in a While Loop and wire the iteration
terminal to the VI iteration input.
Note If your program iterates more than 2 31 –1 times, do not wire this VI iteration
terminal to the loop iteration terminal. Instead, set iteration to 0 on the first loop,
then to any positive value on all other iterations. The VI reconfigures and restarts
if iteration ≤ 0.
Also wire the condition that terminates the loop to the VI's clear acquisition input, inverting
the signal if necessary so that it is TRUE on the last iteration. On iteration 0, the VI calls the
AO Config VI to configure the channel group and hardware and to allocate a buffer for the
data. It also calls the AO Write VI to write the given data into the buffer, and then the AO Start
VI to set the update rate and start the signal generation. On each subsequent iteration, the VI
calls the AO Write VI to write the next portion of data into the buffer at the current write
position. On the last iteration (when clear generation is TRUE) or if an error occurs, the VI
also calls the AO Clear VI to clear any generation in progress. Although it is not normally
necessary, you can call the AO Continuous Gen VI outside of a loop (that is, to call it only
once). But if you do, leave the iteration and clear generation inputs unwired.
The first call to the AO Write VI sets allow regeneration to TRUE, so that the same data can
be generated more than once. If you change allow regeneration to FALSE, you must write
new data fast enough that new data is always available to be generated. If you do not fill the
buffer fast enough, you get a regeneration error. To correct this problem, decrease the update
rate, increase the buffer size, increase the amount of data written each time, or write data
more often.
If you set allow regeneration to FALSE, and your device has an analog output FIFO, your
buffer size must be at least twice as big as your FIFO.
If an error occurs, the VI calls the AO Clear VI to clear any generation in progress, then
passes the unmodified error information to error out. If an error occurs inside the AO
Continuous Gen VI, the AO Clear VI clears any generation in progress and passes its
error information out.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges and output limits
available with your DAQ device.
Note The AO Continuous Gen VI uses an uninitialized shift register as local memory to
remember the taskID of the output operation between calls. You normally use this
VI in one place on a diagram, but if you use it in more than one place, the multiple
instances of the VI share the same taskID. All calls to this VI configure, write
data, or clear the same generation. Occasionally, you may want to use this VI
in multiple places on the diagram but have each instance refer to a different
taskID (for example, when you want to generate waveforms with two devices
simultaneously). Save a copy of this VI with a new name (for example,
AO Continuous Gen R) and make your new VI reentrant.
AO Waveform Gen
Generates a timed, simple-buffered or circular-buffered waveform for the given output
channels at the specified update rate. Unless you perform indefinite generation, the VI returns
control to the LabVIEW diagram only when the generation completes.
If you place this VI in a loop to generate multiple waveforms with the same
group of channels, wire the iteration terminal to the VI iteration input.
iteration
terminal
Note If your program iterates more than 2 31 –1 times, do not wire this VI iteration
terminal to the loop iteration terminal. Instead, set the iteration value to 0 on the
first loop, then to any positive value on all other iterations. The VI reconfigures
and restarts if iteration ≤ 0.
On iteration 0, the VI calls the AO Config VI to configure the channel group and hardware
and to allocate a buffer for the data. On each iteration, the VI calls the AO Write VI to write
the data into the buffer, then the AO Start VI to set the update rate and start the generation. If
you call the AO Waveform Gen VI only once, you can leave iteration unwired. The iteration
parameter defaults to 0, which tells the VI to configure the device before starting the
waveform generation.
If an error occurs, the VI calls the AO Clear VI to clear any generation in progress, then passes
the error information unmodified through error out. If an error occurs inside the AO
Waveform Gen VI, it clears any generation in progress and passes its error information out.
Note The AO Waveform Gen VI uses an uninitialized shift register as local memory to
remember the taskID of the output operation between calls. You normally use this
VI in one place on your diagram, but if you use it in multiple places, all instances
of the VI share the same taskID. All calls to this VI configure, write data, or clear
the same generation. Occasionally, you may want to use this VI in multiple places
on the diagram, but have each instance refer to a different taskID. Save a copy of
this VI with a new name (for example, AO Waveform Gen R) and make the new
VI reentrant.
Note If your program iterates more than 2 31 –1 times, do not wire this VI iteration
terminal to the loop iteration terminal. Instead, set the iteration value to 0 on the
first loop, then to any positive value on all other iterations. The VI reconfigures
and restarts if iteration ≤0.
On iteration 0, the VI calls the AO Config VI to configure the channel group and hardware,
then calls the AO Single Update VI to write the voltage to the output channels. On future
iterations, the VI calls only the AO Single Update VI, avoiding unnecessary configuration. If
you call the AO Write One Update VI only once to write a single value to each channel, leave
the iteration input unwired. Its default value of 0 tells the VI to perform the configuration
before writing any data.
Hardware Capabilities,
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges, output limits, and
scanning order available with your DAQ device.
Note The AO Write One Update VI uses an uninitialized shift register as local memory
to remember the taskID for the group of channels when calling between VIs.
Usually, this VI appears in one place on your diagram. However, if you use it
in more than one place, the multiple instances of the VI share the same taskID.
All calls to this VI configure or write data to the same group. If you want to use
this VI in more than one place on your diagram, and want each instance to refer
to a different taskID (for example, to write data with two devices at the same time),
you should save a copy of this VI with a new name (for example, AO Write One
Update R) and make your new VI reentrant.
Advanced
Analog Output VIs
AO Buffer Config
Allocates memory for an analog output buffer. If you are using interrupts, you can allocate a
series of analog output buffers and assign them to a group by calling the AO Buffer Config
VI multiple times. Each buffer can have its own size. If you are using DMA, you may allocate
only one buffer.
Use the number you assign to the buffer with this VI when you need to refer to this buffer for
other VIs.
AO Buffer Write
Writes analog output data to buffers created by the AO Buffer Config VI.
You wire the new data to one of three inputs—scaled data, binary data, or DSP memory
handle. The VI searches these inputs in that order for the first array with a length greater than
zero. The VI then writes the data from this array to the output buffer. The length of the scaled
data or binary data arrays determines the number of updates the VI writes. If DSP memory
handle points to the source of the data, updates to write must indicate how many updates the
VI is to write. When no data is wired, this VI is still useful for reporting update progress
information.
The total number of updates written to a buffer before you start it can be less than the number
of updates you allocated the buffer to hold when you called the AO Buffer Config VI.
LabVIEW generates only the updates written to the buffer.
AO Clock Config
Configures an update or interval clock for analog output.
Refer to Appendix B, DAQ Hardware Capabilities, for the clocks available with your
DAQ device.
You can express clock rates three ways—with ticks per second, seconds per tick, or the three
timebase parameters. The VI searches these parameters in that order and expresses clock rates
on the first parameter with a wired valid input. When you configure an update clock, one tick
equals one update. When you configure the interval clock, one tick equals one interval.
AO Control
Starts, pauses, resumes, and clears analog output tasks.
AO Group Config
Assigns a list of analog output channels to a group number and produces the taskID that all
the other analog output VIs use.
Refer to Appendix B, DAQ Hardware Capabilities, for the channels available with your
DAQ device.
AO Hardware Config
Configures the limits (polarity and reference) and whether data for a given channel is
expressed in volts milliamperes if you are using channel numbers. This VI always returns the
current settings for all the channels in the group.
Refer to Appendix B, DAQ Hardware Capabilities, for the channel ranges, and output limits
available with your DAQ device.
AO Parameter
Sets miscellaneous parameters associated with the Analog Output operation of the devices
that are not covered with other Analog Output VIs.
AO Single Update
Performs an immediate update of the channels in the group.
The Easy Digital I/O VIs are the VIs on the top row of the Digital I/O
palette. For examples of how to use the Easy Digital I/O VIs, open the
example library by opening examples\daq\digital\digital.llb.
If an error occurs, a dialog box appears, giving you the option to stop the VI or continue.
Note When you call this VI on a digital I/O port that is part of an 8255 PPI when your
iteration terminal is left at 0, the 8255 PPI goes through a configuration phase,
where all the ports within the same PPI chip get reset to logic low, regardless of
the data direction. The data direction on other ports, however, is maintained. To
avoid this effect, connect a value other than 0 to the iteration terminal once you
have configured the desired ports.
If an error occurs, a dialog box appears, giving you the option to stop the VI or continue.
Note When you call this VI on a digital I/O port that is part of an 8255 PPI when your
iteration terminal is left at 0, the 8255 PPI goes through a configuration phase,
where all the ports within the same PPI chip get reset to logic low, regardless of
the data direction. To avoid this effect, connect a value other than 0 to the iteration
terminal once you have configured the desired ports.
If an error occurs, a dialog box appears, giving you the option to stop the VI or continue.
Note When you call this VI on a digital I/O port that is part of an 8255 PPI when your
iteration terminal is left at 0, the 8255 PPI goes through a configuration phase,
where all the ports within the same PPI chip get reset to logic low, regardless of
the data direction. The data direction on other ports, however, is maintained. To
avoid this effect, connect a value other than 0 to the iteration terminal once you
have configured the desired ports.
If an error occurs, a dialog box appears, giving you the option to stop the VI or continue.
Note When you call this VI on a digital I/O port that is part of an 8255 PPI when your
iteration terminal is left at 0, the 8255 PPI goes through a configuration phase,
where all the ports within the same PPI chip get reset to logic low, regardless of
the data direction. The data direction on other ports, however, is maintained. To
avoid this effect, connect a value other than 0 to the iteration terminal once you
have configured the desired ports.
You combine the other VIs—DIO Config, DIO Start, DIO Read,
DIO Write, DIO Wait, and DIO Clear—to build more demanding
applications using buffered digital reads and writes. Your device must
support handshaking to use these VIs.
All the VIs described in this chapter are built from the fundamental building
block layer, the advanced-level VIs.
You can access the Intermediate Digital I/O VIs by choosing Functions»
Data Acquisition»Digital I/O. The Intermediate Digital I/O VIs are the
VIs on the second and third rows of the Digital palette, as shown below.
Intermediate
Digital I/O VIs
Handling Errors
LabVIEW makes error handling easy with the Intermediate Digital I/O VIs.
Each intermediate-level VI has an error in input cluster and an error out
output cluster. The clusters contain a Boolean that indicates whether an
error occurred, the error code for the error, and the name of the VI that
returned the error. If error in indicates an error, the VI returns the error
information in error out and does not continue to run.
Note The DIO Clear VI is an exception to this rule—this VI always clears the
acquisition regardless of whether error in indicates an error.
When you use any of the Intermediate Digital I/O VIs in a While Loop, you
should stop the loop if the status in the error out cluster reads TRUE. If you
wire the error cluster to the General Error Handler VI, the VI deciphers the
error information and describes the error to you.
DIO Clear
Calls the Digital Group Buffer Control VI to halt a transfer and clear the group.
DIO Config
The DIO Config VI calls the advanced Digital Group Config VI to assign a list of ports to the
group, establish the group's direction, and produce the taskID. The VI then calls the Digital
Mode Config VI to establish the handshake parameters, which only affect the operation of the
DIO-32 devices. Finally, the VI calls the Digital Buffer Config VI to allocate a buffer to hold
the scans as they are read or the updates to be written.
Refer to Appendix B, DAQ Hardware Capabilities, for the ports and directions available with
your DAQ device.
DIO Read
Calls the Digital Buffer Read VI to read data from the internal transfer buffer and returns the
data read in pattern.
DIO Start
Starts a buffered digital I/O operation. This VI calls the Digital Clock Config VI to set the
clock rate if the internal clock produces the handshake signals, and then starts the data transfer
by calling the Digital Buffer Control VI.
DIO Wait
Waits until the digital buffered input or output operation completes before returning.
For input, the VI detects completion when the acquisition state returned by the Digital Buffer
Read VI finishes with or without backlog. For output, the VI detects completion when the
generation complete indicator of the DIO Write VI is TRUE.
Refer to Appendix B, DAQ Hardware Capabilities, for the handshake modes available with
your DAQ device.
DIO Write
Calls the Digital Buffer Write VI to write to the internal transfer buffer.
(Macintosh) You must fill the buffer with data before you use the DIO Start VI to begin the
digital output operation. You can call the DIO Write VI after the transfer begins to retrieve
status information.
Advanced
Digital I/O VIs
Refer to Appendix B, DAQ Hardware Capabilities, for the ports and directions available with
your DAQ device.
(Macintosh) Fill the buffer with data before you use the Digital Buffer Control VI to begin the
digital output operation. You can call the Digital Buffer Write VI after the transfer begins to
retrieve status information.
The total number of updates written to a buffer before you start it can be less than the number
of updates you allocated the buffer to hold when you called the Digital Buffer Config VI.
The VI generates only the updates written to the buffer.
Refer to Appendix B, DAQ Hardware Capabilities, for the clocks available with your
DAQ device.
The following example illustrates how to use the three timebase parameters to specify a clock
rate. Assume these parameters have the following settings:
timebase source: 1
timebase signal: 1,000,000.0 Hz
timebase divisor: 25
In this case, the ticks per second rate is 1,000,000.0 divided by 25, so LabVIEW updates the
digital group 40,000 times per second.
Refer to Appendix B, DAQ Hardware Capabilities, for the ports and directions available with
your DAQ device.
Note The same digital channel cannot belong to two different groups. If you configure
a group to use a specified digital channel, that digital channel must be one that is
not already defined in another group or you will get an error.
MIO devices (except for the AT-MIO-16D and the AT-MIO-16DE-10), as well as the
NB-TIO-10, LPM devices, DAQCard-500, 516 devices, DAQCard-700, PC-TIO-10,
AO-2DC devices, PC-OPDIO-16, and AT-AO-6/10, do not allow handshaking. The digital
port VIs are more appropriate for these devices. Handshaking is not allowed if digital
channel list is composed of channel names. The AT-MIO-16D and AT-MIO-16DE-10 do not
allow handshaking if digital channel list includes ports 0, 1, and/or 4. The DIO-96 devices
do not allow handshaking if digital channel list includes ports 2, 5, 8, and/or 11. The DIO-24
and Lab and 1200 Series devices do not allow handshaking if digital channel list includes
port 2. The DIO-32F allows handshaking for the following configurations only:
• A group containing any one port
• A group containing ports 0 and 1, or ports 2 and 3, in that order
• A group containing ports 0, 1, 2, and 3, in that order
Refer to Appendix B, DAQ Hardware Capabilities, for the handshake modes available with
your DAQ device.
DIO Parameter
Configures and retrieves miscellaneous parameters associated with digital input and output
that are not configured by other DIO VIs.
Table 25-1 lists device specific parameters and legal ranges for devices.
Table 25-1. Device Specific Parameters and Legal Ranges for Devices
VXI-DIO-128 0: Input Port per input yes channels, float in, N/A N/A
Logic port float out
Threshold
DAQ-DIO-653 1: ACK/Req per group yes taskID in, value Off, On N/A
(DIO- 32HS) Exchange in, value out
This chapter describes the high-level VIs for programming counters on the
MIO, TIO, and other devices with the DAQ-STC or Am9513 counter/timer
chips. These VIs call the Intermediate Counter VIs to generate a single
delayed TTL pulse, a finite or continuous train of pulses, and to measure
the frequency, pulse width, or period of a TTL signal.
Note These VIs do not work with Lab and 1200 Series devices, DAQCards, and other
devices that have the 8253/54 chip. Use the intermediate-level ICTR Control for
those devices. Refer to Chapter 27, Intermediate Counter VIs, for more
information on the ICTR Control VI.
Some of these VIs use other counters in addition to the one specified.
In this case, a logically adjacent counter is chosen, which is referred to as
counter+1 when it is the adjacent, logically higher counter and counter–1
when it is the adjacent, logically lower counter.
For a device with the Am9513 chip, if the counter is 1, then counter+1 is
counter 2 and counter–1 is counter 5.
For examples of how to use the Easy Counter VIs, open the example
libraries located in examples\daq\counter.
To count events, set event source/timebase to 0.0 and connect the signal you want to count
to the SOURCE pin of the counter. To count time, set this control to the timebase frequency
you want to use.
This VI uses only the specified counter to generates a continuous pulse. For a finite-length
pulse, the VI also uses counter–1 to generate a minimum-delayed pulse to gate counter.
To generate another pulse train, execute the intermediate Counter Start VI with the taskIDs
supplied by this VI. To stop a continuous pulse train, execute the intermediate Counter Stop
VI or execute this counter again to generate one, short pulse. You must externally wire
counter–1’s OUT pin to counter’s GATE pin for a finite-length pulse train. You can
optionally gate or trigger the start of the train with a signal on counter–1’s GATE pin.
Note A pulse train consists of a series of delayed pulses, where phase 1 or the first phase
of each pulse is the inactive state of the output (low for a high pulse) and the
phase 2 of the second phase is the pulse itself.
Measure Frequency
Measures the frequency of a TTL signal on the specified counter’s SOURCE pin by counting
positive edges of the signal during a specified period of time. In addition to this connection,
you must wire counter’s GATE pin to the OUT pin of counter–1. This VI is useful for
relatively high frequency signals, when many cycles of the signal occur during the timing
period. Use the Measure Pulse Width or Period VI for relatively low frequency signals. Keep
in mind that period(s) = 1/frequency (Hz).
This VI configures the specified counter and counter+1 (optional for Am9513) as event
counters to count rising edges of the signal on counter’s SOURCE pin. The VI also configures
counter–1 to generate a minimum-delayed pulse to gate the event counter, starts the event
counter and then the gate counter, waits the expected gate period, and then reads the gate
counter until its output state is low. Next the VI reads the event counter and computes the
signal frequency (number of events/actual gate pulse width) and stops the counters. You
can optionally gate or trigger the operation with a signal on counter–1’s GATE pin.
The VI iterates until a valid measurement, timeout, or counter overflow occurs. A valid
measurement exists when count ≥ 4 without a counter overflow. If counter overflow occurs,
lower timebase. If you start a pulse width measurement during the phase you want to
measure, you get an incorrect low measurement. Therefore, make sure the pulse does not
occur until after counter is started. This restriction does not apply to period measurements.
This chapter also describes the ICTR Control VI that you use with Lab and
1200 Series and PC-LPM devices that contain the 8253/54 counter/timer
chip.
Handling Errors
LabVIEW makes error handling easy with the Intermediate Counter VIs.
Each intermediate-level VI has an error in input cluster and an error out
output cluster. The clusters contain a Boolean that indicates whether an
error occurred, the error code for the error, and the name of the VI that
returned the error. If error in indicates an error, the VI returns the error
information in error out and does not continue to run.
When you use any of the Intermediate Counter VIs in a While Loop, you
should stop the loop if the status in the error out cluster reads TRUE. If you
wire the error cluster to the General Error Handler VI, the VI deciphers the
error information and describes the error to you.
Adjacent Counters
Identifies the counters logically adjacent to a specified counter of an MIO or TIO device.
It also returns the counter size (number of bits) and the timebases.
Devices with the Am9513 chip have one or two sets of five, 16-bit counters (1–5, 6–10) that
can be connected in a circular fashion. For example, the next higher counter to counter 1
(called counter+1) is 2 and the next lower one (called counter–1) is 5.
The signal is created by repeatedly decrementing the counter twice, first for the delay to the
pulse (phase 1), then for the pulse itself (phase two). The VI selects the highest resolution
timebase to achieve the desired characteristics. You can optionally gate or trigger the
operation with a signal on the counter’s GATE pin. Call the Counter Start VI to start the pulse
train or to enable it to be gated.
Counter Read
Reads the counter or counters identified by taskID.
The VI is designed to read one counter or two concatenated counters of an Am9513 counter
chip or to read one counter of a DAQ-STC counter chip.
Counter Start
Starts the counters identified by taskID.
Counter Stop
Stops a count operation immediately or conditionally on an input error.
The signal is created by decrementing counter twice, first for the delay to the pulse (called
phase 1), then for the pulse itself (phase 2). If an internal timebase is chosen, the VI selects
the highest resolution timebase for counter to achieve the desired characteristics. If an
external timebase signal is chosen, the user designates the delay and width as cycles of that
signal. You can optionally gate or trigger the operation with a signal on counter’s GATE pin.
Call the Counter Start VI to start the pulse or enable it to be gated.
You can use this VI to generate finite pulse trains by enabling a continuous pulse generator
until the desired number of pulses has occurred. You can also use it in place of the Continuous
Pulse Generator Config VI to generate a train of strobe or trigger signals.
When the internal timebase is used, this VI works like the Tick Count (ms) function but uses
a hardware counter on the DAQ device with programmable resolution. You can optionally
gate or trigger the operation with a signal on the counter’s GATE pin. Call the Counter Start
VI to start the operation or enable it to be gated.
ICTR Control
Controls counters on devices that use the 8253/54 chip, including:
• Lab and 1200 Series devices, DAQCard-500, and DAQCard-700
• (Windows) LPM devices, 516 devices
In setup mode 0, as shown in Figure 27-1, the output becomes low after the mode set
operation, and counter begins to count down while the gate input is high. The output becomes
high when counter reaches the TC (that is, when the counter decreases to 0) and stays high
until you set the selected counter to a different mode.
In setup mode 1, as shown in Figure 27-2, the output becomes low on count following the
leading edge of the gate input and becomes high on TC.
In setup mode 2, as shown in Figure 27-3, the output becomes low for one period of the clock
input. The count indicates the period between output pulses.
In setup mode 3, the output stays high for one-half of the count clock pulses and stays low
for the other half. Refer to Figure 27-4.
In setup mode 4, as in Figure 27-5, the output is initially high, and counter begins to count
down while the gate input is high. On TC, the output becomes low for one clock pulse, then
becomes high again.
Setup mode 5 is similar to mode 4, except that the gate input triggers the count to start.
See Figure 27-6 for an illustration of mode 5.
See the 8253 Programmable Interval Timer data sheet in your lab device user manual for
details on these modes and their associated timing diagrams.
The measurement is done by counting the number of cycles of the specified timebase between
the appropriate starting and ending events. To accurately measure pulse width, the pulse must
occur after counter is started. Call the Counter Start VI to start the operation. You can also
use this VI to measure the frequency of low frequency signals. For more accurate
measurements, use a faster timebase.
Wait+ (ms)
Calls the Wait (ms) function only if no input error exists.
This VI is useful when you want to wait between calls to I/O subVIs that use the error I/O
mechanism; without it you need to use a Sequence Structure to control the execution order.
Note Use only the inputs that you need on each VI when working with data acquisition.
Leave the rest of the inputs unwired, and LabVIEW sets them to their default
values. In the Help window, the most important terminals are labeled in bold, and
the least commonly used are in brackets. Values given in parentheses are default
values.
The following lists the type of counter chips that your device must have to
work with your version of LabVIEW:
• DAQ-STC Counter Chip
• Am9513 Counter Chip
• 8253/54 Counter Chip
The ICTRControl VI is the only VI that works with devices that contain the
8253/54 counter chip.
Refer to Table 28-1 for the counter chips used with the various devices.
Counter
Chip DAQ Device
Am9513 AT-MIO-16, AT-MIO-16D, AT-MIO-16F-5,
AT-MIO-16X, AT-MIO-64F-5, PC-TIO-10, All AO-2DC
Devices, EISA-A2000, NB-MIO-16, NB-MIO-16X,
NB-DMA-8-G, NB-DMA2800, NB-TIO-10, NB-A2000
DAQ-STC All E Series Devices, 5102 Devices
8253/54 All Lab and 1200 Series Devices, DAQCard-500,
DAQCard-700, LPM Devices, 516 Devices
Note Incremental reading from the count buffer is supported. However, circular use of
the buffer is not implemented. Therefore, you must set up a finite buffer. You can
read from the finite buffer as it fills.
Table 28-2 contains valid counter numbers for devices supported by this VI.
Table 28-2. Valid Counter Numbers for CTR Group Config Devices
This VI does not start the counters. Use CTR Control VI with control code 1 (Start) to start
the counters. If you are using a counter for pulse generation, you do not have to call this VI
unless you want to change gate mode or output behavior.
Modes 3, 4, and 6 can be used with or without buffered counting. Mode 7 must be used with
buffered counting. With buffered counting, call the CTR Buffer Config VI before or after the
CTR Mode Config VI and before the CTR Control VI to start the operation, then call the CTR
Buffer Read VI to read the buffered count values. With buffered or unbuffered operations, call
the CTR Control VI to read the most recently acquired, unbuffered count value.
Unless otherwise stated, the following figures show timing and counter values for operations
in which gate mode is set to high-level or rising-edge and source edge is set to rising-edge.
Use mode 1 to reset all the CTR Mode Config VI parameters to their default settings.
This mode overrides any conflicting parameter settings.
Use mode 2 to count transitions of the selected signal and to stop at the first TC. The overflow
status bit is set at TC. Use the CTR Control VI to read the overflow status. This mode is
available only with Am9513 devices. Mode 2 counting is unbuffered. Figure 28-1 shows the
count values you would read with this mode using two gate mode settings (high-level gating
and rising-edge gating).
Use mode 3 to count transitions of the selected signal continuously, rolling over at TC and
then continuing on. Figure 28-1 shows unbuffered mode 3 counting. Figure 28-2 illustrates a
buffered mode 3 operation with rising-edge gating. This buffered operation is available only
with DAQ-STC devices. With buffered mode 3 operation, LabVIEW stores the current count
value into the buffer on each selected edge of the source signal.
Use mode 4 with level gating to measure pulse width and with edge gating to measure the
period of the selected gate signal.
Note For the following descriptions of pulse width measurements (modes 4, 6, and 7),
a high pulse is defined simply as the high-level phase of a signal when gate mode
is set to high-level gating. This definition differs from that of a high pulse using
pulse generation (mode 5), which consists of a low-level delay phase followed by a
high-level pulse phase. (Low pulses are similarly defined by switching the words
high and low.)
To measure pulse width, set gate mode to high or low level. Figure 28-3 shows unbuffered
mode 4 pulse width measurements. You can start an Am9513 counter at any time, and it
measures pulses until you stop it. If you start it in the middle of the pulse you want to measure
(for example, during a high pulse for high-level gating), LabVIEW returns a short count for
that measurement. You must start a DAQ-STC counter only when the signal is in the opposite
polarity from the selected gate level (for example, a low-level phase for high-level gating).
Otherwise, the VI returns error number –10890. With unbuffered counting, the DAQ-STC
stops counting after one measurement. Mode 5 configures the counter for pulse generation.
Use the CTR Pulse Config VI to specify the pulse you want to generate.
Figure 28-4 shows the buffered mode 4 pulse width measurement, which is available only
with DAQ-STC devices. The measured value is stored into the buffer at the end of each pulse.
See mode 6 for another way to measure pulse width with a DAQ-STC device.
To measure period, set gate mode to rising or falling edge. Figure 28-5 shows unbuffered
mode 4 pulse width measurement.
You may start either an Am9513 or a DAQ-STC counter at any time. The counter begins
counting at the start of the next period. The Am9513 counter measures periods continuously.
With unbuffered counting, the DAQ-STC stops counting after one measurement.
Figure 28-6 shows buffered mode 4 period measurement, which is available only with
DAQ-STC devices. The measured value is stored into the buffer at the end of each period.
Use mode 5 to configure for pulse generation when you also need to configure gate mode,
output type, or output polarity to non-default values. Otherwise, avoid calling the
CTR Mode Config VI and use only the CTR Pulse Config VI for pulse generation. See the
CTR Pulse Config VI for additional information about this operation.
Use mode 6 with level gating to measure the pulse width of the selected signal. This mode is
available only with DAQ-STC devices. Mode 6 differs from mode 4 in that the measurement
of a high (low) pulse does not begin until the first falling (rising) edge of the signal after you
start the counter. If you use unbuffered counting, the counter continues to measure pulses until
you call the CTR Control VI to read the most recently measured value, at which time the
counter stops. Unbuffered mode 6 counting is illustrated in Figure 28-7.
With buffered mode 6 counting, the measured value is stored into the buffer at the end of each
pulse, as illustrated with Figure 28-8. Call the CTR Buffer Read VI to read the values.
Figure 28-8. Buffered Mode 6 High Pulse Width Measurement (Count on Rising Edge of Source)
Use mode 7 to measure every phase of the selected signal using buffered counting. This mode
is available only with DAQ-STC devices. The count value is stored in the buffer on each
low-to-high and high-to-low transition. Use the CTR Buffer Read VI to read the values.
To measure period with this mode, sum successive pairs of signals. To measure phase, use
every other value. LabVIEW ignores the value of gate mode with mode 7, which means that
you cannot tell whether the first measurement starts at a rising or falling edge.
Table 28-3 shows the legal values and default settings for timebase signal. A value of -1 tells
LabVIEW to use the default settings. When the table says counter, it refers to the counter
being configured. If there are multiple counters, LabVIEW configures each counter
successively.
Refer to Table 28-3 to determine what is the next higher or lower consecutive counter.
Am9513 5 1 2
1 2 3
2 3 4
3 4 5
4 5 1
10 6 7
6 7 8
7 8 9
8 9 10
9 10 6
1 0 1
DAQ-STC
0 1 0
Use this VI to specify the characteristics of your pulses. You can also use the CTR Mode
Config VI to set your desired gate modes, output polarity, and output type. Use the CTR Pulse
Config VI to specify timebase source and timebase signal for pulse generation, because
LabVIEW ignores these values specified in the CTR Mode Config VI.
CTR Control
Controls and reads groups of counters. Control operations include starting, stopping, and
setting the output state.
ICTRControl
Controls counters on devices that use the 8253 chip (Lab and 1200 Series devices,
516_devices PC-LPM-16, DAQCard-500, and DAQCard 700).
This chapter also includes a VI for controlling the RTSI bus, which is a
triggering and timing bus you can use to synchronize, time, and trigger
multiple DAQ devices.
(Windows) There is also a VI you can use to set up data acquisition event
occurrences.
You can calibrate certain DAQ devices with the device-specific VIs, but this
is not always necessary because National Instruments calibrates all devices
at the factory.
1200 Calibrate
This VI calibrates the gain and offset values for the ADCs and DACs on 1200 Series devices
(i.e., DAQPad-1200, DAQCard-1200, etc.).
You can perform a new calibration (and optionally save the new calibration constants in one
of four user areas in the onboard EEPROM) or load an existing set of calibration constants by
copying them from their storage location in the onboard EEPROM. LabVIEW automatically
loads the calibration constants stored in the onboard EEPROM load area when LabVIEW
launches or when you reset the device. By default the EEPROM load area contains a copy of
the calibration constants in the factory area
A2000 Calibrate
Calibrates the NB-A2000 or EISA-A2000 A/D gain and offset values or restores them to the
original factory-set values.
You can calibrate your NB-A2000 or EISA-A2000 to adjust the accuracy of the readings from
the four analog input channels. LabVIEW automatically loads the stored calibration values
when it launches or when you reset your NB-A2000 or EISA-A2000.
Warning This VI is supported only up to NI-DAQ version 4.9.0 and has been removed from
the Calibration and Configuration palette. This VI is still included in the DAQ VI
Library for compatibility only, therefore if you are using NI-DAQ version 5.0 or
later, this VI will return the following message: deviceSupportError. If you
wish to use this VI, please reinstall NI-DAQ version 4.9.0 or an earlier version.
Refer to Appendix B, DAQ Hardware Capabilities, for more information on the NB-A2000
or EISA-A2000 DAQ devices.
Warning Read the calibration chapter in the NB-A2000 or EISA-A2000 User Manual before
using the A2000 Calibrate VI.
If you set save new values to 1, then this VI stores the gain and offset calibration values in
an EEPROM on the NB-A2000 or EISA-A2000 device, which does not lose its data even if
the device loses power. LabVIEW reads these EEPROM values and loads them into the
NB-A2000 or EISA-A2000, you can choose to replace the permanent copies of the gain
and offset EEPROM values and use the new values until the next calibration, even if you
reinitialize the device. You can also choose not to replace the EEPROM values, but to use
the new values until the next calibration or initialization.
For example, if you consistently get inaccurate readings from one or more input channels after
you reset the device, you can calibrate and save the new gain and offset values as permanent
copies in the EEPROM. However, if acquisition results are accurate after initialization but
start to drift after a few hours of device operation when the device temperature increases, you
can calibrate the device at this operating temperature and retain the current EEPROM values
to use after the next initialization.
A2000 Configure
Configures dithering and whether to drive the SAMPCLK* line for the NB-A2000 or
EISA-A2000.
Warning This VI is supported only up to NI-DAQ version 4.9.0 and has been removed from
the Calibration and Configuration palette. This VI is still included in the DAQ VI
Library for compatibility only, therefore if you are using NI-DAQ version 5.0 or
later, this VI will return the following message: deviceSupportError. If you
wish to use this VI, please reinstall NI-DAQ version 4.9.0 or an earlier version.
Refer to Appendix B, DAQ Hardware Capabilities, for more information on the NB-A2000
or EISA-A2000 DAQ devices.
A2100 Calibrate
Selects the desired calibration reference and performs an offset calibration cycle on the ADCs
on the NB-A2100 or the NB-A2150.
Warning This VI is supported only up to NI-DAQ version 4.9.0 and has been removed from
the Calibration and Configuration palette. This VI is still included in the DAQ VI
Library for compatibility only, therefore if you are using NI-DAQ version 5.0 or
later, this VI will return the following message: deviceSupportError. If you
wish to use this VI, please reinstall NI-DAQ version 4.9.0 or an earlier version.
NI-DAQ driver software calibrates the two A/D channels using the analog input ground as the
reference for each channel when you turn on the computer.
A2100 Config
Selects the signal source used to provide data to the DACs and lets you configure the external
digital trigger to be shared by data acquisition and waveform generation operations on the
NB-A2100.
Warning This VI is supported only up to NI-DAQ version 4.9.0 and has been removed from
the Calibration and Configuration palette. This VI is still included in the DAQ VI
Library for compatibility only, therefore if you are using NI-DAQ version 5.0 or
later, this VI will return the following message: deviceSupportError. If you
wish to use this VI, please reinstall NI-DAQ version 4.9.0 or an earlier version.
If LabVIEW acquires multiple data acquisition frames and generates multiple waveform
cycles with a trigger required at the beginning of each cycle, then the external trigger
recognition synchronizes so that each trigger simultaneously initiates the acquisition of the
next data frame while generating the output of the next waveform cycle.
A2150 Config
Selects whether or not LabVIEW should drive an internally generated trigger to the
NB-A2150 I/O connector. This VI also determines whether LabVIEW should drive the
NB-A2150 sampling clock signal over the RTSI bus to other devices for multiple-device
synchronized data acquisition.
Warning This VI is supported only up to NI-DAQ version 4.9.0 and has been removed from
the Calibration and Configuration palette. This VI is still included in the DAQ VI
Library for compatibility only, therefore if you are using NI-DAQ version 5.0 or
later, this VI will return the following message: deviceSupportError. If you
wish to use this VI, please reinstall NI-DAQ version 4.9.0 or an earlier version.
Enable io trigger drive only if you have executed the RTSI Control VI to receive the
RTSITRIG* signal over the RTSI bus, or if you have enabled the analog level trigger using
the AI Trigger Config VI. In these cases, you can monitor the signal being sent to the A/D
trigger circuitry at the EXTTRIG* line of the I/O connector after starting the acquisition.
A high-to-low edge of the signal triggers the data acquisition.
The NB-A2150 uses signals over the RTSI bus for sampling clock synchronization between
two or more NB-A2150 devices. The sampling clock synchronization circuitry makes
simultaneous sampling possible on more than four channels using additional NB-A2150
devices. If master clock is 1, slave list should contain the list of devices that accept the
sampling clock from device. After you run A2150 Config with master clock equal to 1 and
number of slaves greater than 0, you cannot use the AI Clock Config to set the scan rate for
devices in slave list until you run A2150 Config again on device with master clock equal to
1 and number of slaves equal to 0.
Note Executing A2150 Config with master clock equal to 1 and number of slaves equal
to 0 deconfigures the devices previously in the slave list and sets them up to use
their own sampling clock signal.
Warning This VI is supported only up to NI-DAQ version 4.9.0 and has been removed from
the Calibration and Configuration palette. This VI is still included in the DAQ VI
Library for compatibility only, therefore if you are using NI-DAQ version 5.0 or
later, this VI will return the following message: deviceSupportError. If you
wish to use this VI, please reinstall NI-DAQ version 4.9.0 or an earlier version.
Refer to Appendix B, DAQ Hardware Capabilities, for more information on the AT-A2150
DAQ device.
When you launch LabVIEW, or when you reset the AT-A2150, LabVIEW performs an offset
calibration using the analog ground as the reference. Use this VI only for device calibration
to an external reference or for device recalibration for ground reference after using an external
reference.
You can load an existing set of calibration constants into the calibration DACs from a storage
area in the onboard EEPROM. You can copy EEPROM storage areas 2 through 5 to storage
area 1. EEPROM area 5 contains the factory calibration constants. LabVIEW automatically
loads the calibration constants stored in EEPROM area 1 upon start-up or when you reset the
AT-AO-6/10.
Note You can also use the calibration utility provided with the AT-AO-6/10 to perform
a calibration procedure. Refer to the calibration chapter in the AT-AO-6/10 User
Manual for more information.
When LabVIEW initializes the AT-AO-6/10, the DAC calibration constants stored in
EEPROM location 1 (user calibration area 1) provide the gain and offset values that ensure
proper device operation. So, this initialization is the same as running the AO-6/10 Calibrate
VI with operation set to 1 and EEPROM location set to 1. When the AT-AO-6/10 leaves the
factory, EEPROM location 1 contains a copy of the calibration constants stored in
EEPROM location 5 (factory calibration).
A calibration procedure performed in bipolar mode is not valid for unipolar mode and vice
versa. See the calibration chapter of the AT-AO-6/10 User Manual for more information.
Channel To Index
Uses the current group configuration for the specified task to produce a list of indices into the
group’s scan or update list for each channel specified in the channel list.
You can use this list of channel indices to locate data for a particular channel within a multiple
channel buffer. You can also use the indices to read or write to a group subset with the buffer
read and write VIs.
Refer to your specific device information in Appendix B, DAQ Hardware Capabilities, for
the channel limitations that apply to your device.
Table 29-1 shows possible values for the channel scan list, channel list, and channel indices
parameters. Table 29-2 shows the possible values for the Sun. The channel scan list
parameter is an input for the group configuration VIs.
A DAQ event can be the completion of an acquisition, the acquisition of a certain number of
scans, an analog signal meeting certain trigger conditions, a periodic event, an aperiodic
(externally driven) event, or a digital pattern match or mismatch. Your VI can sleep while
waiting for an occurrence to be set, freeing your computer to execute other VIs.
When you set the create/clear control to 1 (create) and call the VI, this VI creates an
occurrence. Use the DAQ event control to select the event that sets the occurrence. Wire the
occurrence this VI produces to the Wait on Occurrence function. Anything you wire to the
output of the Wait on Occurrence function does not execute until the occurrence is set. The
occurrence is set each time the event occurs. The occurrence does not clear until you set the
create/clear control to 0 (clear) and call this VI, or call the Device Reset VI for the device.
LabVIEW returns a Not a Refnum file I/O constant along with a non-zero status code if it
cannot create the occurrence.
For each computer platform, LabVIEW limits the number of occurrences per second that you
can set. Although this limit depends on the speed of your computer, avoid exceeding
500 occurrences per second.
For some of the events, you must perform your operation using interrupts instead of DMA.
Refer to the description of the DAQ event control in this section for more information.
Device Reset
Resets either an entire device or the particular function identified by taskID.
Resetting a taskID function has the same result as calling the control VI for that function with
control code set to clear. When you reset the entire device, LabVIEW clears all tasks and
changes all device settings to their default values.
DSA Calibrate
Use this VI to calibrate your DSA device.
Your device contains calibration D/A converters (calDACs) that fine-tune the analog circuitry.
The calDACs must be programmed (loaded) with certain numbers called calibration
constants. These constants are stored in non-volatile memory (EEPROM) on your device.
To achieve specification accuracy, perform an internal calibration of your device just before
a measurement session but after your computer and the device have been running for at least
15 minutes. Frequent calibration produces the most stable and repeatable measurement
performance.
Before the device is shipped from the factory, an external calibration is performed, and the
EEPROM contains calibration constants that LabVIEW automatically loads into the calDACs
as needed. The value of the onboard reference voltage is also stored in the EEPROM, and this
value is used when you subsequently perform a self-calibration. The calibration constants are
re-calculated and stored in the EEPROM when a self-calibration is performed. When you
perform an external calibration, LabVIEW recalculates the value of the onboard reference
voltage, and then performs a self-calibration. This new onboard reference value is used for all
subsequent self-calibration operations. If a mistake is made when performing an external
calibration, you can restore the board’s factory calibration so that the board is not unusable.
Warning This VI is supported only up to NI-DAQ version 4.9.0 and has been removed from
the Calibration and Configuration palette. This VI is still included in the DAQ VI
Library for compatibility only, therefore if you are using NI-DAQ version 5.0 or
later, this VI will return the following message: deviceSupportError. If you
wish to use this VI, please reinstall NI-DAQ version 4.9.0 or an earlier version.
When you launch LabVIEW or reset the AT-DSP2200, LabVIEW performs an offset
calibration on both the analog input and output using analog ground as the reference.
You can use this VI to calibrate the analog input using an external reference or to recalibrate
the AT-DSP2200 to compensate for configuration or environmental changes.
Warning This VI is supported only up to NI-DAQ version 4.9.0 and has been removed from
the Calibration and Configuration palette. This VI is still included in the DAQ VI
Library for compatibility only, therefore if you are using NI-DAQ version 5.0 or
later, this VI will return the following message: deviceSupportError. If you
wish to use this VI, please reinstall NI-DAQ version 4.9.0 or an earlier version.
Because software running locally on the AT&T WE DSP32C DSP chip reads data from the
ADCs and writes data to the DACs, you can manipulate the data during these transfers.
When you write analog input data to DSP memory, you can write the data as unscaled 16-bit
integers, unscaled 32C floating-point numbers, or scaled 32C floating-point voltages. You can
use the demux option only when you write analog input data to DSP memory. When you
enable demux, the device writes data from channel 0 consecutively into DSP memory,
beginning at the start of each buffer, and writes channel 1 data consecutively beginning at the
half-way point of each buffer. When the device writes analog input data to PC memory, it can
write the data as unscaled 16-bit integers, unscaled IEEE single-precision floating-point
numbers, or scaled IEEE single-precision voltages.
If aotranslate is 0, the source data must be in a format suitable for the DACs (16-bit integer
DAC values). If aotranslate is 1 or 3, the source data are DAC values in 32C format in
DSP memory or in IEEE single-precision format in PC memory. If aotranslate is 2 or 4, the
source data are voltages in 32C format in DSP memory or in IEEE single-precision format in
PC memory.
E-Series Calibrate
Use this VI to calibrate your E-Series device and to select a set of calibration constants to be
used by LabVIEW.
Warning Read the calibration chapter in your device user manual before using the E-Series
Calibrate VI.
Your device contains calibration D/A converters (calDACs) that are used for fine-tuning the
analog circuitry. The calDACs must be programmed (loaded) with certain numbers, called
calibration constants. Those constants are stored in non-volatile memory (EEPROM) on your
device or are maintained by LabVIEW. To achieve specification accuracy, you should perform
an internal calibration of your device just before a measurement session, but after your
computer and the device have been powered on and allowed to warm up for at least
15 minutes. Frequent calibration produces the most stable and repeatable measurement
performance. The device is not harmed in any way if you recalibrate it as often as you like.
Two sets of calibration constants can reside in two areas inside the EEPROM, called load
areas. One set of constants is programmed at the factory, the other is left for the user. One
load area in the EEPROM corresponds to one set of constants. The load area LabVIEW uses
for loading calDACs with calibration constants is called the default load areas. When you get
the device from the factory, the default load area is the area that contains the calibration
constants obtained by calibrating the device in the factory. LabVIEW automatically loads
the relevant calibration constants stored in the load area the first time you call a VI that
requires them.
Note Calibration of your E-Series device takes some time. Do not be alarmed if the VI
takes several seconds to execute.
Warning When you run this VI with the operation set to self calibrate or external calibrate,
LabVIEW will abort any ongoing operations the device is performing and set all
configurations to their defaults. Therefore, you should run this VI before any
other DAQ VIs or when no other operations are running.
Refer to Appendix B, DAQ Hardware Capabilities, for the transfer methods available with
your DAQ device.
LPM-16 Calibrate
Calibrates the PC-LPM-16 or PC-LPM-16PnP converter. The calibration calculates the
correct offset voltage for the voltage comparator, adjusts positive linearity and full-scale
errors to less than ±0.5 LSB each, and adjusts zero error to less than ±1 LSB.
Refer to Appendix B, DAQ Hardware Capabilities, for more information on the PC-LPM-16,
DAQCard-500, or DAQCard-700 device.
Warning This VI is supported only up to NI-DAQ version 4.9.0 and has been removed from
the Calibration and Configuration palette. This VI is still included in the DAQ VI
Library for compatibility only, therefore if you are using NI-DAQ version 5.0 or
later, this VI will return the following message: deviceSupportError. If you
wish to use this VI, please reinstall NI-DAQ version 4.9.0 or an earlier version.
Makes sure LabVIEW always re-enables the slave devices before the master device in a
multiple-buffer analog input operation. Only the following devices, which support multiple
buffered acquisitions, can use this VI.
• (Macintosh) NB-A2000, NB-A2100, and NB-A2150.
The master device sends a trigger or clock signal to the slave device(s) to control the slave
device sampling. In a multiple-buffer acquisition, you must enable the slave device before the
master device to make sure the slave device always responds to a master signal. If you enable
the master device first, it can send a signal to the slave devices before they can respond. You
are responsible for the initial startup order. You should always start the master device last. The
Master Slave Configuration VI makes sure LabVIEW arms the master device last for each
subsequent buffer acquired during a multiple-buffer acquisition.
The load area for the AT-MIO-16F-5 is user area 5. The load area for the AT-MIO-64F-5 and
AT-MIO-16X is user area 8.
Warning Read the calibration chapter in your device user manual before using the
MIO Calibrate VI.
Note You should always calibrate the ADC and the DACs after you calibrate the internal
reference voltage.
Note If the device takes analog input measurements with the wrong set of calibration
constants loaded, you may get erroneous data.
Refer to Appendix B, DAQ Hardware Capabilities, for more information on the devices
supported by this VI.
Route Signal
Use this VI to route an internal signal to the specified I/O connector or RTSI bus line, or to
enable clock sharing through the RTSI bus clock line.
RTSI Control
Connects or disconnects trigger and timing signals between DAQ devices along the
Real-Time System Integration (RTSI) bus.
This VI is not supported for E-Series devices. For E-Series devices, multiple RTSI
connections can be set directly in the analog input, analog output, and counter VIs and
used along with the Route Signal VI. Other RTSI connections must be made using the
Route Signal VI.
For more information on the Scaling Constant Tuner VI, see the Scaling Constant Tuner VI
description in Chapter 30, Signal Conditioning VIs.
Refer to Appendix B, DAQ Hardware Capabilities, for the transfer methods available with
your DAQ device.
Use this VI to override the configuration already set with the configuration utility. You can
use this VI instead of using the configuration utility to enter the chassis configuration
information. If you do not use this VI, the first VI that accesses an SCXI chassis automatically
tries to load information from the configuration file.
Note This VI is specific to computers running NI-DAQ 5.0 or later. LabVIEW returns
an UnsupportedError message if you attempt to run this VI on computers not
running NI-DAQ 5.0 or later.
Note This VI is specific to computers running NI-DAQ 5.0 or later. LabVIEW returns
an UnsupportedError message if you attempt to run this VI on computers not
running NI-DAQ 5.0 or later.
Note This VI is specific to computers running NI-DAQ 5.0 or later. LabVIEW returns
an UnsupportedError message if you attempt to run this VI on computers not
running NI-DAQ 5.0 or later.
You can edit the conversion formulas used in these VIs or replace them with
your own to meet the specific accuracy requirements of your application. If
you edit or replace the formulas, you should save the new VI in one of your
own directories or folders outside of vi.lib.
This VI first finds the RTD resistance by dividing RTDVolts by Iex. The VI then converts the
resistance to temperature using the following solution to the Callendar Van-Dusen equation
for RTDs:
For temperatures above 0° C, the C coefficient is 0, and the preceding equation reduces to a
quadratic equation for which the algorithm implemented in the VI gives the appropriate root.
So, this conversion VI is accurate only for temperatures above 0° C.
Your RTD documentation should give you Ro and the A and B coefficients for the Callendar
Van-Dusen equation. The most common RTDs are 100-Ω platinum RTDs that either follow
the European temperature curve (DIN 43760) or the American curve. The following table
gives the values for A and B for the European and American curves.
Some RTD documentation gives values for α and ∂, from which you can calculate A and B
using the following equations:
A = α(1 + ∂/100)
B = –α∂/1002
The conversion formula the VI uses is based solely on the bridge configuration. Figures 30-1
through 30-3 show the seven bridge configurations you can use and the corresponding
formulas. For all bridge configurations, the VI uses the following formula to obtain Vr:
In the circuit diagrams, VOUT is the voltage you measure and pass to the conversion VI as the
Vsg parameter. In the quarter-bridge and half-bridge configurations, R1 and R2 are dummy
resistors that are not directly incorporated into the conversion formula. The SCXI-1121 and
SCXI-1122 modules provide R1 and R2 for a bridge-completion network, if needed.
Refer to your Getting Started with SCXI manual for more information on bridge-completion
networks and voltage excitation.
RL
R1 Rg (ε)
+ RL
Vex – Volt +
–
R2 R3 RL
strain (ε) =
– 4Vr
GF (1 + 2Vr) (
× 1+ RL
Rg )
RL
R1 Rg (ε)
+ RL
Vex – Volt +
–
R2 Rg (dummy)
RL
strain (ε) =
– 4Vr
GF (1 + 2Vr) (
× 1+ RL
Rg )
Figure 30-1. Strain Gauge Bridge Completion Networks (Quarter-Bridge Configuration)
RL
R1 Rg (+ε)
+ RL
Vex – Volt +
–
R2 Rg (–νε)
RL
strain (ε) =
– 4Vr
GF [(1 + ν) – 2Vr (ν – 1)] (
× 1+ RL
Rg )
RL
R1 Rg (+ε)
+ RL
Vex – Volt +
–
R2 Rg (–ε)
RL
strain (ε) =
– 2Vr ×
GF (
1+
RL
Rg )
Figure 30-2. Strain Gauge Bridge Completion Networks (Half-Bridge Configuration)
–ε +ε
+
Vex – Volt +
–
+ε –ε
–νε +ε
+
Vex – Volt +
–
+νε –ε
–νε +ε
+
Vex – Volt +
–
+ε –νε
This VI has two modes of operation for use with different types of thermistor circuits.
Figure 30-4 shows how the thermistor can be connected to a voltage reference. This is the
setup used in the SCXI-1303, SCXI-1322, SCXI-1327, and SCXI-1328 terminal blocks,
which use an onboard thermistor for cold-junction compensation.
VREF
R1
V0
RT
Figure 30-5 shows a circuit where the thermistor is excited by a constant current source.
An example of this setup would be the use of the DAQPad-MIO-16XE-50, which provides a
constant current output. The DAQPad-TB-52 has a thermistor for cold-junction sensing.
IEX
V0
RT
If the thermistor is excited by voltage, the following shows equation relating the thermistor
resistance, RT, to the input values:
V0
R T = R 1 ------------------------
V
REF – V 0
V0
R T = --------
I EX
The following equation is the standard formula the VI uses for converting a thermistor
resistance to temperature:
1
T K = ------------------------------------------------------
3
a + b ( ln R T ) +c ( ln R T )
The values used by this VI for a, b, and c are given below. These values are correct for the
thermistors provided on the SCXI and DAQPad-TB-52 terminal blocks. If you are using a
thermistor with different values for a, b, and c (refer to your thermistor data sheet), you can
edit the VI diagram to use your own a, b, and c values.
a = 1.295361E–3
b = 2.343159E–4
c = 1.018703E–7
To use this VI correctly, you must first take two analog input readings—a zero offset reading
and a known-voltage reading.
The default binary offset for each channel in the group is 0. To determine the actual binary
offset for a channel path, ground the channel inputs and take a binary reading, or take multiple
binary readings and average them to get fractional LSBs of the offset.
If you use SCXI, ground the inputs of the SCXI channels to measure the offset of the entire
signal path, including both the SCXI module and the DAQ device. The SCXI-1100,
SCXI-1122, and SCXI-1141 modules have an internal switch you can use to ground the
amplifier inputs without actually wiring the terminals to ground. To use this feature, type the
special SCXI string CALGND in your SCXI channel string as described in the Amplifier Offset
section of Chapter 21, Common SCXI Applications, in the LabVIEW Data Acquisition
Basics Manual. Use intermediate or advanced analog input VIs to get binary data instead of
voltage data.
Note If your device supports dithering, you should enable dither on your DAQ device
when you take multiple readings and average them.
LabVIEW assumes the DAQ devices gain settings and SCXI modules are ideal when it scales
binary readings to voltage, unless you use this VI to determine actual gain values for the
channels. Apply a known precision voltage to each channel and take a binary reading, or take
multiple readings from each channel and compute an average binary reading for each channel.
Your precision voltage should be about ten times as accurate as the resolution of your
DAQ device to produce meaningful results. When you wire binary readings, precision
voltages, and binary offsets to this VI, LabVIEW determines the actual gain using the
following formula:
In this formula, the voltage resolution value expressed in volts per LSB and is a value that
varies depending on the DAQ device type, the polarity setting, and the input range setting. For
example, the voltage resolution for a PCI-MIO-16E-1 device in bipolar mode with an input
range of +5 to –5 V is 2.44 mV. The VI returns an array of the actual gain values that the VI
stores for each channel.
Note When you take readings to determine the offset and actual gain, you should use
the same input limits settings and clock rates that you use to measure your input
signals.
When you run the AI Group Config VI, it sets the attributes of all the channels in the group
to their defaults, including the binary offset and gain values.
You can wire channel list if you want to adjust the scaling constants for a subset of the
channels in the group. If you leave channel list unwired, the VI adjusts the scaling constants
for all channels in the group. The VI uses the same method as the AI Hardware Config VI to
apply values in the binary offsets, precision voltages, and binary readings input arrays.
That is, if you wired channel list to this VI, the first element (at index 0) of the input arrays
(binary offsets, precision voltages, and binary readings) apply to the channels listed at
index 0 of channel list. If you leave channel list unwired, the first values of the input arrays
apply to the first channel in the group. The VI applies the values of each input array to
channel list channels or the group in this manner until the VI exhausts the arrays. If channels
in channel list or in the group remain unconfigured, the VI applies the final values in the
arrays to all the remaining unconfigured channels.
If you want to adjust only the channel offsets, and you want to assume the gain settings on the
DAQ device and SCXI modules are ideal, wire only binary offsets and leave precision
voltages and binary readings unwired.
You can also use this VI to retrieve the binary offset and actual gain values for all the channels
in the group by wiring taskID only.
After you use this VI to adjust the scaling constants for a channel path, any analog input VIs
that return voltage data use the adjusted constants for scaling. You can use the AI Group
Config VI to reset the scaling constants for each channel in the group to their default values
(zero offset and ideal gain).
You can find the Instrument Driver VIs in the Functions palette from your
block diagram in LabVIEW. The Instrument Driver VIs are located near the
bottom of the Functions palette.
You can find helpful information about individual VIs online by using the
LabVIEW Help window (Help»Show Help). When you place the cursor
on a VI icon, the wiring diagram and parameter names for that VI appear
in the Help window. You also can find information for front panel controls
or indicators by placing the cursor over the control or indicator with
the Help window open. For more information on the LabVIEW Help
window, refer to the Getting Help section in Chapter 1, Introduction to
G Programming, of the G Programming Reference Manual.
them for your specific application, if needed. If a driver for your particular
instrument does not exist, try one of the following suggestions:
• Use a driver for a similar instrument. Often similar instruments from
the same manufacturer have similar, if not identical, instrument
drivers.
• Modify the Instrument Driver Template VIs to create a new driver for
your instrument.
• Use either the GPIB, VXI, Serial, or VISA I/O libraries provided with
LabVIEW to send and receive commands directly to and from your
instrument.
• Refer to Chapter 7, Getting Started with a LabVIEW Instrument
Driver, in the LabVIEW User Manual for information on how to start
using LabVIEW instrument drivers from National Instruments.
You can download the latest versions of the LabVIEW instrument drivers
from one of the National Instruments bulletin boards and, if you have
internet access, you can download the latest instrument driver files from the
National Instrument File Transfer Protocol site. See the Bulletin Board
Support and FTP Support sections of Appendix D, Customer
Communication.
You can retrieve the latest instrument driver list on a touch-tone phone by
calling the National Instruments automated fax system, Fax-on-Demand, at
(512) 418-1111 or by calling National Instruments.
Instrument drivers that use the VISA functions perform activities specific
to the instrument, not to the communication interface. This creates more
opportunities for using the instrument driver in many diverse situations.
For more information on VISA functions, see Chapter 33, VISA Library
Reference.
Introduction to GPIB
The General Purpose Interface Bus (GPIB) is a link, or interface system,
through which interconnected electronic devices communicate.
The GPIB 488.2 functions contain the same basic functionality as the
traditional GPIB functions, and include the following enhancements and
additions:
• You specify the GPIB device address with an integer instead of a
string. Further, you specify the bus number with an additional numeric
control, which makes dealing with multiple GPIB interfaces easier.
• You can determine the GPIB status, error, and/or byte count
immediately from the connector pane of each GPIB 488.2 function.
You no longer need to use the GPIB Status Function to obtain error and
other information.
• The FindLstn function implements the IEEE 488.2 Find All Listeners
protocol. You can use this function at the beginning of an application
to determine which devices are present on the bus without knowing
their addresses.
Single-Device Functions
The single-device functions perform GPIB I/O and control operations with
a single GPIB device. In general, each function accepts a single-device
address as one of its inputs.
Multiple-Device Functions
The multiple-device functions perform GPIB I/O and control operations
with several GPIB devices at once. In general, each function accepts an
array of addresses as one of its inputs.
Low-Level Functions
The low-level functions let you create a more specific, detailed program
than higher-level functions. You use low-level functions for unusual
situations or for situations requiring additional flexibility.
General Functions
The general functions are useful for special situations.
Rather than developing your own VIs to accomplish these tasks, you can
use the LabVIEW instrument driver template VIs, which already conform
to the LabVIEW standards for instrument drivers. The template VIs are
IEEE 488.2-compatible and work with IEEE 488.2 instruments with
minimal modifications. For non-IEEE 488.2 instruments, use the template
VIs as a shell or pattern, which you can modify by substituting your
corresponding instrument-specific commands where applicable. After
modifying the VIs, you have the base-level driver that implements all of the
template instrument driver VIs for your particular instrument.
Note To develop your own Instrument Driver VI, follow the instructions on the front
panel of the Template VI.
PREFIX Close
All LabVIEW instrument drivers should include a Close VI. The Close VI is the last VI called
when controlling an instrument. It terminates the software connection to the instrument and
deallocates system resources. Additionally, you can choose to place the instrument in an idle
state. For example, if you are developing a switch driver, you can disconnect all switches
when closing the instrument driver.
The VI has an Instrument Descriptor string as an input. Based on the syntax of this input,
the VI configures the I/O interface and generates an instrument handle for all other instrument
driver VIs. The following table shows the grammar for the Instrument Descriptor. Optional
parameters are shown in square brackets ([]).
Interface Syntax
GPIB GPIB[board]::primary address[::secondary
address][::INSTR]
Serial ASRL[board][::INSTR]
The GPIB keyword is used with GPIB instruments. The VXI keyword is used for either
embedded or MXIbus controllers. The GPIB-VXI keyword is used for a National Instruments
GPIB-VXI controller.
The following table shows the default values for optional parameters.
Additionally, the Initialize VI can perform selectable ID query and reset operations. In other
words, you can disable the ID query when you are attempting to use the driver with a similar
but different instrument without modifying the driver source code. Also, you can enable or
disable the reset operation. This feature is useful for debugging when resetting would take the
instrument out of the state you were trying to test.
PREFIX Reset
All LabVIEW instrument drivers have a Reset VI that places the instrument in a default state.
The default state that the Reset VI places the instrument in should be documented in the help
information for the Reset VI. In an IEEE 488.2 instrument, this VI sends the command string
*RST to the instrument. When you reset the instrument from the Initialize VI, this VI is called.
Also, you can call the Reset VI separately. If the instrument cannot perform reset, the
Reset VI should return the literal string Reset Not Supported.
PREFIX Self-Test
If an instrument has self-test capability, the LabVIEW instrument driver should contain a
Self-Test VI to instruct the instrument to perform a self-test and return the result of that
self-test. If the instrument cannot perform a self-test, the Self-Test VI returns the literal string
Self-Test Not Supported.
PREFIX VI Tree
The VI Tree VI is a non-executable VI that shows the functional structure of the instrument
driver. It contains the Getting Started VI, application VIs, and all of the component VIs.
The following figure shows the VISA palette, which you access by
selecting Functions»Instrument I/O»VISA.
Operations
This section describes the VISA Library Reference operations.
– PXI Instr
– VXI/GPIB-VXI/VME MemAcc
Note The Generic Event, Service Request Event, Trigger Event, VXI Signal Event,
VXI/VME Interrupt Event, and Resource Manager classes can only be passed in
as a VISA session with the VISA Close function and the VISA Property Node.
VISA functions vary in the class of VISA session that can be wired to
them. The valid classes for each function are indicated in the
documentation. For example, the functions on the High Level
Register Access and Low Level Register Access palettes do not
accept VISA sessions of class GPIB Instr or Serial Instr. If you wire
VISA session to a function that does not accept the class of the session,
or if you wire two VISA sessions of differing classes together, your
diagram will be broken and the error will be reported as a Class
Conflict.
• error in and error out terminals comprise the error clusters in each
VISA function. An error cluster contains three fields. The status field
is a Boolean that is TRUE when an error occurs and FALSE when no
error occurs. code field is a VISA error code value if an error occurs
during a VISA function. Appendix A, Error Codes, lists the VISA
Reference Library error codes. source field is a string that describes
where the error has occurred. By wiring the error out of each function
to the error in of the next function, the first error condition is recorded
and propagated to the end of the diagram where it is reported in only
one place.
Note The following Easy VISA VIs provide a simple interface to the functions they use.
If optimizing performance is important for your application, use the VISA
primitives, also located in this palette.
VISA Clear
Performs an IEEE 488.1-style clear of the device. For VXI, this is the Word Serial Clear
command; for GPIB systems, this is the Selected Device Clear command. For Serial, this
sends the string *CLS In.
VISA Close
Closes a specified device session or event object. VISA Close accepts all available classes.
For a listing of available classes, see the VISA Library Reference Parameters section earlier
in this chapter.
The following tables show the expression parameter descriptions for the VISA Find
Resource VI.
VXI VXI?*INSTR
GPIB-VXI GPIB-VXI?*INSTR
Serial ASRL[0-9]*::?*INSTR
All ?*INSTR
GPIB-VXI GPIB-VXI?*MEMACC
All ?*MEMACC
VISA Lock
Establishes locked access to the specified resource.
For more information about VISA locking and shared locking, refer to Chapter 8,
LabVIEW VISA Tutorial, in the LabVIEW User Manual.
VISA Open
Opens a session to the specified device and returns a session identifier that can be used to call
any other operations of that device.
The following table shows the grammar for the address string. Optional string segments are
shown in square brackets ([ ]).
Interface Syntax
VXI VXI[board]::VXI logical address[::INSTR]
ASRL ASRL[board][::INSTR]
VXI VXI[board]::MEMACC
GPIB-VXI GPIB-VXI[board]::MEMACC
The VXI keyword is used for VXI instruments via either embedded or MXIbus controllers.
The GPIB-VXI keyword is used for a GPIB-VXI controller. The GPIB keyword can be used
to establish communication with a GPIB device. The ASRL keyword is used to establish
communication with an asynchronous serial (such as RS-232) device.
The following table shows the default value for optional string segments.
For the access mode parameter, the value VI_EXCLUSIVE_LOCK (1) is used to acquire an
exclusive lock immediately upon opening a session; if a lock cannot be acquired, the session
is closed and an error is returned.
The value VI_LOAD_CONFIG (4) is used to configure attributes to values specified by some
external configuration utility, such as T&M Explorer (on Windows 95/NT) or VISAconf
(on Windows 3.x, Solaris 2, and HP-UX).
VISA Read
Reads data from a device. Whether the data is transferred synchronously or asynchronously
is platform-dependent.
VISA Unlock
Relinquishes the lock previously obtained using the VISA Lock function.
VISA Write
Writes data to the device. Whether the data is transferred synchronously or asynchronously is
platform-dependent.
You can find the VISA Event Handling functions in the VISA palette, which you access by
selecting Functions»Instrument I/O»VISA.
Note You must call the VISA Enable Event VI for a given session before using
VISA Wait on Event VI.
Note You must first call the VISA Enable Event VI for the specified session before using
VISA Wait on Event VI.
The following table lists the valid entries for specifying address space.
The following table lists the valid entries for specifying address space.
Value Description
(1) Address the A16 address space of the VXI/MXI bus.
(2) Address the A24 address space of the VXI/MXI bus.
(3) Address the A32 address space of the VXI/MXI bus.
The following table lists the valid entries for specifying address space.
Value Description
(1) Address the A16 address space of the VXI/MXI bus.
(2) Address the A24 address space of the VXI/MXI bus.
(3) Address the A32 address space of the VXI/MXI bus.
The following table lists the valid entries for specifying address space.
Value Description
(1) Address the A16 address space of the VXI/MXI bus.
(2) Address the A24 address space of the VXI/MXI bus.
(3) Address the A32 address space of the VXI/MXI bus.
The following table lists the valid entries for specifying address space.
Value Description
(1) Address the A16 address space of the VXI/MXI bus.
(2) Address the A24 address space of the VXI/MXI bus.
(3) Address the A32 address space of the VXI/MXI bus.
To access the VISA Serial functions, pop up on the Low Level icon on the
VISA palette.
Flushing the receive buffer (16) discards the contents, while flushing the output buffer (32)
waits for any remaining contents in the transmit buffer to be sent to the device. To discard any
remaining data in the transmit buffer, you need to use the discard output buffer mask (128).
To flush more than one buffer simultaneously, combine the buffer masks by using an O-Ring.
Valid values for mask are Serial receive buffer (16) and Serial transmit buffer (32). To set the
size of both buffers simultaneously, combine the buffer masks by using an O-Ring.
The VISA Property Node only displays attributes for the class of the
session that is wired to it. You can change the class of a VISA Property
Node as long as you have not wired it to a VISA session. Once a
VISA session is wired to a VISA Property Node, it adapts to the class of
the session and any displayed attributes that are not valid for that class
become invalid (indicated by turning the attribute item black).
Because the Property Node can be used in other contexts in LabVIEW, the
Property Node might default to a class other than a VISA class if you place
it on a diagram by itself. When you wire it to a VISA session, it becomes a
VISA class.
General Settings
Determine the following properties:
• Maximum event queue length
• Unique VISA resource name
• Resource lock state
• Timeout value for accessing the device
• Communication trigger mechanism
• Information used to document the functionality in your
VISA application
GPIB Settings
Specify the following information:
• What the primary and secondary addresses of a GPIB device are
• If the GPIB device needs to be readdressed before every transfer
• If the GPIB device is unaddressed after each read and write operation
Interface Information
Provides information about the VISA interface type, the board number of
the interface and the board number of the parent device.
Message-Based Settings
Determine the following aspects of VISA message-based communication:
• The I/O Protocol (GPIB, Serial, VXI)
• Whether to send an END indicator in write operations
• Whether to ignore an END indicator in read operations
• Whether to terminate read operations with a special character
PXI Resources
Specify the address type, the address base and address size of devices at
slots BAR0 through BAR5.
PXI Settings
Specify the following information: device number, function number,
subsytem manufacturer information, and subsystem model code.
Register-Based Settings
Determine the following aspects of VISA register-based communication:
• Identification of the device manufacturer
• Model of the device
• Physical slot location of the device
• Number of elements in block-move operations at both the source and
memory addresses
• (Windows) Base address, size, and access to space
Serial Settings
Specify the following: number of bytes at the serial port, baud rate, data
bits, parity, stop bits, flow control, and termination method for read and
write operations.
Version Information
Provides information about the version and the manufacturer’s name of the
VISA implementation, as well as the version of the VISA specification.
VME/VXE Settings
Determine the necessary addresses, access privileges, memory space, and
byte orders necessary for VXI communication.
GPIB Clear
Sends either Selected Device Clear (SDC) or Device Clear (DCL).
GPIB Initialization
Configures the GPIB interface at address string.
GPIB Misc
Performs the GPIB operation indicated by command string. Use this low-level function
when the previously described high-level functions are not suitable.
GPIB Read
Reads byte count number of bytes from the GPIB device at address string.
You use the SetTimeOut function to change the default value (the 488.2 global timeout) of
timeout ms. Initially, timeout ms defaults to 10,000. See the description of the SetTimeOut
function in Chapter 35, GPIB 488.2 Functions, for more information.
GPIB Status
Shows the status of the GPIB Controller indicated by address string after the previous
GPIB operation.
GPIB Trigger
Sends GET (Group Execute Trigger) to the device indicated by address string.
GPIB Wait
Waits for the state(s) indicated by wait state vector at the device indicated by address string.
GPIB Write
Writes data to the GPIB device identified by address string.
You can use these functions with all GPIB Controllers accessible by
LabVIEW, unless stated otherwise in the function description below.
An ECMD error (17) results when you execute a function for a GPIB
Controller without the specified capability. The function syntax is strict.
Each function recognizes only lowercase characters and allows only one
space between the function name and the arguments.
Device Functions
loc – Go to local
syntax loc address
address is the GPIB address of the device. This argument indicates both
primary and secondary addresses if you use the form primary + secondary,
where primary and secondary are the decimal values of the primary and
secondary addresses. For example, if primary is 2 and secondary is 3, then
address is 2 + 3.
off takes the device at the specified GPIB address offline. This is only
needed when sharing a device with another application which is using the
NI 488 GPIB Library.
address is the GPIB address of the device. This argument indicates both
primary and secondary addresses if you use the form primary + secondary,
where primary and secondary are the decimal values of the primary and
secondary addresses. For example, if primary is 2 and secondary is 3, then
address is 2 + 3.
address is the GPIB address of the device. This argument indicates both
primary and secondary addresses if you use the form primary + secondary,
where primary and secondary are the decimal values of the primary and
secondary addresses. For example, if primary is 2 and secondary is 3, then
address is 2 + 3.
address is the GPIB address of the device. This argument indicates both
primary and secondary addresses if you use the form primary + secondary,
where primary and secondary are the decimal values of the primary and
secondary addresses. For example, if primary is 2 and secondary is 3, then
address is 2 + 3.
Controller Functions
string contains the command bytes the Controller sends. ASCII characters
represent these bytes in cmd string. If you must send nondisplayable
characters, you can enable backslash codes on the string control or string
constant or you can use a format function to list the commands in
hexadecimal.
Some GPIB boards do not have DMA capability. If you try to execute
dma 1, the function returns GPIB error 11 to indicate no capability.
Description:
gts sets the GPIB Controller to the Controller Standby state and unasserts
the ATN signal if it is the active Controller. Normally, the GPIB Controller
is involved in the data transfer. gts permits GPIB devices to transfer data
without involving the GPIB Controller.
After sending the gts command, you should always wait for END before
you initiate another GPIB command. You can do this with the GPIB Wait
function.
You use ist when the GPIB Controller is not the CIC but participates in a
parallel poll conducted by a device that is the active Controller. The CIC
conducts a parallel poll by asserting the EOI and ATN signals, which send
the Identify (IDY) message. While this message is active, each device
that you configured to participate in the poll responds by asserting a
predetermined GPIB data line either TRUE or FALSE, depending on the
value of its local ist bit. For example, you can assign the GPIB Controller
to drive the DIO3 data line TRUE if ist is 1 and FALSE if ist is 0.
Conversely, you can assign it to drive DIO3 TRUE if ist is 0 and FALSE if
ist is 1.
The Parallel Poll Enable (PPE) message in effect for each device
determines the relationship among the value of ist, the line that is driven,
and the sense at which the line is driven. The Controller is capable of
receiving this message either locally via ppc or remotely via a command
from the CIC. Once the PPE message executes, ist changes the sense at
which the GPIB Controller drives the line during the parallel poll, and the
GPIB Controller can convey a one-bit, device-dependent message to the
Controller.
llo places all devices in local lockout state. This action usually inhibits
recognition of inputs from the front panel of the device.
loc places the GPIB Controller in a local state by sending the local message
Return To Local (RTL) if it is not locked in remote mode (indicated by the
LOK bit of status). You use loc to simulate a front panel RTL switch when
you use a computer to simulate an instrument.
off takes the controller offline. This is only needed when sharing the
controller with another application which is using the NI 488 Library.
Each of the 16 Parallel Poll Enable (PPE) messages selects the GPIB data
line (DIO1 through DIO8) and sense (1 or 0) that the device must use when
responding to the Identify (IDY) message during a parallel poll. The device
interprets the assigned message and the current value of the individual
status (ist) bit to determine if the selected line is driven TRUE or FALSE.
For example, if PPE=0x64, DIO5 is driven TRUE if ist is 0 and FALSE if
ist is 1. If PPE=0x68, DIO1 PPE message is in effect. You must know
which PPE and PPD messages are sent and determine what the responses
indicate.
rpp places the parallel poll response in the output string as ASCII
characters.
rsc releases or requests the capability of the GPIB Controller to send the
Interface Clear (IFC) and Remote Enable (REN) messages to GPIB devices
using the sic and sre functions. For the GPIB Controller to respond to IFC
sent by another Controller, the GPIB Controller must not be the System
Controller.
rsv – Request service and/or set the serial poll status byte
syntax rsv byte
rsv sets the serial poll status byte of the GPIB Controller to byte. If the
0x40 bit is set in byte, the GPIB Controller also requests service from the
Controller by asserting the GPIB RSQ line. For instance, if you want to
assert the GPIB RSQ line, send the ASCII character @, in which the
0x40 bit is set.
You use rsv to request service from the Controller using the Service
Request (SRQ) signal and to provide a system-dependent status byte
when the Controller serial polls the GPIB port.
sic causes the Controller to assert the IFC signal for at least 100 msec if the
Controller has System Controller authority. This action initializes the GPIB
and makes the Controller port CIC. You generally use sic when you want a
device to become CIC or to clear a bus fault condition.
The IFC signal resets only the GPIB functions of bus devices; it does not
reset internal device functions. The Device Clear (DCL) and Selected
Device Clear (SDC) commands reset the device functions. Consult the
instrument documentation to determine the effect of these messages.
sre unasserts or asserts the GPIB REN line. Devices monitor REN when
they select between local and remote modes of operation. A device does not
actually enter remote mode until it receives its listen address.
The following figure shows the GPIB 488.2 palette which you access by
selecting Functions»Instrument I/O»GPIB 488.2.
DevClear
Clears a single device. To send the Selected Device Clear (SDC) message to several
GPIB devices, use the DevClearList function.
PPollConfig
Configures a device for parallel polls.
PassControl
Passes control to another device with Controller capability.
ReadStatus
Serial polls a single device to get its status byte.
Receive
Reads data bytes from a GPIB device.
Send
Sends data bytes to a single GPIB device.
Trigger
Triggers a single device. To send a single message that triggers several GPIB devices, use the
TriggerList function.
AllSPoll
Serial polls all devices.
Although the AllSPoll function is general enough to serial poll any number of GPIB devices,
you should use the ReadStatus function when you serial poll only one GPIB device.
DevClearList
Clears multiple devices simultaneously.
EnableLocal
Enables local mode for multiple devices.
EnableRemote
Enables remote programming of multiple GPIB devices.
FindRQS
Determines which device is requesting service.
PPoll
Performs a parallel poll.
PPollUnconfig
Unconfigures devices for parallel polls. The function unconfigures the GPIB devices whose
addresses are contained in the address list array for parallel polls; that is, they no longer
participate in polls.
SendList
Sends data bytes to multiple GPIB devices. This function is similar to Send, except that
SendList sends data to multiple Listeners with only one transmission.
TriggerList
Triggers multiple devices simultaneously.
FindLstn
Finds all Listeners on the GPIB. You normally use this function to detect the presence
of devices at particular addresses because most GPIB devices have the ability to listen.
When you detect them, you can usually interrogate the devices to determine their identity.
ResetSys
Performs bus initialization, message exchange initialization, and device initialization. First,
the function asserts Remote Enable (REN), followed by Interface Clear (IFC), unaddressing
all devices and making the GPIB board (the System Controller) the Controller-in-Charge.
Second, the function sends the Device Clear (DCL) message to all connected devices.
This ensures that all IEEE 488.2-compatible devices can receive the Reset (RST) message
that follows.
Third, the function sends the *RST message to all devices whose addresses are contained in
the address list array. This message initializes device-specific functions within each device.
SendIFC
Clears the GPIB functions with Interface Clear (IFC). When you issue the GPIB Device
IFC message, the interface functions of all connected devices return to their cleared states.
You should use this function as part of a GPIB initialization. It forces the GPIB board to be
Controller of the GPIB and ensures that the connected devices are all unaddressed and that
the interface functions of the devices are in their idle states.
SendLLO
Sends the Local Lockout (LLO) message to all devices. When the function sends the
GPIB Local Lockout message, a device cannot independently choose the local or remote
state. While Local Lockout is in effect, only the Controller can alter the local or remote state
of the devices by sending the appropriate GPIB messages.You should use SendLLO only in
unusual local/remote situations, particularly those in which you must lock all devices into
local programming state. Use the SetRWLS Function when you want to place devices in
Remote Mode With Lockout State.
SetRWLS
Places particular devices in the Remote With Lockout State. The function sends Remote
Enable (REN) to the GPIB devices listed in address list. It also places all devices in Lockout
State, which prevents them from independently returning to local programming mode without
intervention by the Controller.
TestSRQ
Determines the current state of the SRQ line. This function is similar in format to the
WaitSRQ function, except that WaitSRQ suspends itself while it waits for an occurrence of
SRQ, and TestSRQ immediately returns the current SRQ state.
TestSys
Directs multiple devices to conduct IEEE 488.2 self-tests.
WaitSRQ
Waits until a device asserts Service Request. The function suspends execution until a
GPIB device connected on the GPIB asserts the Service Request (SRQ) line.
This function is similar in format to TestSRQ, except that TestSRQ returns the SRQ status
immediately, whereas WaitSRQ suspends the program for the duration of the timeout period
(but no longer) waiting for an SRQ to occur.
RcvRespMsg
Reads data bytes from a previously addressed device. This function assumes that another
function, such as ReceiveSetup, Receive, or SendCmds, has already addressed the
GPIB Talkers and Listeners. You use RcvRespMsg specifically to skip the addressing step of
GPIB management. You normally use the Receive function to perform the entire sequence of
addressing and then to receive the data bytes.
ReceiveSetup
Prepares a device to send data bytes and prepares the GPIB board to read data bytes. After you
call this function, you can use a function such as RcvRespMsg to transfer the data from the
Talker. In this way, you eliminate the need to readdress the devices between blocks of reads.
SendCmds
Sends GPIB command bytes.
You normally do not need to use SendCmds for GPIB operation. You use it when specialized
command sequences, not provided for in other functions, must be sent over the GPIB.
SendDataBytes
Sends data bytes to previously addressed devices.
SendSetup
Prepares particular devices to receive data bytes. You normally follow a call to this function
with a call to a function such as SendDataBytes to actually transfer the data to the Listeners.
This sequence eliminates the need to readdress the devices between blocks of sends.
MakeAddr
Combines primary address and secondary address in a specially formatted packed
address for devices that require both a primary and secondary GPIB address.
SetTimeOut
Changes the global timeout period for all GPIB 488.2 functions. This function also sets the
default timeout period for all GPIB functions.
The following figure shows the Serial palette that you access by selecting
Functions»Instrument I/O»Serial.
Analysis VIs
Part IV, Analysis VIs, describes the Analysis VIs. This part contains the
following chapters:
• Chapter 37, Introduction to Analysis in LabVIEW, introduces the
LabVIEW Analysis VIs. It also provides a description of how the VIs
are organized, instructions for accessing the VIs and obtaining online
help, and a description of Analysis VI error reporting.
• Chapter 38, Signal Generation VIs, describes the VIs that generate
one-dimensional arrays with specific waveform patterns.
• Chapter 39, Digital Signal Processing VIs, describes the VIs that
process and analyze an acquired or simulated signal. The Digital
Signal Processing VIs perform frequency domain transformations,
frequency domain analysis, time domain analysis, and other
transforms, such as the Fourier, Hartley, and Hilbert transforms.
• Chapter 40, Measurement VIs, describes the Measurement VIs, which
are streamlined to perform DFT-based and FFT-based analysis with
signal acquisition for frequency measurement applications as seen in
typical frequency measurement instruments, such as dynamic signal
analyzers.
• Chapter 41, Filter VIs, describes the VIs that implement IIR, FIR, and
nonlinear filters.
• Chapter 42, Window VIs, describes the VIs that implement smoothing
windows.
• Chapter 43, Curve Fitting VIs, describes the VIs that perform curve
fitting or regression analysis.
• Chapter 44, Probability and Statistics VIs, describes the VIs that
perform probability, descriptive statistics, analysis of variance, and
interpolation functions.
• Chapter 45, Linear Algebra VIs, describes the VIs that perform real
and complex matrix related computation and analysis.
Part IV Analysis VIs
• Chapter 46, Array Operation VIs, describes the VIs that perform
common, one- and two-dimensional numerical array operations.
• Chapter 47, Additional Numerical Method VIs, describes the VIs that
use numerical methods to perform root-finding, numerical integration,
and peak detection.
To access the Analysis palette from the block diagram window, choose
Functions»Analysis and proceed through the hierarchical menus to select
the VI you want. You can place the icon corresponding to that VI in the
block diagram and then wire it.
If the VIs in the base analysis library do not satisfy your needs, then you
can add the LabVIEW Advanced Analysis Libraries to the G Base Package.
After you upgrade, you have all the analysis tools available in the Full
Development System.
Analysis VI Overview
The LabVIEW analysis VIs efficiently process blocks of information
represented in digital form. They cover the following major processing
areas:
• Pattern generation
• Digital signal processing
• Measurement-based analysis
• Digital filtering
• Smoothing windows
• Probability and statistical analysis
• Curve fitting
• Linear algebra
• Numerical analysis
The Analysis VIs use in-place data processing algorithms. That is, the
algorithms allocate minimal data space and process the data within that
space. In-place processing minimizes memory requirements, so you can
process larger data blocks. The only memory limitation for these VIs is the
amount of RAM available in your computer. Refer to your LabVIEW
User Manual for instructions on configuring the memory allocation for
LabVIEW.
The analysis VIs are powerful enough for experts to build sophisticated
analysis applications quickly and efficiently. At the same time, they
are simple enough for novices to analyze data without being expert
programmers in DSP, digital filters, statistics, or numerical analysis.
Analysis VI Organization
After installation, the ten analysis VI libraries appear in the Functions
palette. The Analysis palette includes the following subpalettes:
• Signal Generation contains VIs that generate digital patterns and
waveforms.
• Digital Signal Processing contains VIs that perform frequency
domain transformations, frequency domain analysis, time domain
analysis, and other transforms such as the Hartley and Hilbert
transforms.
• Measurement contains VIs that perform measurement-oriented
functions such as single-sided spectrums, scaled windowing, and peak
power and frequency estimation.
• Filters contains VIs that perform IIR, FIR, and nonlinear, digital
filtering functions.
• Windows contains VIs that perform data windowing.
• Probability and Statistics contains VIs that perform descriptive
statistics functions, such as identifying the mean or the standard
deviation of a set of data, as well as inferential statistics functions for
probability and analysis of variance (ANOVA).
• Curve Fitting contains VIs that perform curve fitting functions and
interpolations.
• Linear Algebra contains VIs that perform algebraic functions for real
and complex vectors and matrices.
You can reorganize the folders and the VIs to suit your needs and
applications. You can also rebuild the original structure by removing
the VIs from your hard disk and then reinstalling them from the
distribution disks.
Array indexes in LabVIEW are zero-based. The index of the first element
in the array, regardless of its dimension, is zero. The following sequence of
numbers represents a 1D array X containing n elements.
X = { x 0, x 1, x 2, ..., x n – 1 }
The following scalar quantity represents the ith element of the sequence X.
x i, 0≤i<n
The first element in the sequence is x and the last element in the sequence
0
is xn–1, for a total of n elements.
a 00 a 01 a 02 ... a 0m – 1
a 10 a 11 a 12 ... a 1m – 1
A = a 20 a 21 a 22 ... a 2m – 1
: : : : :
a n – 10 a n – 11 a n – 2 ... a n – 1m – 1
Unless otherwise specified, this manual uses the following simplified array
operation notations.
X = a,
X = {a, a, a, …, a}
xi = a, for i = 0, 1, 2, …, n – 1.
Y = aX,
yi = axi, for i = 0, 1, 2, …, n– 1.
B = k A,
ka 00 ka 01 ka 02 ... ka 0m – 1
ka 10 ka 11 ka 12 ... ka 1m – 1
B = ka 20 ka 21 ka 22 ... ka 2m – 1
: : : : :
ka n – 10 ka n – 11 ka n – 12 ... ka n – 1m – 1
Empty = NULL = Ø = { } .
You can combine these VIs with the arithmetic functions discussed in
Chapter 4, Numeric Functions, to generate more elaborate waveforms.
For example, if you want to generate an amplitude modulated pulse, you
multiply a pulse pattern by a sinusoidal pattern.
For examples of how to use the signal generation VIs, see the examples
located in examples\analysis\sigxmpl.llb.
Arbitrary Wave
Generates an array containing an arbitrary wave.
If the sequence y represents Arbitrary Wave, then the VI generates the pattern according to
the following formula:
The VI is reentrant, so you can use it to simulate a continuous acquisition from an arbitrary
wave function generator. If the input control reset phase is false, subsequent calls to a specific
instance of this VI produce the output Arbitrary Wave array containing the next samples of
the arbitrary wave.
phase out is set to phase[n], and this reentrant VI uses this value as its new phase in if reset
phase is false the next time the VI executes.
Chirp Pattern
Generates an array containing a chirp pattern.
If the sequence Y represents Chirp Pattern, the VI generates the pattern according to the
following formula:
To generate the pattern, the VI uses a modified version of the Very-Long-Cycle random
number generator algorithm based upon the Central Limit Theorem. Given that the
probability density function, f(x), of the Gaussian-distributed Gaussian Noise Pattern is:
2
1 x
1 – --- --
f(x) = ------------- e 2 s ,
2πs
where s is the absolute value of the specified standard deviation and that you can compute
the expected values, E{•}, using the formula:
E(x) =
∫ xf(x)dx ,
–∞
then the expected mean value, µ, and the expected standard deviation value, σ, of the
pseudorandom sequence are:
µ = E{x} = 0,
2 1⁄2
σ = [ E{(x – µ) }] = s.
The pseudorandom sequence produces approximately 290 samples before the pattern repeats
itself.
Impulse Pattern
Generates an array containing an impulse pattern.
If Impulse Pattern is represented by the sequence X, the VI generates the pattern according
to the following formula:
The output array contains all frequencies which can be represented with an integral number
of cycles in the requested number of samples. Each frequency-domain component has a
magnitude of spectral amplitude and random phase.
You can think of the output array of PRN as a summation of sinusoidal signals with the same
amplitudes but with random phases. The unit of spectral amplitude is the same as the output
Periodic Random Noise, and is a linear measure of amplitude, similar to other signal
generation VIs.
The VI generates the same periodic random sequence for a given positive seed value. The VI
does not reseed the random phase generator if seed is negative.
samples
The output sequence is bounded by an amplitude of spectral amplitude * -------------------- .
2
You can use PRN to compute the frequency response of a linear system in one time record
instead of averaging the frequency response over several time records, as you must for
nonperiodic random noise sources.
You do not need to window PRN before performing spectral analysis; PRN is self-windowing
and, therefore, has no spectral leakage because PRN contains only integral-cycle sinusoids.
Pulse Pattern
Generates an array containing a pulse pattern.
If the sequence X represents Pulse Pattern, the VI generates the pattern according to the
following formula:
Ramp Pattern
Generates an array containing a ramp pattern.
If the sequence X represents Ramp Pattern, the VI generates the pattern according to the
formula:
Sawtooth Wave
Generates an array containing a sawtooth wave.
If the sequence Y represents Sawtooth Wave, the VI generates the pattern according to the
following formula:
--------
p
- 0 ≤ p < 180
180
sawtooth ( phase [ i ] ) =
--------
p
180 ≤ p < 360
180- – 2.0
The VI is reentrant, so you can use it to simulate a continuous acquisition from a sawtooth
wave function generator. If the input control reset phase is false, subsequent calls to a specific
instance of the VI produce the output Sawtooth Wave array containing the next samples of
a sawtooth wave.
phase out is set to phase[n], and, if reset phase is false, the next time the VI executes this
reentrant VI uses this value as its new phase in.
Sinc Pattern
Generates an array containing a sinc pattern.
If the sequence Y represents Sinc Pattern, the VI generates the pattern according to the
following formula:
The main lobe of the sinc function, sinc(x), is the part of the sinc curve bounded by the
region –1 ≤ x ≤ 1.
When |x| = 1, the sinc(x) = 0.0, and the peak value of the sinc function occurs when
x = 0. Using l'Hôpital's Rule, you can show that sinc(0) = 1 and is its peak value. Thus, the
main lobe is the region of the sinc curve encompassed by the first set of zeros to the left and
the right of the sinc value.
Sine Pattern
Generates an array containing a sinusoidal pattern.
If the sequence Y represents Sinusoidal Pattern, the VI generates the pattern according to the
following formula:
2πi k πφ
where x i = ------------- + --------0- , a is the amplitude, k is the number of cycles in the pattern,
n 180
φ 0 is the initial phase (degrees), and n is the number of samples.
Sine Wave
Generates an array containing a sine wave.
If the sequence Y represents Sine Wave, the VI generates the pattern according to the
following formula:
The VI is reentrant, so you can use it to simulate a continuous acquisition from a sine wave
function generator. If the input control reset phase is false, subsequent calls to a specific
instance of the VI produce the output Sine Wave array containing the next samples of a
sine wave.
phase out is set to phase[n], and if reset phase is false the next time the VI executes, this
reentrant VI uses this value as the new phase in.
Square Wave
Generates an array containing a square wave.
If the sequence Y represents Square Wave, the VI generates the pattern according to the
following formula:
0 ≤ p < ----------360
duty
1.0 100
square ( phase [ i ] ) =
– 1.0 duty
----------360 ≤ p < 360 ,
100
where p = phase[i] modulo 360.0, duty = duty cycle, phase[i] = initial_phase + f*360.0*i;
f is the frequency in normalized units of cycles/sample, initial_phase is phase in if reset
phase is true; or initial_phase is the phase out from the previous execution of this instance of
the VI if reset phase is false.
The VI is reentrant, so you can use it to simulate a continuous acquisition from a square wave
function generator. If the input control reset phase is false, subsequent calls to a specific
instance of this VI produce the output Square Wave array containing the next samples of a
square wave.
phase out is set to phase[n], and if reset phase is false the next time the VI executes, this
reentrant VI uses this value as its new phase in.
Triangle Wave
Generates an array containing a triangle wave.
If the sequence Y represents Triangle Wave, the VI generates the pattern according to the
following formula:
p
----- - 0 ≤ p < 90
90
p
tri ( phase [ i ] ) = 2 – ------ 90 ≤ p < 270
90
p
------ + 4 270 ≤ p < 360
90
The VI is reentrant, so you can use it to simulate a continuous acquisition from a triangle wave
function generator. If the input control reset phase is false, subsequent calls to a specific
instance of the VI produce the output Triangle Wave array containing the next samples of a
triangle wave.
phase out is set to phase[n], and if reset phase is false the next time the VI executes, this
reentrant VI uses this value as its new phase in.
1
------ if – a ≤ x ≤ a
f(x) = 2a
0 elsewhere
where a is the absolute value of the specified amplitude, and given that you can compute the
expected values, E{•}, using the formula
E( x) =
∫ x ( f(x) )dx
–∞
then the expected mean value, µ, and the expected standard deviation value, σ, of the
pseudorandom sequence are
µ = E{x} = 0,
2 1⁄2 a
σ = [E{(x – µ) }] = ------- ≈ 0.57735a .
3
The pseudorandom sequence produces approximately 290 samples before the pattern repeats
itself.
For examples of how to use the digital signal processing VIs, see the
examples located in examples\analysis\dspxmpl.llb.
AutoCorrelation
Computes the autocorrelation of the input sequence X.
For the discrete implementation of this VI, let Y represent a sequence whose indexing can be
negative, let n be the number of elements in the input sequence X, and assume that the indexed
elements of X that lie outside its range are equal to zero,
xj = 0, j < 0 or j ≥ n.
n–1
The elements of the output sequence Rxx are related to the elements in the sequence Y by:
Notice that the number of elements in the output sequence Rxx is 2n – 1. Because you cannot
use negative numbers to index LabVIEW arrays, the corresponding correlation value at t = 0
is the nth element of the output sequence Rxx. Therefore, Rxx represents the correlation
values that the VI shifted n times in indexing. The following block diagram shows one way
to display the correct indexing for the autocorrelation function.
Complex FFT
Computes the Fourier transform of the input sequence X.
You can use this VI to perform an FFT on an array of complex numeric representations.
Y = F{X}.
You also can use this VI to perform the following operations when X has one of the complex
LabVIEW data types.
• The FFT of a complex-valued sequence X
• The DFT of a complex-valued sequence X
This VI first analyzes the input data, and based on this analysis, it calculates the Fourier
transform of the data by executing one of the preceding options. All these routines take
advantage of the concurrent processing capabilities of the CPU and FPU.
n = 2m for m = 1, 2, 3, …, 23,
where n is the number of samples, the VI computes the fast Fourier transform by applying the
split-radix algorithm. The largest complex FFT the VI can compute is 223 = 8,388,608 (8M).
When the number of samples in the input sequence X is not a valid power of 2,
n ≠ 2m for m = 1, 2, 3, …, 23,
where n is the number of samples, the VI computes the discrete Fourier transform by
applying the chirp-z algorithm. The largest complex DFT that can be computed is
222 – 1 = 4,194,303 (4M – 1).
Note Because the VI performs the transform in place, advantages of the FFT include
speed and memory efficiency. The size of the input sequence, however, must be a
power of 2. The DFT can efficiently process any size sequence, but the DFT is
slower than the FFT and uses more memory, because it must store intermediate
results during processing.
Let Y be the complex output sequence and n be the number of samples in it. It can be shown
that
Yn – i = Y – i
which means you can interpret the (n – i)th element of Y as the – ith element of the sequence,
if it could be physically realized, which represents the negative ith harmonic.
Convolution
Computes the convolution of the input sequences X and Y.
h(t) = x(t)*y(t) =
∫ x(τ)y(t – τ) dτ
–∞
For the discrete implementation of the convolution, let h represent the output sequence X * Y,
let n be the number of elements in the input sequence X, and let m be the number of elements
in the input sequence Y. Assuming that indexed elements of X and Y that lie outside their
range are zero,
xi = 0, i < 0 or i ≥ n
and
yj = 0, j < 0 or j ≥ m,
n–1
size = n + m – 1,
where size denotes the total number of elements in the output sequence X * Y.
Cross Power
Computes the cross power spectrum of the input sequences X and Y.
The cross power, Sxy(f), of the signals x(t) and y(t) is defined as
Sxy(f) = X*(f)Y(f)
where X*(f) is the complex conjugate of X(f), X(f) = F{x(t)}, and Y(f) = F{y(t)}.
This VI uses the FFT or DFT routine to compute the cross power spectrum, which is given by
1
S xy = ----2- F∗ { X }F { Y } ,
n
where Sxy represents the complex output sequence Sxy, and n is the number of samples that
can accommodate both input sequences X and Y.
The largest cross power that the VI can compute via the FFT is 223 (8,388,608 or 8M).
When the number of samples in X and Y are equal and are a valid power of 2,
n = m = 2kfor k = 1, 2, 3, …, 23,
where n is the number of samples in X, and m is the number of samples in Y, the VI makes
direct calls to the FFT routine to compute the complex, cross power sequence. This method
is extremely efficient in both execution time and memory management because the VI
performs the operations in place.
n ≠ m,
where n is the number of samples in X, and m is the number of samples in Y, the VI first
resizes the smaller sequence by padding it with zeros to match the size of the larger sequence.
If this size is a valid power of 2,
the VI computes the cross power spectrum using the FFT; otherwise the VI uses the slower
DFT to compute the cross power spectrum. Thus, the size of the complex output sequence is
size = max(n,m).
CrossCorrelation
Computes the cross correlation of the input sequences X and Y.
The cross correlation Rxy(t) of the signals x(t) and y(t) is defined as
For the discrete implementation of this VI, let h represent a sequence whose indexing can be
negative, let n be the number of elements in the input sequence X, let m be the number of
elements in the sequence Y, and assume that the indexed elements of X and Y that lie outside
their range are equal to zero,
xj = 0, j < 0 or j ≥ n,
and
yj = 0, j < 0 or j ≥ m.
n–1
The elements of the output sequence Rxy are related to the elements in the sequence h by
size = n + m – 1
Because you cannot index LabVIEW arrays with negative numbers, the corresponding
cross correlation value at t = 0 is the nth element of the output sequence Rxy. Therefore,
Rxy represents the correlation values that the VI shifted n times in indexing.
The following block diagram shows one way to index the CrossCorrelation VI.
Decimate
Decimates the input sequence X by the decimating factor and the averaging binary control.
If Y represents the output sequence Decimated Array, the VI obtains the elements of the
sequence Y using
x im if ave is false
m–1
yi = 1 for i = 0, 1, 2,..., size–1
m
∑
---- x ( im + k ) if ave is true
k=0
where n is the number of elements in X, m is the decimating factor, ave is the averaging
option, and size is the number of elements in the output sequence Decimated Array.
Deconvolution
Computes the deconvolution of the input sequences X * Y and Y.
The VI can use Fourier identities to realize the convolution operation because
is a Fourier transform pair, where the symbol * denotes convolution, and the deconvolution is
the inverse of the convolution operation. If h(t) is the signal resulting from the deconvolution
of the signals x(t) and y(t), the VI obtains h(t) using the equation
h(t) = F --------- ,
– 1 X(f)
Y(f)
where X(f) is the Fourier transform of x(t), and Y(f) is the Fourier transform of y(t).
The VI performs the discrete implementation of the deconvolution using the following steps:
1. Compute the Fourier transform of the input sequence X * Y.
2. Compute the Fourier transform of the input sequence Y.
3. Divide the Fourier transform of X * Y by the Fourier transform of Y. Call the new
sequence H.
4. Compute the inverse Fourier transform of H to obtain the deconvoluted sequence X.
FFTs is perhaps the most stable generic algorithm not requiring sophisticated
DSP techniques. However, it is not free of errors (for example, when there are
zeros in the Fourier transform of the input sequence Y).
Derivative x(t)
Performs a discrete differentiation of the sampled signal X.
d
f(t) = ----F(t) .
dt
Let Y represent the sampled output sequence dX/dt. The discrete implementation is given by
1
y i = -------- ( x i + 1 – x i – 1 ) for i = 0, 1, 2, …, n –1,
2 dt
The initial condition and final condition minimize the error at the boundaries.
∞
x ( τ)
∫ ---------
1
h(t) = H { x(t) } = – --- - dτ .
π t–τ
–∞
Using Fourier identities, you can show the Fourier transform of the Hilbert transform of x(t) is
1 f>0
sgn ( f ) = 0 f = 0
–1 f<0
The VI completes the following steps to perform the discrete implementation of the Hilbert
transform with the aid of the FFT routines based upon the h(t) ⇔ H(f) Fourier transform pair
(refer to the output format of the FFT VI for more information):
1. Fourier transform the input sequence X: Y = F{X}.
2. Set the DC component to zero: Y0 = 0.
3. If the sequence Y is an even size, set the Nyquist component to zero: YNyq = 0.
4. Multiply the positive harmonics by – j.
5. Multiply the negative harmonics by j. Call the new sequence H, which is of the form
Hk = – j sgn(k) Yk.
6. Inverse Fourier transform H to obtain the Hilbert transform of X.
You use the Hilbert transform to extract instantaneous phase information, obtain the
envelope of an oscillating signal, obtain single-sideband spectra, detect echoes, and reduce
sampling rates.
Note Because the VI sets the DC and Nyquist components to zero when the number of
elements in the input sequence is even, you cannot always recover the original
signal with an inverse Hilbert transform. The Hilbert transform works well with
bandpass limited signals, which exclude the DC and the Nyquist components.
FHT
Computes the fast Hartley transform (FHT) of the input sequence X.
X(f) =
∫ x(t)cas ( 2πft ) dt
–∞
If Y represents the output sequence Hartley{X} obtained via the FHT, then Y is obtained
through the discrete implementation of the Hartley integral:
n–1
∑ X cas ----------
- , for k = 0, 1, 2, …, n – 1.
2πik
Yk = i
n
i=0
FHT maps real-valued sequences into real-valued frequency domain sequences. You can use
it instead of the Fourier transform to convolve signals, deconvolve signals, correlate signals,
and find the power spectrum. You can also derive the Fourier transform from the Hartley
transform.
When the sequences to be processed are real-valued sequences, the Fourier transform
produces complex-valued sequences in which half of the information is redundant. The
advantage of using the FHT instead of the FFT transform is that the FHT uses half the
memory to produce the same information the FFT produces. Further, the FHT is calculated in
place and is as efficient as the FFT. The disadvantage of the FHT is that the size of the input
sequence must be a valid power of 2.
Integral x(t)
Performs the discrete integration of the sampled signal X.
F( t) =
∫ f(t) dt
Let Y represent the sampled output sequence Integral X. The VI obtains the elements of Y
using
∑ (x
1
y i = --- j–1 + 4x j + x j + 1 ) dt for i = 0, 1, 2, …, n – 1,
6
j=0
initial condition and final condition minimize the overall error by increasing the accuracy at
the boundaries, especially when the number of samples is small. Determining boundary
conditions before the fact enhances accuracy.
You can use this VI to perform an inverse FFT on an array of one of the LabVIEW complex
numeric representations.
Y = F – 1{X}.
You can use this VI to perform the following operations when FFT {X} has one of the
complex LabVIEW data types:
• The inverse FFT of a complex-valued sequence X
• The inverse DFT of a complex-valued sequence X
This FFT VI first analyzes the input data, and, based on this analysis, inverse Fourier
transforms the data by executing one of the preceding options. All these routines take
advantage of the concurrent processing capabilities of the CPU and FPU.
where n is the number of samples, the VI computes the inverse FFT by applying the split-radix
algorithm. The longest sequence with an inverse complex FFT that the VI can compute is
223=8,388,608 (8M).
When the number of samples in the input sequence X is not a valid power of 2,
n ≠ 2m for m = 1, 2, 3, …, 23,
where n is the number of samples, the VI computes the inverse DFT by applying the chirp-z
algorithm. The longest sequence with an inverse complex DFT that the VI can compute
is 222 – 1 (4,194,303 or 4M – 1).
Note Because the VI performs the transform in place, advantages of the FFT include
speed and memory efficiency. The size of the input sequence, however, must be a
power of 2. The DFT can efficiently process any size sequence, but the DFT is
slower than the FFT and uses more memory because it must store intermediate
results during processing.
∞
h(τ)
∫ ---------
–1 1
h(t) = H { h(t) } = --- - dτ .
π t–τ
–∞
∞
x ( τ)
∫ ---------
1
h(t) = H { x(t) } = – --- - dτ ,
π t–τ
–∞
you obtain the inverse Hilbert transform by negating the forward Hilbert transform
The VI completes the following steps to perform the discrete implementation of the inverse
Hilbert transform with the aid of the Hilbert transform.
1. Hilbert transform the input sequence X: Y = H{X}.
2. Negate Y to obtain the inverse Hilbert transform: H – 1{X} = –Y.
Inverse FHT
Computes the inverse fast Hartley transform (FHT) of the input sequence X.
x(t) =
∫ X(f)cas ( 2πft ) df
–∞
If Y represents the output sequence Inv FHT {X}, the VI calculates Y through the discrete
implementation of the inverse Hartley integral:
n–1
∑ X cas ----------
1 2πik
Y k = --- i - , for k = 0, 1, 2,…, n – 1.
n n
i=0
The inverse Hartley transform maps real-valued frequency sequences into real-valued
sequences. You can use it instead of the inverse Fourier transform to convolve, deconvolve,
and correlate signals. You can also derive the Fourier transform from the Hartley transform.
See the FHT section earlier in this chapter for a comparison of the Fourier and Hartley
transforms.
This VI executes inverse FFT routines if the size of the input sequence is a valid power of 2:
If the size of the input sequence is not a power of 2, this VI calls an efficient Inverse DFT
routine.
The output sequence X = Inverse Real FFT [FFT{X}] is real and it returns in one real array.
Power Spectrum
Computes the power spectrum of the input sequence X.
This VI uses the FFT and DFT routines to compute the power spectrum, which is given by
1 2
S xx = ----2- F { X } ,
n
where Sxx represents the output sequence Power Spectrum, and n is the number of samples
in the input sequence X.
this VI computes the FFT of a real-valued sequence using the split-radix algorithm and
efficiently scales the magnitude square. The largest power spectrum the VI can compute using
the FFT is 223 (8,388,608 or 8M).
When the number of samples in the input sequence X is not a valid power of 2,
n ≠ 2m for m = 1, 2, 3,…, 23,
where n is the number of samples, this VI computes the discrete Fourier transform of a
real-valued sequence using the chirp-z algorithm and scales the magnitude square. The largest
power spectrum the VI can compute using the fast DFT is 222 – 1 (4,194,303 or 4M - 1).
The FFT computation of the power spectrum is time and memory efficient because the
transform is real and done in the same space. However, the size of the input sequence must be
exactly a power of 2. The DFT version efficiently computes the power spectrum of any size
sequence. The DFT version is slower than the FFT version, uses more memory, and is not as
efficient in scaling.
Let Y be the Fourier transform of the input sequence X, and let n be the number of samples in
it. It can be shown that
2 2
Yn – i = Y –i .
You can interpret the power in the (n – i)th element of Y as the power in the – ith element of the
sequence, which represents the power in the negative ith harmonic. You can find the total
power for the ith harmonic (DC and Nyquist component not included) using
th n
Power in i harmonic = 2 Y i 2 = Y i 2 + Y n – i 2, 0 < i < --- .
2
2 2
The total power in the DC and Nyquist components are Y 0 and Y n ⁄ 2 , respectively.
Real FFT
Computes the Real Fast Fourier Transform (FFT) or the Real Discrete Fourier Transform
(DFT) of the input sequence X.
The input sequence is real-valued. The Real FFT VI automatically determines the options,
which are the following:
• FFT of a real-valued sequence
• DFT of a real-valued sequence
The Real FFT VI executes FFT routines if the size of the input sequence is a valid power of 2:
If the size of the input sequence is not a power of 2, the Real FFT VI calls an efficient
Real DFT routine.
The output sequence Y = Real FFT[X] is complex and returns in one complex array:
Y = YRe + jYIm
Unwrap Phase
Unwraps the Phase array by eliminating discontinuities whose absolute values exceed Π.
Let the sequence Y represent the output sequence Clipped Array; then the elements of Y are
related to the elements of Input Array by
a xi > a
y i = x i b ≤ x i ≤ a for i = 0, 1, 2,…, n – 1,
b xi < b
where n is the number of elements in Input Array, a is upper limit, and b is lower limit.
Y[i] = X[i-n]
Shifts the elements in Input Array by the specified number of shifts.
Let the sequence Y represent the output sequence Shifted Array; then the elements of Y are
related to the elements of X by
x i – shifts if 0 ≤ i – shifts < n for i = 0, 1, 2, . . ., n-1 ,
yi =
0 elsewhere
Note This VI does not rotate the elements in the array. The VI disposes of the elements
of the input sequence shifted outside the range, and you cannot recover them by
shifting the array in the opposite direction.
Zero Padder
Resizes the input sequence Input Array to the next higher valid power of 2, sets the new
trailing elements of the sequence to zero, and leaves the first n elements unchanged, where
n is the number of samples in the input sequence.
This VI is useful when the size of the acquired data buffers is not a power of 2, and you want
to take advantage of fast processing algorithms in the analysis VIs. These algorithms include
Fourier transforms, power spectrum, and FHTs, which are extremely efficient for buffer sizes
that are a power of 2.
For examples of how to use the measurement VIs, see the examples
using data acquisition located in examples\analysis\measure\
daqmeas.llb and using simulated signals in examples\analysis\
measure\measxmpl.llb.
Measurement VI Descriptions
The following Measurement VIs are available.
AC & DC Estimator
Computes an estimate of the AC and DC levels of the input signal.
FFT(Signal)
-----------------------------
N
where N is the number of points in the Signal array. The VI then converts the amplitude
spectrum to single-sided rms magnitude and phase spectra.
FFT*(Signal) x FFT(Signal)
-------------------------------------------------------------------
-
N2
where N is the number of points in the Signal array and * denotes complex conjugate. The VI
then converts the power spectrum into a single-sided power spectrum result.
FFT*(Signal X) x FFT(Signal Y)
-------------------------------------------------------------------------------
-
N2
where N is the number of points in Signal X or Signal Y arrays. The VI then converts the
cross power spectrum to single-sided magnitude and phase spectra.
Harmonic Analyzer
Finds the fundamental and harmonic components (amplitude and frequency) present in
the input Auto Power Spectrum, and computes the percent of total harmonic distortion
(%THD) and the total harmonic distortion plus noise (%THD + Noise).
You must pass the windowed, auto power spectrum of your signal to this VI for it to function
correctly. You should pass your time-domain signal through the scaled time domain window
and then through the Auto Power Spectrum, connecting the Auto Power Spectrum output to
this VI.
The Impulse Response is in the time domain, so you do not need to convert time units to
frequency units. The Impulse Response is the inverse transform of the transfer function.
The signals X (Stimulus Signal) and Y (Response Signal) include coherence, averaged cross
power spectrum magnitude and phase, averaged transfer function (Frequency Response),
and averaged Impulse Response.
You usually compute these functions on the stimulus and response signals from a network
under test. The coherence function shows the frequency content of the Response Signal Y
due to Stimulus Signal X and measures the validity of the network frequency response
measurement.
You can use this VI to measure the coherence between any two signals. The VI averages
multiple stimulus and response signals to get valid coherence measurements. Cross Power
Spectrum and Impulse Response are the rms averaged versions of the similarly named VIs.
Frequency Response is the rms averaged version of the frequency response outputs of the
Transfer Function VI.
Peak Detector
For information on this VI, see Chapter 47, Additional Numerical Method VIs, in this
manual.
With this VI, you can achieve good frequency estimates for measured frequencies that lie
between frequency lines on the spectrum. The VI makes corrections for the window function
you use.
Pulse Parameters
Analyzes the input sequence X for a pulse pattern and determines the best set of pulse
parameters that describes the pulse.
The waveform-related parameters are slew rate, overshoot, topline (top), amplitude,
baseline (base), and undershoot. The time-related parameters are risetime, falltime,
width (duration), and delay.
The VI interpolates width and delay to obtain a more accurate result not only of width and
delay, but also of slew rate, risetime, and falltime.
If X contains a train of pulses, the VI uses the train to determine overshoot, top, amplitude,
base, and undershoot, but uses only the first pulse in the train to establish slew rate,
risetime, falltime, width, and delay.
Note Because pulses commonly occur in the negative direction, this VI can discriminate
between positive and negative pulses and can analyze the X sequence correctly.
You do not need to process the sequence before analyzing it.
The VI scales the result so that when the power or amplitude spectrum of Windowed
Waveform is computed, all windows provide the same level within the accuracy constraints
of the window. This VI also returns important Window Constants for the selected window.
These constants are useful when you use VIs that perform computations on the power
spectrum, such as the Power & Frequency Estimate and Spectrum Unit Conversion VIs.
Transfer Function
Computes the transfer function (also known as the frequency response) from the time-domain
Stimulus Signal and Response Signal from a network under test.
This VI computes the transfer function of a system based on the real signals X
(Stimulus Signal) and Y (Response Signal). The output is the amplitude gain of the
network, which is unitless.
For examples of how to use the Filter VIs, see the examples located in
examples\analysis\fltrxmpl.llb.
Filter VI Descriptions
The following Filter VIs are available.
Bessel Coefficients
Generates the set of filter coefficients to implement an IIR filter as specified by the
Bessel filter model. You can then pass these coefficients to the IIR Cascade Filter VI.
Bessel Filter
Generates a digital, Bessel filter using filter type, sampling freq: fs, high cutoff freq: fh,
low cutoff freq: fl, and order by calling the Bessel Coefficients VI. The VI then calls the
IIRCascade Filter to filter the X sequence using this model to obtain a Bessel Filtered X
sequence.
Butterworth Coefficients
Generates the set of filter coefficients to implement an IIR filter as specified by the
Butterworth filter model. You can pass these filter coefficients (IIR Filter Cluster) to the
IIR Cascade Filter VI to filter a sequence of data.
Butterworth Filter
Generates a digital Butterworth filter using sampling freq: fs, low cutoff freq: fl, high cutoff
freq: fh, order, and filter type by calling the Butterworth Coefficients VI. The Butterworth
Filter VI then calls the IIR Cascade Filter VI to filter the X sequence using this model to get
a Butterworth Filtered X sequence.
Cascade→Direct Coefficients
Converts IIR filter coefficients from the cascade form to the direct form.
As an example, you can convert a cascade filter, composed of two second-order stages, to a
direct form filter as follows:
Reverse Coefficients: {a11, a21, a12, a22} → {1.0, a1, a2, a3, a4}
Forward Coefficients: {b01, b11, b21, b02, b12, b22} → {b0, b1, b2, b3, b4}
See the IIR Cascade Filter VI for information about cascade form filtering, the IIR Filter VI
for information on direct form filtering.
Chebyshev Coefficients
Generates the set of filter coefficients to implement an IIR filter as specified by the Chebyshev
filter model. You can pass these coefficients to the IIR Cluster Filter VI to filter a sequence
of data.
Chebyshev Filter
Generates a digital, Chebyshev filter using sampling freq: fs, low cutoff freq: fl,
high cutoff freq: fh, ripple, order, and filter type by calling the Chebyshev Coefficients VI.
The Chebyshev Filter VI filters the X sequence using this model to obtain a Chebyshev
Filtered X sequence by calling the IIR Cascade Filter VI.
Convolution
For information about Convolution, see Chapter 39, Digital Signal Processing VIs.
Elliptic Coefficients
Generates the set of filter coefficients to implement a digital elliptic IIR filter. You can pass
these coefficients to the IIR Cascade Filter VI.
Elliptic Filter
Generates a digital, elliptic filter using sampling freq: fs, low cutoff freq: fl,
high cutoff freq: fh, filter type, passband ripple, stopband attenuation, and order by
calling the Elliptic Coefficients VI. The Elliptic Filter VI then calls the IIR Filter VI to
filter the X sequence using this model to obtain an elliptic Filtered X sequence.
Equiripple BandPass
Generates a bandpass FIR filter with equi-ripple characteristics using the Parks-McClellan
algorithm and higher pass freq, lower pass freq, # of taps, lower stop freq, higher
stop freq, and sampling freq: fs. The VI then filters the input sequence X to obtain the
bandpass, filtered, linear-phase sequence Filtered Data.
The first stopband of the filter region goes from zero (DC) to lower stop freq. The passband
region goes from lower pass freq to higher pass freq, and the second stopband region goes
from higher stop freq to the Nyquist frequency.
Equiripple BandStop
Generates a bandstop FIR digital filter with equi-ripple characteristics using the
Parks-McClellan algorithm and higher pass freq, lower pass freq, # of taps, lower stop
freq, higher stop freq, and sampling frequency: fs. The VI then filters the input sequence
X to obtain the bandstop, filtered, linear-phase sequence Filtered Data.
The first passband region of the filter goes from zero (DC) to lower pass freq. The stopband
region goes from lower stop freq to higher stop freq, and the second passband region goes
from higher pass freq to the Nyquist frequency.
Equiripple HighPass
Generates a highpass FIR filter with equi-ripple characteristics using the Parks-McClellan
algorithm and # of taps, stop freq, high freq, and sampling freq. The VI then filters the input
sequence X to obtain the highpass, filtered, linear-phase sequence Filtered Data.
The stopband of the filter goes from zero (DC) to stop freq. The transition band goes from
stop freq to high freq, and the passband goes from high freq to the Nyquist frequency.
Equiripple LowPass
Generates a lowpass FIR filter with equiripple characteristics using the Parks-McClellan
algorithm and the # of taps, pass freq, stop freq, and sampling freq. The VI then filters the
input sequence X to obtain the lowpass filtered, linear-phase sequence Filtered Data.
The passband of the filter goes from zero (DC) to pass freq. The transition band goes from
pass freq to stop freq, and the stopband goes from stop freq to the Nyquist frequency.
The following figures show how the narrowband filter parameters define the lowpass,
highpass, bandpass, and bandstop filters. The passband ripple is shown as SP. The filter
response on the Y axis is shown on a linear scale. For this reason, the stopband attenuation Ar
was mapped to a linear attenuation using the following equations:
A r = – 20 log δ A
– Ar
---------
20
δ A = 10 .
Second-Order Filtering
Each second-order stage (stage number k = 1, 2, ..., Ns) has two reverse coefficients (a1k, a2k),
and three forward coefficients (b0k, b1k, b2k). The total number of reverse coefficients is 2Ns
and the total number of forward coefficients is 3Ns. The reverse coefficients and the forward
coefficients array contain the coefficients for one stage followed by the coefficients for the
next stage, and so on. For example, an IIR filter composed of two second-order stages must
have a total of four reverse coefficients and six forward coefficients, as follows:
Fourth-Order Filtering
For fourth order cascade stages, the filtering is implemented in the same manner as in the
second-order stages, but each stage must have four reverse coefficients (a1k, ..., a4k) and five
forward coefficients (b0k,..., b4k).
IIR Filter
Filters the input sequence X using the direct form IIR filter specified by Reverse Coefficients
and Forward Coefficients.
If y represents the output sequence Filtered X, the VI obtains the elements of y using
n–1 m–1
1
y i = -----
a0 ∑b x j i–j – ∑a y k i – k
,
j=0 k=1
where n is the number of Forward Coefficients (represented by bj), and m is the number of
Reverse Coefficients (represented by ak).
If y represents the output sequence Filtered X, the VI obtains the elements of y using
n–1 m–1
1
y i = -----
a0 ∑b x j i–j – ∑a y k i – k
,
j=0 k=1
where n is the number of Forward Coefficients (represented by bj), and m is the number of
Reverse Coefficients (represented by ak).
The Inv Chebyshev Coefficients VI is a subVI of the Inverse Chebyshev Filter VI.
Median Filter
Applies a median filter of rank to the input sequence X.
If Y represents the output sequence Filtered Data, and if Ji represents a subset of the input
sequence X centered about the ith element of X
and if the indexed elements outside the range of X equal zero, the VI obtains the elements
of y using
yi = Median(Ji) for i = 0, 1, 2, …, n – 1,
where n is the number of elements in the input sequence X, and r is the filter rank.
Parks-McClellan
Generates a set of linear-phase FIR multiband digital filter coefficients using # of taps,
sampling freq: fs, Band Parameters, and filter type.
Note This VI finds the coefficients using iterative techniques based upon an error
criterion. Although you specify valid filter parameters, the algorithm might fail to
converge.
The Parks-McClellan VI generates only the filter coefficients. It does not perform the
filtering function. To filter a sequence X using the set of FIR filter coefficients h, use the
Convolution VI with X and h as the input sequences.
For examples of how to use the window VIs, see the examples located in
examples\analysis\windxmpl.llb.
Window VI Descriptions
The following Window VIs are available.
Blackman Window
Applies a Blackman window to the input sequence X.
2πi
w = -------- ,
n
Blackman-Harris Window
Applies a three-term, Blackman-Harris window to the input sequence X.
for i = 0, 1, 2, …, n – 1
2πi
w = -------- ,
n
If y represents the output sequence Cosine Tapered{X}, the VI obtains the elements of y from
0.5x i ( 1 – cos w ) for i = 0, 1, 2, ..., m-1, and for i = n-m, n-m+1, ..., n-1
yi =
xi elsewhere
2πi
where w = -------- ,
n
Using this window is the equivalent of applying the Hanning window to the first and last 10%
of the input sequence X.
If y represents the output sequence Exact Blackman{X}, the VI obtains the elements
of y from
2πi
w = -------- ,
n
Exponential Window
Applies an exponential window to the input sequence X.
If y represents the output sequence Exponential{X}, the VI obtains the elements of y from
yi = xi exp(ai) for i = 0, 1, 2, …, n – 1,
ln ( f )
a = ------------ ,
n–1
If y represents the output sequence Flattop{X}, the VI obtains the elements of y from
for i = 0, 1, 2, …, n–1
2πi
w = -------- ,
n
Force Window
Applies a force window to the input sequence X.
If y represents the output sequence Force{X}, the VI obtains the elements of y from
x i if 0 ≤ i ≤ d
for i = 0, 1, 2, ..., n-1
yi =
0 elsewhere
If a represents the Cosine Coefficients input sequence and y represents the output sequence
GenCos{X}, the VI obtains the elements of y from
m–1
∑ ( –1 ) a cos ( kw )
k
yi = xi k for i = 0, 1, 2, …, n–1
k=0
2πi
w = -------- ,
n
Hamming Window
Applies a Hamming window to the input sequence X.
If y represents the output sequence Hamming{X}, the VI obtains the elements of y from
2πi
w = -------- ,
n
Hanning Window
Applies a Hanning window to the input sequence X.
If y represents the output sequence Hanning {X}, the VI obtains the elements of y using
2πi
w = -------- ,
n
Kaiser-Bessel Window
Applies a Kaiser-Bessel window to the input sequence X(t).
2
I o ( β 1.0 – a )
y i = x i -----------------------------------
- for i = 0, 1, 2, …, n – 1
Io ( β )
i–k
a = ---------- ,
k
n–1
k = ------------ ,
2
where n is the number of elements in X(t), and Io(•) is the zero-order modified Bessel
function.
Triangle Window
Applies a triangular window to the input sequence X.
Note The Triangle smoothing window is also known as the Bartlett smoothing window.
If y represents the output sequence Triangle{X}, the VI obtains the elements of y from
2i – n
w = -------------- ,
n
For examples of how to use the regression VIs, see the examples located in
examples\analysis\regressn.llb.
Exponential Fit
Finds the exponential curve values and the set of exponential coefficients amplitude and
damping, which describe the exponential curve that best represents the input data set.
F = aeτX,
where F is the output sequence Best Exponential Fit, X is the input sequence X Values, a is
the amplitude, and τ is the damping constant.
n–1
∑ (f – y ) ,
1 2
mse = --- i i
n
i=0
where f is the output sequence Best Exponential Fit, y is the input sequence Y Values, and
n is the number of data points.
F = aeτX,
where F is the sequence representing the best fitted values, X represents the input sequence
X Values, a is amplitude, and τ is the damping constant.
You can use this VI to solve multiple linear regression problems. You can also use it to solve
for the linear coefficients in a multiple-function equation.
∑a x
j
fi = j i
j=0
where f represents the output sequence Best Polynomial Fit, x represents the input sequence
X Values, a represents the Polynomial Fit Coefficients, and m is the polynomial order.
Linear Fit
Finds the line values and the set of linear coefficients slope and intercept, which describe the
line that best represents the input data set.
F = mX + b,
where F represents the output sequence Best Linear Fit, X represents the input sequence
X Values, m is slope, and b is intercept.
n–1
∑ (f – y )
1 2
mse = --- i i ,
n
i=0
where F represents the output sequence Best Linear Fit, y represents the input sequence
Y Values, and n is the number of data points.
F = mX + b,
where F is the sequence representing the best fitted values. X represents the input sequence
X Values, m is the slope, and b is the intercept.
Polynomial Interpolation
Interpolates or extrapolates the function f at x, given a set of n points (x , y ), where
i i
f(x ) = y , f is any function, and given a number, x. The VI calculates output interpolation
i i
value Pn –1(x), where Pn –1 is the unique polynomial of degree n –1 that passes through the
n points (x , y ).
i i
Rational Interpolation
Interpolates or extrapolates f at x using a rational function.
P ( xi ) p0 + p1 xi + … + pm x m i-
- = ------------------------------------------------------
------------
Q ( xi ) q0 + q1 xi + … + qv x v
passes through all the points formed by Y Array and X Array. P and Q are polynomials, and
the rational function is unique, given a set of n points (x , y ), where f(x ) = y , f is any function,
i i i i
and given a number x in the range of the x values. This VI calculates the output interpolation
P(x) i
value y using y = ------------ . If the number of points is odd, the degrees of freedom of P and Q
n–1 Q(x) n
are ------------ . If the number of points is even, the degrees of freedom of P are --- – 1 , and the
2 n 2
degrees of freedom of Q are --- , where n is the total number of points formed by Y Array and
2
X Array.
Spline Interpolant
Returns an array Interpolant of length n, which contains the second derivatives of the spline
interpolating function g(x) at the tabulated points x , where i = 0, 1, ..., n–1. Input arrays
i
X Array and Y Array are of length n and contain a tabulated function, y = f(x ), with
i i
x0<x1<...xn–1. initial boundary and final boundary are the first derivative of the
interpolating function g(x) at points 0 and n –1, respectively.
If initial boundary and final boundary are equal to or greater than 1030, the VI sets the
corresponding boundary condition for a natural spline, with zero second derivative on that
boundary.
{xi,yi}, g(xi) = yi
where i = 0, 1,..., n–1.
The VI obtains the interpolating function g(x) by interpolating every interval [xi, xi+1] with a
cubic polynomial function p (x) that meets the following conditions:
i
• pi(xi) = yi
• pi(xi+1) = yi+1
• g(x) has continuous first and second derivatives everywhere in the range [x0, xn–1]:
– p'i ( x i ) = p'i+1 ( x i )
– p''
i
( x i ) = p''i+1 ( x i )
xi – xi – 1 xi + 1 – xi – 1 xi + 1 – xi
-------------------
- g'' ( x ) + --------------------------g'' ( x ) + -------------------
-g'' ( x )
6 i–1 3 i 6 i+1
yi + 1 – yi yi – yi – 1
= -------------------
- – -------------------- i = 1, 2, ...n – 2
xi + 1 – xi xi – xi – 1
i = 0, 1,…, n – 1. This VI computes g'' ( x ) , g'' ( x from initial boundary and final
0 n – 1)
boundary using the formula
y i + 1 – y i 3A 2 – 1
- + ------------------ ( x i + 1 – x i )g'' ( x )
g' ( x ) = -------------------
xi + 1 – xi 6 i
3B 2 – 1
+ ------------------ ( x i + 1 – x i )g'' ( x ) .
6 i+1
Here,
xi + 1 – x x – xi
A = -------------------
- B = 1 – A = -------------------
-
xi + 1 – xi xi + 1 – xi
You can derive this formula from the preceding conditions. This VI then uses g'' ( x ) ,
0
g'' ( x to solve all the g'' ( x ) , for i = 1, … n – 2. g'' ( x ) is the output Interpolant.
n – 1) i i
You can use Interpolant as an input to the Spline Interpolation VI to interpolate y at any
value of x 0 ≤ x ≤ x n – 1 .
Spline Interpolation
Performs a cubic spline interpolation of f at x, given a tabulated function.
This VI performs cubic spline interpolation using a tabulated function in the form of
y = f(x ) for i = 0, 1, ..., n – 1, and given the second derivatives Interpolant that the VI
i i
obtains from the Spline Interpolant VI. The value of x must be in the range of X values.
The points are formed by the input arrays X and Y, and n is the total number of points.
y = Ay i + By i + 1 + Cy'' i + Dy'' i + 1,
and
xi + 1 – x
A = -------------------
-,
xi + 1 – xi
B = 1 – A,
1 3 2
C = --- ( A – A ) ( x i + 1 – x i ) ,
6
1 3 2
D = --- ( B – B ) ( x i + 1 – x i ) .
6
For examples of how to use the statistics VIs, see the examples located in
examples\analysis\statxmpl.llb.
Note These VIs are not available in the Base Analysis package.
1D ANOVA
Takes an array, X, of experimental observations made at various levels of a factor, with at least
one observation per level, and performs a one-way analysis of variance in the fixed effect
model. In the one-way analysis of variance, the VI tests whether the level of the factor has an
effect on the experimental outcome.
Now, suppose that you make a series of observations to see how many sit-ups people can do.
If you take a random sampling of five people, you might find the following results:
Person 1 8 years old (level 0) 10 sit-ups
Person 2 12 years old (level 1) 15 sit-ups
Person 3 16 years old (level 2) 20 sit-ups
Person 4 20 years old (level 2) 25 sit-ups
Person 5 13 years old (level 1) 17 sit-ups
Notice that you have made at least one observation per level. To perform an analysis of
variance, you must make at least one observation per level.
To perform the analysis of variance, you specify an array X of observations, with values 10,
15, 20, 25, and 17. The array Index specifies the level (or category) to which each observation
applies. In this case, Index has the values 0, 1, 2, 2, and 1. Finally, there are three possible
levels, so you pass in a value of 3 for the # of levels parameter.
2D ANOVA
Takes an array of experimental observations made at various levels of two factors and
performs a two-way analysis of variance.
Now, suppose that you made a series of observations to see how many sit-ups people could
do. If you took a random sampling of n people, you might find the following results:
and so on.
If you plot observations as a function of factor A and factor B, they fall into cells of a matrix
with factor A as rows and factor B as columns. Each cell must contain at least one observation,
and each cell must contain the same number of observations.
To perform the analysis of variance, you specify an array X of observations, with values 10,
15, 20, 25, 17, and 4. The array Index A specifies the level (or category) of factor A to which
each observation applies. In this case, the array would have the values 0, 1, 1, 1, 0, and 0.
The array Index B specifies the level (or category) of factor B to which each observation
applies. In this case, the array would have the values 0, 0, 2, 1, 1, and 2. Finally, there are two
possible levels for factor A and three possible levels for factor B, so you pass in a value of 2
for the A levels parameter, and a value of 3 for the B levels parameter.
You can apply any one of the following models, where L is the specified observations
per cell:
• Model 1: Fixed-effects with no interaction and one observation per cell (per specified
levels x and y of the factors A and B, respectively).
• Model 2: Fixed-effects with interaction and L > 1 observations per cell.
• Model 3: Either of the mixed-effects models with interaction and L > 1 observations
per cell.
• Model 4: Random-effects with interaction and L > 1 observations per cell.
3D ANOVA
Takes an array of experimental observations made at various levels of three factors and
performs a three-way analysis of variance. In any ANOVA, you look for evidence that the
factors or interactions among factors have a significant effect on experimental outcomes.
What varies with each model is the method used to do this.
The three-way ANOVA models are as follows, where L is the number of observations
per cell:
• Fixed-effects with interaction and L > 1 observations per cell.
• Any of the six mixed-effects models with interaction and L > 1 observations per cell.
• Random-effects with interaction and L > 1 observations per cell.
A factor is a basis for categorizing data. A cell of data consists of all those experimental
observations that fall in particular levels of the three factors. The number of observations that
fall in a cell must be some constant number, L, which does not vary between cells. See the
description of factors, levels, and cells in the 2D ANOVA VI description. Remember that a
cell in this 3D ANOVA VI is the intersection of three factors instead of two as described in
the 2D ANOVA VI description.
Contingency Table
Classifies and tallies objects of experimentation according to two schemes of categorization.
With the χ2 test of homogeneity, the VI takes a random sample of some fixed size from each
of the categories in one categorization scheme. For each of the samples, the VI categorizes
the objects of experimentation according to the second scheme, and tallies them. The VI tests
the hypothesis to determine whether the populations from which each sample is taken are
identically distributed with respect to the second categorization scheme.
With the χ2 test of independence, the VI takes only one sample from the total population. The
VI then categorizes each object and tallies it in two categorization schemes. The VI tests the
hypothesis that the categorization schemes are independent.
You must choose a level of significance for each test. This is how likely you want it to be that
the VI rejects the hypothesis when it is true. Ordinarily, you do not want it to be very likely.
So you should use a small number (0.05 or 5 percent is a common choice) to determine the
level of significance. The output parameter probability is the level of significance at which
the hypothesis is rejected. Thus, if probability is less than the level of significance, you must
reject the hypothesis.
erf(x)
Evaluates the error function at the input value.
erfc(x)
Evaluates the complementary error function at the input value.
F Distribution
Computes the one-sided probability, p, of the F-distributed random variable, F, with the
specified n and m degrees of freedom
General Histogram
Finds the discrete histogram of the input sequence X based on the given bin specifications.
The VI obtains Histogram as follows. First, the VI establishes all the intervals (also called
bins) based on the information in the input array Bins. The intervals (bins) are:
where
Bins[i].lower is the value lower in the ith cluster of array Bins, Bins[i].upper is the value
upper in the ith cluster of array Bins, k is the number of elements in Bins, which consists of
the number of total intervals (bins).
Whether the two ending points Bins[i].lower and Bins[i].upper of each interval (bin) are
included in the interval (bin) ∆i depends on the value of bin inclusion in the corresponding
cluster i of the Bins.
Histogram
Finds the discrete histogram of the input sequence X. The histogram is a frequency count of
the number of times that a specified interval occurs in the input sequence.
X = {0, 1, 3, 3, 4, 4, 4, 5, 5, 8},
The VI obtains Histogram: h(x) as follows. The VI scans the input sequence X to determine
the range of values in it. Then the VI establishes the interval width, ∆x, according to the
specified number of intervals,
max – min
∆x = ------------------------- ,
m
where max is the maximum value found in the input sequence X, min is the minimum value
found in the input sequence X, and m is the specified number of intervals.
Let χ represent the output sequence X Values, because the histogram is a function of X. The
VI evaluates elements of χ using
The VI defines the ith interval ∆i to be the range of values from χ – 0.5 ∆x up to but not
i
including χ + 0.5 ∆x,
i
1 ifx ∈ ⊇ ∆ i
yi ( x ) = .
0 elsewhere
The function has unity value if the value of x falls within the specified interval. Otherwise it
is zero. Notice that the interval ∆i is centered about χi, and its width is ∆x.
The last interval, ∆m–1, is defined as [χm–ι– 0.5∆x : χm –ι + 0.5∆x]. In other words, if a value
is equal to max, it is counted as belonging to the last interval.
n–1
where hi represents the elements of the output sequence Histogram: h(x), and n is the
number of elements in the input sequence X.
p = Prob {X ≤ x}
Inv F Distribution
Computes the value of x such that the condition
p = { Prob n, m ≤ X }
is satisfied, given the probability value p of an F-distributed random variable, F, with n and
m degrees of freedom.
p = Prob {X ≤ x}
Inv T Distribution
Computes the value of x such that the condition
p = Prob {Tn ≤ x}
Mean
Computes the mean (average) of the values in the input sequence X.
n–1
∑x ,
1
µ = --- i
n
i=0
Median
Finds the median value of the input sequence X by sorting the values of X and selecting the
middle element(s) of the sorted array.
Let n be the number of elements in the input sequence X, and let S be the sorted sequence
of X. The VI finds median using the following identity:
s if n is odd
i
median =
0.5 ( s k – 1 + s k ) if n is even
n–1 n
where i = ------------ , and k = --- .
2 2
Mode
Finds the mode of the input sequence X.
th
Let m be the desired order. The VI computes the m -order moment using the formula:
n–1
∑ (x – µ)
m 1 m
σ x = --- i ,
n
i=0
where σxm is the mth-order moment, and n is the number of elements in the input sequence X.
MSE
Computes the mean squared error (mse) of the input sequences X Values and Y Values.
n–1
∑ (x – y )
1 2
mse = --- i i ,
n
i=0
Normal Distribution
Computes the one-sided probability, p, of the normally distributed random variable, x,
RMS
Computes the root mean square (rms) of the input sequence X.
Sample Variance
Computes the mean and sample variance of the values in the input sequence X.
Note If you need to compute the sample standard deviation of X, take the square root of
sample variance.
Standard Deviation
Computes the mean value and the standard deviation of the values in the input
sequence X.
This VI computes standard deviation (σx) and mean (µ) using the following formula:
n–1
∑ (x – µ)
1 2
σx = --- i ,
n
i=0
n–1
T Distribution
Computes the one-sided probability, p, of the t-distributed random variable, T , with the
n
specified degrees of freedom
Variance
Computes the variance and the mean value of the input sequence X.
This VI computes variance (σx2) and mean (µ) using the following formula:
n–1
∑ (x – µ)
2 1 2
σ x = --- i ,
n
i=0
n–1
For examples of how to use the linear algebra VIs, see examples located in
examples\analysis\linaxmpl.llb.
AxB
Performs the matrix multiplication of two input matrices.
If A is an n-by-k matrix and B is a k-by-m matrix, the matrix multiplication of A and B, C = AB,
results in a matrix, C, whose dimensions are n-by-m. Let A represent the 2D input array
A matrix, B represent the 2D input array B matrix, and C represent the 2D output array A * B.
The VI obtains the elements of C using the formula
i = 0, 1, 2, ..., n – 1
k–1
c ij = ∑a b il lj for
j = 0, 1, 2, ..., m – 1
,
l=0
where n is the number of rows in A matrix, k is the number of columns in A matrix and the
number of rows in B matrix, and m is the number of columns in B matrix.
A x Vector
Performs the multiplication of an input matrix and an input vector.
k–1
yi = ∑a x ij j , for i = 0, 1, 2, …, n–1,
j=0
where n is the number of rows in A, and k is the number of columns in A and the number of
elements in X.
Cholesky Factorization
Performs Cholesky factorization for a real, positive definite matrix A.
T
If the real, square matrix A is positive definite, you can factor it as A = R R , where R is an
T
upper triangular matrix, and R is the transpose of R .
Complex A x B
Performs the matrix multiplication of two input complex matrices.
If A is an n-by-k matrix and B is a k-by-m matrix, the matrix multiplication of A and B, C = AB,
results in a matrix, C, whose dimensions are n-by-m. Let A represent the 2D input array
A matrix, B represent the 2D input array B matrix, and C represent the 2D output array A x B.
The VI obtains the elements of C using the formula
i = 0, 1, 2, ..., n – 1
k–1
c ij = ∑a il b lj for
j = 0, 1, 2, ..., m – 1
,
l=0
where n is the number of rows in A matrix, k is the number of columns in A matrix and the
number of rows in B matrix, and m is the number of columns in B matrix.
Complex A x Vector
Performs the multiplication of a complex input matrix and a complex input vector.
k–1
yi = ∑a ij x j , for i = 0, 1, 2, …, n–1,
j=0
where n is the number of rows in A, and k is the number of columns in A and the number of
elements in X.
H
If the complex square matrix A is positive definite, it can be factored as A = R R , where
H
R is an upper triangular matrix and R is the complex conjugate transpose of R.
Complex Determinant
Finds the determinant of a complex, square matrix Input Matrix.
Let A denote a square matrix that represents the Input Matrix, and let L and U be the lower
and upper triangular matrices, respectively, of A such that
A = LU,
where the main diagonal elements of the lower triangular matrix L are arbitrarily set to one.
The VI finds the determinant of A by the product of the main diagonal elements of the upper
triangular matrix U:
n–1
A = ∏u ii ,
i=0
Let X represent the input sequence X Vector and Y represent the input sequence Y Vector.
The VI obtains the dot product X*Y using the formula:
n–1
X∗ Y = ∑x y i i ,
i=0
where n is the number of data points. Notice that the output value X*Y is a complex
scalar value.
The eigenvalue problem is to determine the nontrivial solutions for the equation:
AX = λX
where A represents an n-by-n Input Matrix, X represents a vector with n elements, and
λ is a scalar. The n values of λ that satisfy the equation are the Eigenvalues of A and the
corresponding values of X are the right Eigenvectors of A. A Hermitian matrix always has
real eigenvalues.
Let A be Input Matrix and I be the identity matrix. You obtain Inverse Matrix by solving the
system AB = I for B.
If A is a nonsingular matrix, you can show that the solution to the preceding system is unique
and that it corresponds to the inverse matrix of A
B = A–1,
and B is therefore the Inverse Matrix. A nonsingular matrix is a matrix in which no row or
column contains a linear combination of any other row or column, respectively.
Note You cannot always determine beforehand whether the matrix is singular,
especially with large systems. The Complex Inverse Matrix VI detects singular
matrices and returns an error, so you do not need to verify whether you have a
valid system before using this VI.
computations use the maximum possible accuracy, the VI cannot always solve for
the system.
Complex LU Factorization
Performs the LU factorization of a complex, square matrix A.
LU factorization factors the square matrix A into two triangular matrices; one is a lower
triangular matrix L with ones on the diagonal, and the other is an upper triangular matrix U,
so that
PA = LU
where P is a permutation matrix, which consists of the identity matrix with some rows
exchanged.
Factorization is the key step for inverting a matrix, computing the determinant of a matrix,
and solving a linear equation.
The condition number of a matrix measures the sensitivity of the solution of a system of
linear equations to errors in the data. It gives an indication of the accuracy of the results from
the matrix inversion and linear equation solutions.
The norm of a matrix is a scalar that gives some measure of the magnitude of the elements of
the matrix. Let A represent the Input Matrix, A p represent the norm of A, where p can be
1,2,f, ∞ . Different values of p mean different types of norms that are computed.
rank is the number of singular values of the Input Matrix that are larger than the tolerance.
rank is the maximum number of independent rows or columns of the Input Matrix.
Let A be a square matrix that represents Input Matrix and tr(A) be trace. The trace of A is
the sum of the main diagonal elements of A
n–1
tr ( A ) = ∑a ii ,
i=0
Let X represent the input sequence X Vector and Y represent the input sequence Y Vector.
The VI obtains Outer Product using the formula:
i = 0, 1, 2, ..., n – 1
aij = xi yj, for ,
j = 0, 1, 2, ..., m – 1
where A represents the 2D output sequence Outer Product, n is the number of elements in
the input sequence X Vector, and m is the number of elements in the input sequence Y Vector.
An SVD algorithm computes PseudoInverse Matrix A+, and treats any singular values less
than the tolerance as zeros.
If Input matrix A is square and not singular, A+ is the same as A–1, but using the Complex
Inverse Matrix VI to compute A–1 is more efficient than using this VI.
Complex QR Factorization
Performs QR factorization for a complex matrix A.
You can use QR factorization to solve linear systems that contain less or more equations than
unknowns.
SVD produces three matrices U, S, and V, so that A = US0VH, where U and V are orthogonal
matrices, S0 is an n-by-n diagonal matrix with the elements of array S on the diagonal in
decreasing order. The diagonal elements are the singular values of A.
Determinant
Computes the determinant of a real, square matrix Input Matrix.
Let A be a square matrix that represents Input Matrix, and let L and U represent the lower
and upper triangular matrices, respectively, of A such that
A = LU,
where the main diagonal elements of the lower triangular matrix L are arbitrarily set to one.
The VI finds the determinant of A by the product of the main diagonal elements of the upper
triangular matrix U
n–1
A = ∏u ii ,
i=0
Dot Product
Computes the dot product of X Vector and Y Vector.
Let X represent the input sequence X Vector and Y represent the input sequence Y Vector.
The VI obtains the dot product X*Y using the formula:
n–1
X∗ Y = ∑x y i i ,
i=0
where n is the number of data points. Notice that the output value X*Y is a scalar value.
AX = λX
where A is a n-by-n Input Matrix, X is a vector with n elements, and λ is a scalar. The
n values of λ that satisfy the equation are the Eigenvalues of A and the corresponding values
of X are the right Eigenvectors of A. A symmetric, real matrix always has real eigenvalues
and eigenvectors.
Inverse Matrix
Finds the Inverse Matrix of the Input Matrix.
Let A be the Input Matrix and I be the identity matrix. You obtain the Inverse Matrix value
by solving the system AB = I for B.
If A is a nonsingular matrix, you can show that the solution to the preceding system is unique
and that it corresponds to the Inverse Matrix of A:
B = A–1,
Note The numerical implementation of the matrix inversion is not only numerically
intensive but, because of its recursive nature, is also highly sensitive to round-off
errors introduced by the floating-point numeric coprocessor. Although the
computations use the maximum possible accuracy, the VI cannot always solve for
the system.
LU Factorization
Performs the LU factorization of a real, square matrix A.
LU factorization factors the square matrix A into two triangular matrices. One is a lower
triangular matrix L with ones on the diagonal. The other is an upper triangular matrix U,
so that
PA = LU,
where P is a permutation matrix, which serves as the identity matrix with some rows
exchanged.
Factorization serves as a key step for inverting a matrix, computing the determinant of a
matrix, and solving a linear equation.
The condition number of a matrix measures the sensitivity of a system solution of linear
equations to errors in the data. It gives an indication of the accuracy of the results from a
matrix inversion and a linear equation solution.
Matrix Norm
Computes the norm of a real matrix Input Matrix.
The norm of a matrix is a scalar that gives some measure of the magnitude of the elements in
the matrix. Let A represent the Input Matrix, the norm of A is represented by A p , where
p can be 1,2,F, ∞ . Different values of p mean different types of norms that are computed.
Matrix Rank
Computes the rank of a rectangular, real matrix Input Matrix.
Matrix rank is the number of singular values in the Input Matrix that are larger than
the tolerance. rank is the maximum number of independent rows or columns in the
Input Matrix.
Outer Product
Computes the outer product of X Vector and Y Vector.
Let X represent the input sequence X Vector and Y represent the input sequence Y Vector.
The VI obtains Outer Product using the formula
i = 0, 1, 2, ..., n – 1
aij = xi yj, for ,
j = 0, 1, 2, ..., m – 1
where A represents the 2D output sequence Outer Product, n is the number of elements in
the input sequence X Vector, and m is the number of elements in the input sequence Y Vector.
PseudoInverse Matrix
Finds the PseudoInverse Matrix of a rectangular, real matrix Input Matrix.
You compute PseudoInverse Matrix A+ by using the SVD algorithm and any singular value
less than the tolerance, which are set to zero.
If Input matrix A is square and not singular, A+ is the same as A–1, but using the Inverse Matrix
VI to compute A–1 is more efficient than using this VI.
QR Factorization
Performs the QR factorization of a real matrix A.
You can use QR factorization to solve linear systems with more equations than unknowns.
Let A represent the m-by-n Input Matrix, Y represent the set of m elements in the Known
Vector, and X represent the set of n elements in the Solution Vector that solves for the system
AX = Y.
When m > n, the system has more equations than unknowns, so it is an overdetermined
system. Since the solution that satisfies AX = Y may not exist, the VI finds the least square
solution X, which minimizes ||AX–Y||.
When m < n, the system has more unknowns than equations, so it is an underdetermined
system. It might have infinite solutions that satisfy AX = Y. The VI then selects one of these
solutions.
AX = LZ = Y,
and
Z = UX
can be an alternate representation of the original system. Notice that Z is also an n element
vector.
Triangular systems are easy to solve using recursive techniques. Consequently, when you
obtain the L and U matrices from A, you can find Z from the LZ = Y system and X from the
UX = Z system.
You can easily solve this triangular system to get X using recursive techniques.
Note You cannot always determine beforehand whether the matrix is singular,
especially with large systems. The Inverse Matrix VI detects singular matrices and
returns an error, so you do not need to verify whether you have a valid system
before using this VI.
Let A be an m-by-n matrix that represents the Input Matrix, Y be the set of m coefficients in
Known Vector, and X be the set of n elements in Solution Vector that solves the system
AX = Y.
When m>n, the system has more equations than unknowns, so it is an overdetermined system.
The solution that satisfies AX = Y may not exist, so the VI finds the least square solution X,
which minimizes AX – Y .
When m<n, the system has more unknowns than equations, so it is an underdetermined
systems. It may have infinite solutions that satisfy AX = Y. The VI finds one of these
solutions.
AX = LZ = Y,
and
Z = UX
can be an alternate representation of the original system. Notice that Z is also an n element
vector.
Triangular systems are easy to solve using recursive techniques. Consequently, when you
obtain the L and U matrices from A, you can find Z from the LZ = Y system and X from the
UX = Z system.
You can easily solve this triangular system to get x using recursive techniques.
Note You cannot always determine beforehand whether the matrix is singular,
especially with large systems. The Inverse Matrix VI detects singular matrices and
returns an error, so you do not need to verify whether you have a valid system
before using this VI.
The numerical implementation of the matrix inversion is numerically intensive and, because
of its recursive nature, is also highly sensitive to round-off error introduced by the
floating-point numeric coprocessor. Although the computations use the maximum possible
accuracy, the VI cannot always solve the system.
SVD Factorization
Performs the singular value decomposition (SVD) of a given m-by-n real matrix A,
with m > n.
SVD produces three matrices U, S0, and V so that A = US0VT, where U and VT are orthogonal
matrices, S0 is an n-by-n diagonal matrix with the elements of array S on the diagonal in
decreasing order.
Trace
Finds the trace of Input Matrix.
Let A be a square matrix that represents Input Matrix and tr(A) be trace. The trace of A is
the sum of the main diagonal elements of A
n–1
tr ( A ) = ∑a ii ,
i=0
The following illustration shows the Array Operations palette, which you
access by selecting Functions»Analysis»Array Operations.
1D Linear Evaluation
Performs a linear evaluation of the input array X.
Y = aX + b ,
where a is the multiplicative scale constant, and b is the additive constant offset.
1D Polar To Rectangular
Converts two arrays of polar coordinates into two arrays of rectangular coordinates, according
to the following formulas:
x = Magnitude cos(Phase)
y = Magnitude sin(Phase).
1D Polynomial Evaluation
Performs a polynomial evaluation of X using Coefficients: a.
∑a X
n
Y = n ,
n=0
1D Rectangular To Polar
Converts two arrays of rectangular coordinates into two arrays of polar coordinates, according
to the following formulas:
magnitude = x2 + y2
phase = tan–1 -- .
y
x
2D Linear Evaluation
Performs a linear evaluation of the two-dimensional input array X.
Y = Xa + b ,
where a denotes the multiplicative constant, and b denotes the additive constant.
2D Polynomial Evaluation
Performs a polynomial evaluation of the two-dimensional input array X using Coefficients a.
∑a X
n
Y = n ,
n=0
Normalize Matrix
Normalizes the 2D input Matrix using its statistical profile (µ, σ), where µ is the mean and
σ is the standard deviation, to obtain a Normalized Matrix whose statistical profile is (0,1).
A–µ
B = ------------- ,
σ
n–1 m–1
∑ ∑a ij
µ = --------------------------
i=0 j=0
n•m ,
n–1 m–1
∑ ∑ ( a ij – µ ) 2
σ = i=0 j=0
-,
-----------------------------------------------
n•m
where B represents the 2D output sequence Normalized Matrix, A represents the 2D input
sequence Matrix with n rows and m columns, and aij is the element of A on the ith row and
jth column.
Normalize Vector
Normalizes the input Vector using its statistical profile (µ,σ), where µ is the mean and σ is
the standard deviation, to obtain a Normalized Vector whose statistical profile is (0,1).
X–µ
Y = ------------- ,
σ
n–1
∑x i
µ = ------------- ,
i=0
n
n–1
∑ ( xi – µ ) 2
σ = --------------------------------- ,
i=0
n
where Y represents the output sequence Normalized Vector, and X represents the input
sequence Vector of length n, and xi is the ith element of X.
Quick Scale 1D
Determines the maximum absolute value of the input array X and then scales X using
this value.
X
Y = --- ,
s
You can use this VI to normalize sequences within the range [–1,1]. This VI is particularly
useful if the sequence is a zero mean sequence.
Quick Scale 2D
Determines the maximum absolute value of the input array X and then scales X using
this value.
X
Y = --- ,
s
You can use this VI to normalize sequences within the range [–1,1]. This VI is particularly
useful if the matrix is a zero mean matrix.
Scale 1D
Determines scale and offset and then scales the input array X using these values.
X – offset
Y = ------------------------ ,
scale
scale = 0.5(max – min), and offset = min + scale, where max denotes the maximum value in
X, and min denotes the minimum value in X.
You can use this VI to normalize any numerical sequence with the assurance that the range of
the output sequence is [–1,1].
Scale 2D
Determines scale and offset and then scales X using these values.
X – offset
Y = ----------------------- ,
scale
scale = 0.5(max – min), and offset = min + 0.5 scale, where max denotes the maximum value
in X, and min denotes the minimum value in X.
You can use this VI to normalize any numerical sequence with the assurance that the range of
the output sequence is [–1,1].
Unit Vector
Finds the norm of the Input Vector and obtains its corresponding Unit Vector by
normalizing the original Input Vector with its norm.
2 2 2
X = x 0 + x 1 + ... + x n – 1 ,
X
U = -------- .
X
This VI uses a modified, complex Newton method to determine the n complex roots (some of
which may be real, with a zero imaginary part), of the general complex polynomial:
Numeric Integration
Performs a numeric integration on the input array of data using one of four, popular numeric
integration methods.
Note If the number of points provided for a certain chosen method does not contain
an integral number of partial sums, then the method is applied for all possible
points. For the remaining points, the next possible lower order method is used.
For example, if the Bode method is selected, the following table shows what this
VI evaluates for different numbers of points:
So, if 227 points were provided and the Bode Method was chosen, the VI would arrive at the
result by performing 56 Bode Method partial evaluations and one Simpsons’ 3/8 Method
evaluation.
Each of the methods depend on the sampling interval (dt) and compute the integral using
successive applications of a basic formula in order to perform partial evaluations, which
depend on some number of adjacent points. The number of points used in each partial
evaluation represents the order of the method. The result is the summation of these successive
partial evaluations.
t1
result =
∫ ftdt ≈ ∑ partial sums ,
j
t0
where j is a range dependent on the number of points and the method of integration.
The basic formulas for the computation of the partial sum of each rule in ascending method
order are:
where N is the number of data points, k is an integer dependent on the method, and x is the
input array.
Peak Detector
Finds the location, amplitude, and second derivative of peaks or valleys in the input array.
The data set can be passed to the VI as a single array or as consecutive blocks of data.
This VI is based on an algorithm that fits a quadratic polynomial to sequential groups of data
points. The number of data points used in the fit is specified by width.
For each peak or valley, the quadratic fit is tested against the threshold level: peaks with
heights lower than threshold or valleys with troughs higher than threshold are ignored.
peaks/valleys are detected only after approximately width/2 data points have been processed
beyond peaks/valleys locations. This delay has implications only for real time processing.
The VI must be notified when the first and last blocks are passed into the VI, so that the VI
can initialize and then release data internal to the peak detection algorithm.
The following illustration shows the TCP palette, which you access by
selecting Functions»Communication»TCP.
For examples of how to use the TCP VIs, see the examples in
examples\comm\tcpex.llb.
TCP VI Description
The following TCP VI is available.
TCP Listen
Creates a listener and waits for an accepted TCP connection at the specified port.
When a listen on a given port begins, you cannot use another TCP Listen VI to listen on the
same port. For example, suppose a VI has two TCP Listen VIs on its block diagram. If you
start a listen on port 2222 with the first TCP Listen VI, any attempts to listen on port 2222
with the second TCP Listen VI fail.
TCP/IP Functions
In addition to existing functions, some TCP/IP VIs are now functions. The following VIs are
now functions in LabVIEW 5.0:
• IP To String
• String To IP
• TCP Open Connection
• TCP Create Listener
• TCP Wait on Listener
• TCP Write
• TCP Read
• TCP Close Connection
The TCP Listen VI is still a VI in LabVIEW 5.0 because its functionality is duplicated by the
TCP Create Listener and the TCP Wait on Listener functions.
The TCP Read, TCP Write, and TCP Wait On Listener functions incorporate new
functionality. TCP Write’s data in parameter now accepts arrays of bytes. TCP Read has
a new input, mode, which affects how it operates. The four modes are Standard, Buffered,
CRLF, and Immediate. TCP Wait On Listener has a new input, resolve remote address, that
tells whether to resolve the remote address or leave it in dot notation.
Standard has the same behavior it had in earlier versions of LabVIEW. Buffered is an
all-or-nothing read. If you have not received the bytes requested at the end of a timeout,
no bytes are returned. The unreturned bytes are saved for later read attempts. CRLF is read
until a carriage return and linefeed is found in the input stream. You still must specify a
maximum read size. If the CRLF is not found within the size expressed, nothing is returned.
If the timeout limit is reached and a CRLF is not found, nothing is returned. Immediate
specifies to return immediately from a read when any bytes are received.
IP To String
Converts an IP network address to a string.
String To IP
Converts a string to an IP network address.
TCP Read
Receives up to bytes to read bytes from the specified TCP connection, returning the results
in data out.
TCP Write
Writes the string data in to the specified TCP connection.
The following illustration shows the UDP palette, which you access by
selecting Functions»Communication»UDP.
UDP VI Descriptions
The following UDP VIs are available.
UDP Close
Closes the UDP connection specified by connection ID.
UDP Open
Attempts to open a UDP connection on the given port. connection ID is an opaque token
used in all subsequent operations relating to the connection.
UDP Read
Returns a datagram in the string data out that has been received on the UDP connection
specified by connection ID.
UDP Write
Writes the string data in to the remote UDP connection specified by address and port.
The following illustration shows the DDE palette, which you access by
selecting Functions»Communication»DDE.
For examples of how to use the DDE VIs, see the examples in
examples\comm\DDEexamp.llb.
DDE Execute
Tells the DDE server to execute command.
DDE Poke
Tells the DDE server to put the value data at item.
DDE Request
Initiates a DDE message exchange to obtain the current value of item.
Note DDE clients can no longer access the item after this VI completes.
Invoke Node
Invokes a method or action on an ActiveX object. To select an ActiveX class object, pop up
and choose Select»ActiveX Class or wire an automation refnum to the input. To select a
method related to that object, pop up on the second section of the node (“method” in the
diagram) and select Methods. Once you select the method, the associated parameters appear
below it. You can read or write to parameter values. Parameters with a white background are
required inputs and the parameters with a gray background are optional inputs.
If the input parameters are of variant type, then you can wire in G data types and they will
automatically be converted to variant data types and indicated by a coercion dot. If an output
is of a variant type, use the ActiveX Variant to G function to convert to G type, if needed.
Property Node
Sets (writes) or gets (reads) ActiveX object property information. To select an ActiveX
class object, pop up and choose Select»ActiveX Class or wire an automation refnum to the
input. To select a property related to that object, pop up on the second line of the node and
select Properties. To set property information, pop up and select Change to Write, and
to get property information pop up and select Change to Read. Some properties are read or
write only, so Change to Write or Change to Read respectively appears dimmed in the
pop-up menu.
The Property Node works the same way as Attribute Nodes. If you want to add items to the
node, pop up and select Add Element or click and drag the node to expand the number of
items in the node. The properties are changed in the order from top to bottom. Remember if
the small direction arrow on a property is on the left, you are setting the property value. If the
small direction arrow on the property is on the right, you are getting the property value.
If the property to be written is of ActiveX Variant type, then you can wire in G data types and
they will automatically be converted to variant data types and indicated by a coercion dot.
If the property is of ActiveX Variant type, use the ActiveX Variant to G function to convert to
G type, if needed.
Note For applications to communicate with IAC, the computer must use System 7.0 or
later with Program Linking enabled.
For examples of how to use the AppleEvent VIs, see the examples located
in examples:comm:AE Examples.llb.
Target ID
Most VIs that send AppleEvents need a description of the target application
that receives the AppleEvent. The target ID is a complex cluster of
information, defined by Apple Computer Inc., describing the target
application and its location. The following VIs generate the target ID,
so you do not need to create this cluster on the diagram.
• PPC Browser creates the target ID by displaying a dialog box by
which you interactively select AppleEvent-aware applications on the
network.
• Get Target ID creates the target ID programmatically based on the
application name and network location.
You need to look at the target ID cluster only if you want to pass target
information from one VI to another. To create a target ID cluster for the
front panel of a VI that passes target information to another VI or to an
AppleEvent, you can copy the target ID cluster from the front panel of one
of the AppleEvent VIs.
Send Options
Many of the VIs that send an AppleEvent have a send options input, which
specifies whether the target application can interact with the user and the
length of the AppleEvent timeout.
Targeting VI Descriptions
The following Targeting VIs are available.
Get Target ID
Returns a target ID for a specified application based on its name and location. You can either
specify the application name and location or the VI searches the entire network for the
application.
The following table summarizes the operation of Search entire network, Zone, and Server:
To search the
following locations: Use the following parameters:
The current computer Zone and Server must be unwired. Search entire network must
be FALSE.
A specific computer on Zone and Server must specify the target computer’s zone and
the network server. (If you do not wire Zone, the VI searches the current
zone.) Search entire network must be FALSE.
A specific zone Zone must specify the zone to be searched. Server must be
unwired. Search entire network must be FALSE.
The entire network Search entire network must be TRUE. The VI ignores Zone
and Server.
PPC Browser
Invokes the PPC Browser dialog box for selecting an application on a network or on the same
computer.
You can use this standard Macintosh dialog box to select a zone from the network, an object
in that zone (in System 7, this is typically the name of a person’s computer), and an
application. The VI then returns the target ID cluster.
AppleEvent VI Descriptions
The following AppleEvent VIs are available.
AESend Do Script
Sends the Do Script AppleEvent to a specified target application.
Note Apple may change the set of AppleEvents to which the Finder responds so that
they more closely conform to the standard set of AppleEvents. As a result, the
AppleEvent that AESend Finder Open sends to the Finder may not be supported
in future versions of the system software.
AESend Open
Sends the Open AppleEvent to a specified target application.
You should use these VIs only when communicating with LabVIEW applications. You can
send these messages either to the current LabVIEW application or to a LabVIEW application
on a network. See Table A-5, AppleEvent Error Codes, of Appendix A, Error Codes, for error
information.
AESend Abort VI
Sends the Abort VI AppleEvent to the specified target LabVIEW application.
AESend Close VI
Sends the Close VI AppleEvent to the specified target LabVIEW application.
For this VI, you must specify the complete pathname of the VI you want to run. See
Chapter 12, Path and Refnum Controls and Indicators, of your G Programming Reference
Manual for a description of path controls and indicators available in the Controls palette.
AESend Run VI
Sends the Run VI AppleEvent to the target LabVIEW application.
AESend VI Active?
Sends the VI Active? AppleEvent to the specified target LabVIEW application. VI running?
is a Boolean indicating whether the VI is currently executing.
Advanced Topics
This section describes some of the advanced programming you can do with
AppleEvent VIs.
You also can specify an array of parameters if the target application needs
additional information to execute the specified AppleEvent. Because the
data structure for AppleEvent parameters is inconvenient for use in
LabVIEW diagrams, the AESend VI accepts these parameters as ASCII
strings. These strings must conform to the grammar described in the next
section. You can use this grammar to describe any AppleEvent parameter.
The AESend VI interprets this string to create the appropriate data structure
for an AppleEvent, and then sends the event to the specified target.
Following the keyword, you must specify the parameter data as a string.
You can use AppleEvents with many different data types, including strings
and numbers. When you specify the data string, the AESend VI converts it
to a desired data type based upon the way the data is formatted and optional
directives that can be embedded in the string. Each piece of data has a
four-letter type code associated with it, indicating its data type. The
target application uses this code to interpret the data. For example, if
comma-separated items are enclosed in brackets, a list of AE Descriptors is
created, and the list has a data type of list; each of the comma-separated
items could in turn be other items, including lists.
You can use a number of VIs in the AppleEvents VI palette to create some
of the more common parameter strings, including aliases, which are used
when referencing files in parameters, and descriptor lists, which are used to
specify a list of items as a parameter. You can concatenate or cascade these
strings together to create a more complex parameter.
VI that can
Parameter is construct
To send data as: Format the string as: of code type: Examples: string:
an integer A series of decimal digits, long or short 1234 n/a
optionally preceded by a –5678
minus sign.
enumerated data A four-letter code. enum whos n/a
If it is too long, it is '@all'
truncated; if it is too long
short, it is padded with >=
'86it'
spaces. If you put single
quotes (') around it,
it can contain any
characters; otherwise,
it cannot contain:
@ ' : - , ( [ { } ] ) and
cannot begin with a digit.
a string Enclose the desired TEXT “put x n/a
sequence of characters into
within open and close card
curly quotes (“ entered field 5”
“Hi
with <option-[>and ”
There”
entered with
<option-shift-[>). Notice
that the string is not
null-terminated.
an AE record Enclose a reco {x:100, AECreate
comma-separated list of y:–100} Record
elements in curly braces, {'origin
where each element ':
{x:100,
consists of a keyword
y:–100},
(a type code) followed by
extent:
a colon, followed by a {x:500,
value, which can be any y:500},
of the types listed in cont:[1,
this table. 5,25]}
VI that can
Parameter is construct
To send data as: Format the string as: of code type: Examples: string:
an AE descriptor list Enclose a list [123, AECreate
comma-separated list of –58, Descriptor
descriptors in square “test”] List
brackets.
hex data Enclose an even number ?? (must be «01 57 (Hex data is a
of hex digits between coerced – see 64 fe AB component of
French quotes (« entered next item) C1» the string
with <option-\> and » produced by
entered with Make Alias)
<option-shift-\>).
some other data type Embed data created in The specified sing(123 n/a
one of the types listed in type code 4) Make Alias
this table in parentheses alis(«he creates a hex
and put the desired type x dump dump of a file
of an
code before it. If the data description.
alias»)
is a numeric, LabVIEW
n/a
coerces the data to the type(lin n/a
specified type if possible e)
and returns the rang{sta
errAECoercionFail r: 5,
error code if it cannot. If stop: 6}
the data is of a different
type, LabVIEW replaces
the old type code with the
specified type code.
null data Coerce an empty string to null ( ) n/a
no type.
To access the Low Level Apple Events palette, pop up on the Low Level Apple Events icon.
AESend
Sends an AppleEvent specified in parameters to the specified target application.
Make Alias
Creates a unique description of a file from its pathname and location on the network. You can
use this description with the AESend VI when sending an AppleEvent that refers to a file.
An alias is a data structure used by the Macintosh toolbox to describe file system objects
(files, directories and volumes). Do not confuse this with a Finder alias file. A minimal alias
contains a full path name to the file and possibly the zone and server that the file resides on.
A full alias contains more information, such as creation date, file type, and creator. (The
complete description of the structure of an alias is confidential to Apple Computer.) Aliases
are the most common way to specify a file system object as a parameter to an AppleEvent.
For example, you can use the output comparison descriptor string as an argument to the
AESend VI, or as an argument to AECreate Object Specifier to build a more complex
descriptor string. See the Object Support VI Example section of this chapter for an example
of its use.
AppleEvent logical records describe logical, or Boolean expressions of multiple terms, such
as the AND of two AppleEvent comparison records. For example, you can use the output
logical descriptor string as an argument to the AESend VI, or as an argument to AECreate
Object Specifier VI to build a more complex descriptor string. See the Object Support VI
Example section in this chapter for an example of its use.
An object specifier is an AppleEvent record of type obj and describes a specific object. It has
four elements: the class of the object, the containing object, a code indicating the form of the
description, and the description of the object.
Range descriptor records are used in object specifiers whose key form is formRange (rang).
They describe a range of objects with two object specifiers: the start and the end of the range.
AECreate Record
Creates a string describing an AppleEvent descriptor record, which can then be used with the
AESend VI. You can use a record descriptor to bundle descriptors of different types. Each
descriptor has its own keyword, or name, and value.
The following string that the previous diagram creates is quite complicated; tabs are added to
make the string easier to read. For further information about the Object Support Library,
consult the AppleEvent Registry.
obj
want: type('line'),
from: obj {
want: type('line'),
from: Doc Name,
form: test,
seld: logi {
term:[
cmpd{
relo:=,
obj1:"April",
obj2:obj {
want: type('word'),
from: exmn( ),
form: indx,
seld: 1
}
},
cmpd{
relo:=,
obj1:"is",
obj2:obj {
want: type('word'),
from: exmn( ),
form: indx,
seld: 2
}
}
],
logc: AND
}
},
form: indx,
seld: 1
Required AppleEvents
LabVIEW responds to the required AppleEvents, which are Open
Application, Open Documents, Print Documents, and Quit Application.
These events are described in Inside Macintosh, Volume VI.
Replies to AppleEvents
If LabVIEW is unable to perform an AppleEvent, the reply contains an
error code. If the error is not a standard AppleEvent error, the reply
also contains a string describing the error. Appendix A, Error Codes,
summarizes the LabVIEW-specific errors that can be returned in a reply to
an AppleEvent.
Event: Run VI
Description
Tells LabVIEW to run the specified VI(s). Before executing this event, the
LabVIEW application must be running, and the VI must be open (you can
open the VI using the Open Documents AppleEvent).
Event Class
LBVW (Custom events use the Applications creator type for the
event class)
Event ID
GoVI ----
Event Parameters
Description Keyword Default Type
VI or List of VIs keyDirectObject (----) typeChar (char)
(required) or list of
typeChar (list)
Reply Parameters
Description Keyword Default Type
none
Possible Errors
Error Value Description
kLVE_InvalidState 1000 The VI is in a state that does not
allow it to run.
kLVE_FPNotOpen 1001 The VI front panel is not open.
kLVE_CtrlErr 1002 The VI has controls on its front
panel that are in an error state.
kLVE_VIBad 1003 The VI is broken.
kLVE_NotInMem 1004 The VI is not in memory.
Event: Abort VI
Description
Tells LabVIEW to abort the specified VI(s). Before executing this event,
the LabVIEW application must be running, and the VI must be open (you
can open the VI using the Open Documents AppleEvent). This message can
only be sent to VIs that are executed from the top level (subVIs are aborted
only if the calling VI is aborted).
Event Class
LBVW (Custom events use the Applications creator type for the
event class)
Event ID
RsVI
Event Parameters
Description Keyword Default Type
VI or List of VIs keyDirectObject (----) typeChar (char)
(required)or list of
typeChar (list)
Reply Parameters
Required?
Description Keyword Default Type
none
Possible Errors
Error Value Description
kLVE_InvalidState 1000 The VI is in a state that does not
allow it to run.
kLVE_FPNotOpen 1001 The VI front panel is not open.
kLVE_NotInMem 1004 The VI is not in memory.
Event: VI Active?
Description
Requests information on whether a specific VI is currently running.
Before executing this event, the LabVIEW application must be running,
and the VI must be open (you can open the VI using the Open Documents
AppleEvent). The reply indicates whether the VI is currently running.
Event Class
LBVW (Custom events use the Applications creator type for the
event class.)
Event ID
VIAc
Event Parameters
Description Keyword Default Type
VI Name keyDirectObject (----) typeChar (char)
(required)
Reply Parameters
Description Keyword Default Type
Active? (required) keyDirectObject (----) typeBoolean
(bool)
Possible Errors
Error Value Description
kAEvtErrFPNotOpen 1001 The VI front panel is not open.
kLVE_NotInMem 1004 The VI is not in memory.
Event: Close VI
Description
Tells LabVIEW to close the specified VI(s). Before executing this event,
the LabVIEW application must be running, and the VI must be open
(you can open the VI using the Open Documents AppleEvent).
Event Class
LBVW (Custom events use the Applications creator type for the
event class)
Event ID
ClVI
Event Parameters
Description Keyword Default Type
VI or List of VIs keyDirectObject typeChar (char)
(----) (required) or list of
typeChar (list)
Save Options keyAESaveOptions typeEnum (enum)
(not required) (savo) possible values: yes
and no
Reply Parameters
Description Keyword Default Type
none
Possible Errors
Error Value Description
kAEvtErrFPNotOpen 1001 The VI front panel is not open.
kLVE_NotInMem 1004 The VI is not in memory.
cancelError 43 The user cancelled the close
operation.
The following illustration shows the PPC VI palette, which you access by
selecting Functions»Communication»PPC.
For examples of how to use the PPC VIs, see the examples located in
examples:comm:PPC Examples.llb.
PPC VI Descriptions
The following PPC VIs are available.
You should accept or reject the request using the PPC Accept Session VI immediately,
because the other computer waits (hangs) until the VI accepts or rejects its attempt to initiate
a session or an error occurs.
PPC Browser
For information on the PPC Browser VI, see Chapter 52, AppleEvent VIs, of this manual.
Closing a port terminates all outstanding calls associated with the port with a portClosedErr
(error -916).
You can use the Close All PPC Ports to handle abnormal conditions that leave ports open. An
example of an abnormal condition is when a VI is aborted before it can terminate normally
and close the PPC port. You can use the Close All PPC Ports VI during VI development, when
such mistakes are more likely to be made, or as a precaution at the beginning of any program
that opens ports.
Closing a port terminates all outstanding calls associated with the port with a portClosedErr
(error -916).
Ending a session causes all outstanding calls associated with the session (PPC Read and
PPC Write calls) to finish with a sessClosedErr (error -917).
Get Target ID
For information on the Get Target ID VI, see Chapter 52, AppleEvent VIs, of this manual.
When opening a port using PPC Open Port, you must specify a portName cluster.
Refer to the LabVIEW online help for more information on this VI.
PPC Read
Reads a block of information from a specified session. If a timeout occurs or the VI aborts
before completing execution, the port that port refnum represents closes.
PPC Read executes asynchronously by starting to read the specified data and then polling
until the read is finished.
PPC Write
Writes a block of information to the specified session. If a timeout occurs or the VI aborts
before completing execution, the port represented by port refnum is closed. PPC Write
executes asynchronously by starting to write the specified data and then polling until the write
is finished.
Connect error handler VIs to other VIs to return a description of an error, if one occurs. Error
handler VIs also can display a dialog box with an error message description and with buttons that
can stop or continue execution. See the Error Handling topic in the LabVIEW Online Reference
for more information about error handlers.
Note All error codes and descriptions are also included in the configuration utility help
panels in Windows and Macintosh platforms.
* These tables contain some error codes with overlapping numerical values but different meanings, depending on the source
of the error.
–1073807286 VI_ERROR_SRQ_NOCCURRED Service request has not been received for the session.
–1073807257 VI_ERROR_NSUP_OPER The given session or object reference does not support
this operation.
–20008 ArraySizeErr The input arrays do not contain the correct number of
data values for this VI.
–20009 PowerOfTwoErr The size of the input array must be a power of two:
size = 2m, 0 < m < 23.
–20012 CyclesErr The number of cycles must be greater than zero and less
than or equal to the number of samples.
–20031 EqRplDesignErr The filter cannot be designed with the specified input
values.
–20032 RankErr The rank of the filter must meet the condition:
1 ≤ (2×rank + 1) ≤ size.
–20033 EvenSizeErr The number of coefficients must be odd for this filter.
–20034 OddSizeErr The number of coefficients must be even for this filter.
–20035 StdDevErr The standard deviation must be greater than zero for
normalization.
–20037 SizeGTOrderErr The number of data points in the Y Values array must
be greater than two.
–20039 MatrixMulErr The number of columns in the first matrix is not equal
to the number of rows in the second matrix or vector.
–20043 FactorErr The level of factors is out of range for some data.
–20045 DataErr The total number of data points must be equal to the
product of the levels for each factor and the observations
per cell.
–20047 BalanceErr The data is unbalanced. All cells must contain the same
number of observations.
–20048 ModelErr The Random Effect model was requested when the
Fixed Effect model was required.
–20051 ColumnErr All values in the first column in the X matrix must be 1.
–10002 semanticsError An error was detected in the input string; the syntax
of the string is correct, but certain values specified
in the string are inconsistent with other values specified
in the string.
–10007 badChanError A channel is out of range for the board type or input
configuration, the combination of channels is not
allowed, or you must reverse the scan order so that
channel 0 is last.
–10010 badCountError The count is too small or too large for the specified
counter; or the given I/O transfer count is not
appropriate for the current buffer or channel
configuration.
–10011 badIntervalError The analog input scan rate is too fast for the number of
channels and the channel clock rate; or the given clock
rate is not supported by the associated counter channel
or I/O channel.
–10014 groupTooLargeError The group size is too large for the board.
–10021 badLimitsError The limits are beyond the range of the board.
–10024 badWriteOffsetError Adding the write offset to the write mark places the
write mark outside the internal buffer.
–10025 limitsOutOfRangeError The requested input limits exceed the board’s capability
or configuration. Alternate limits were selected.
–10026 badBufferSpecificationError The requested number of buffers or the buffer size is not
allowed; for example, Lab-PC buffer limit is 64K
samples, or the board does not support multiple buffers.
–10028 badFilterCutoffError The cutoff frequency specified is not valid for this
device.
–10030 badBaudRateError The specified baud rate for communicating with the
serial port is not valid on this platform.
–10032 badModuleSlotError The SCXI module slot that was specified is invalid or
corresponds to an empty slot.
–10089 badTotalCountError The total count is inconsistent with the buffer size and
pretrigger scan count or with the board type.
–10090 badRPGError The individual range, polarity, and gain settings are
valid but the combination specified is not allowed.
–10091 badIterationsError You have attempted to use an invalid setting for the
iterations parameter. The iterations value must be 0 or
greater. Your device might be limited to only two values,
0 and 1.
–10092 lowScanIntervalError Some devices require a time gap between the last
sample in a scan and the start of the next scan. The scan
interval you have specified does not provide a large
enough gap for the board. See the SCAN_Start
function in the language interface API for an
explanation.
–10240 noDriverError The driver interface could not locate or open the driver.
–10241 oldDriverError One of the driver files or the configuration utility is out
of date.
–10248 dupAddressError The base addresses for two or more devices are the
same; consequently, the driver is unable to access the
specified device.
–10250 dupIntError The interrupt levels for two or more devices are the
same.
–10252 dupDMAError The DMA channels for two or more devices are
the same.
–10253 jumperlessBoardError Unable to find one or more jumperless boards you have
configured using the NI-DAQ Configuration Utility.
–10256 comPortOpenError There was an error in opening the specified COM port.
–10261 userModeToKernelModeCallError The user mode code failed when calling the
kernel mode.
–10344 chassisSynchedError The Remote SCXI unit is not synchronized with the
host. Reset the chassis again to resynchronize it with
the host.
–10346 badPacketError The packet received by the Remote SCXI unit is invalid.
Check your serial port cable connections.
–10349 SCXIModuleTypeConflictError The module ID read from the SCXI module conflicts
with the configured module type.
–10370 badScanListError The scan list is invalid; for example, you are mixing
AMUX-64T channels and onboard channels, scanning
SCXI channels out of order, or have specified a different
starting channel for the same SCXI module. Also,
the driver attempts to achieve complicated gain
distributions over SCXI channels on the same module
by manipulating the scan list and returns this error if
it fails.
–10400 userOwnedRsrcError The specified resource is owned by the user and cannot
be accessed or modified by the driver.
–10414 reservedPinError The selected signal requires a pin that is reserved and
configured only by NI-DAQ. You cannot configure this
pin yourself.
–10415 externalMuxSupportError This function does not support this device when an
external multiplexer (such as an AMUX-64T or SCXI)
is connected to it.
–10443 memAlignmentError The transfer buffer is not aligned properly for the
current data-transfer mode. For example, the buffer is at
an odd address, is not aligned to a 32-bit boundary, is not
aligned to a 512-bit boundary, and so on. Alternatively,
the driver is unable to align the buffer because the buffer
is too small.
–10460 interfaceInteractionError You have mixed VIs from the DAQ library and the
_DAQ compatibility library (LabVIEW 2.2 VIs). You
can switch between the two libraries only by running
the DAQ VI Device Reset before calling _DAQ
compatibility VIs or by running the compatibility VI
Board Reset before calling DAQ VIs.
–10480 muxMemFullError The scan list is too large to fit into the mux-gain memory
of the board.
–10481 bufferNotInterleavedError You must provide a single buffer of interleaved data, and
the channels must be in ascending order. You cannot use
DMA to transfer data from two buffers; however, you
may be able to use interrupts.
–10600 noSetupError No setup operation has been performed for the specified
resources. Or, some resources require a specific
ordering of calls for proper setup.
–10602 noWriteError No output data has been written into the transfer buffer.
–10603 groupWriteError The output data associated with a group must be for a
single channel or for consecutive channels.
–10604 activeWriteError Once data generation has started, only the transfer
buffers originally written to can be updated. If DMA is
active and a single transfer buffer contains interleaved
channel-data, new data must be provided for all output
channels currently using the DMA channel.
–10605 endWriteError No data was written to the transfer buffer because the
final data block has already been loaded.
–10611 badDirOnSomeLinesError Some of the lines in the specified channel are not
configured for the transfer direction specified. For a
write transfer, some lines were configured for input. For
a read transfer, some lines were configured for output.
–10612 badLineDirError The specified line does not support the specified transfer
direction.
–10613 badChanDirError The specified channel does not support the specified
transfer direction.
–10614 badGroupDirError The specified group does not support the specified
transfer direction.
–10615 masterClkError The clock configuration for the clock master is invalid.
–10616 slaveClkError The clock configuration for the clock slave is invalid.
–10619 multClkSrcError A source signal has already been assigned to the clock
resource.
–10626 slaveTrigError The trigger configuration for the trigger slave is invalid.
–10630 invalidReadError The parameters specified to read data were invalid in the
context of the acquisition. For example, an attempt was
made to read 0 bytes from the transfer buffer, or an
attempt was made to read past the end of the transfer
buffer.
–10632 someInputsIgnoredError Certain inputs were ignored because they are not
relevant in the current operating mode.
–10680 badChanGainError All channels of this board must have the same gain.
–10681 badChanRangeError All channels of this board must have the same range.
–10682 badChanPolarityError All channels of this board must have the same polarity.
–10683 badChanCouplingError All channels of this board must have the same coupling.
–10684 badChanInputModeError All channels of this board must have the same input
mode.
–10688 noTrigEnabledError The total number of scans and pretrigger scans implies
that a trigger start is intended, but no trigger is enabled.
–10689 digitalTrigBError Digital trigger B is illegal for the total scans and
pretrigger scans specified.
–10690 digitalTrigAandBError This board does not allow digital triggers A and B to be
enabled at the same time.
–10691 extConvRestrictionError This board does not allow an external sample clock with
an external scan clock, start trigger, or stop trigger.
–10692 chanClockDisabledError Cannot start the acquisition because the channel clock
is disabled.
–10694 unsafeSamplingFreqError The sampling frequency exceeds the safe maximum rate
for the hardware, gains, and filters used.
–10695 DMANotAllowedError You have set up an operation that requires the use of
interrupts. DMA is not allowed. For example, some
DAQ events, such as messaging and LabVIEW
occurrences, require interrupts.
–10698 timebaseConflictError You cannot use this combination of scan and sample
clock timebases for the specified board.
–10699 polarityConflictError You cannot use this combination of scan and sample
clock source polarities for this operation and board.
–10700 signalConflictError You cannot use this combination of scan and convert
clock signal sources for this operation and board.
–10701 noLaterUpdateError The call had no effect because the specified channel had
not been set for later internal updates.
–10710 noHandshakeModeError The specified port has not been configured for
handshaking.
–10780 sc2040InputModeError When you have an SC-2040 attached to your device, all
analog input channels must be configured for
differential input mode.
–10800 timeOutError The operation could not complete within the time limit.
–10802 dataNotAvailError The requested amount of data has not yet been acquired.
–10804 earlyStopError The transfer stopped prior to reaching the end of the
transfer buffer.
–10805 overRunError The clock source for the input task is faster than the
maximum clock rate the device supports. If you are
allowing the driver to calculate the analog input channel
clock rate, the driver bases the clock rate on the board
type; so you should check that your board type is correct
in the configuration utility.
–10806 noTrigFoundError No trigger value was found in the input transfer buffer.
–10841 firmwareError The firmware does not support the specified operation,
or the firmware operation could not complete due to a
data-integrity problem.
–10843 underFlowError Because of system limitations, the driver could not write
data to the device fast enough to keep up with the device
throughput.
–10844 underWriteError New data was not written to the output transfer buffer
before the driver attempted to transfer the data to the
device.
–10845 overFlowError Because of system limitations, the driver could not read
data from the device fast enough to keep up with the
device throughput; the onboard device memory reported
an overflow error.
–10846 overWriteError The driver wrote new data into the input transfer buffer
before the previously acquired data was read.
–10847 dmaChainingError New buffer information was not available at the time
of the DMA chaining interrupt; DMA transfers will
terminate at the end of the currently active transfer
buffer.
–10848 noDMACountAvailError The driver could not obtain a valid reading from the
transfer-count register in the DMA controller.
–10855 osUnsupportedError NI-DAQ does not support the current operation on this
particular version of the operating system.
–10880 updateRateChangeError A change to the update rate is not possible at this time
because of one of the following reasons:
–10882 daqPollDataLossError The data collected on the remote SCXI unit was
overwritten before it could be transferred to the buffer in
the host. Try using a slower data acquisition rate if
possible.
–10920 gpctrDataLossError One or more data points may have been lost during
buffered GPCTR operations due to the speed
limitations of your system.
–10940 chassisResponseTimeoutError No response was received from the remote SCXI unit
within the specified time limit.
–10942 invalidResetSignatureError An invalid reset signature was sent from the host to the
remote SCXI unit.
–10943 chassisLockupError The interrupt service routine on the remote SCXI unit is
taking longer than necessary. You do not need to reset
your remote SCXI unit; however, you need to clear and
restart your data acquisition.
–1711 errAEWaitcanceled User canceled out of wait loop for reply or receipt.
–1718 errAEReplyNotArrived The contents of the reply you are accessing have not
arrived yet.
.
Table A-6. Instrument Driver Error Codes
–913 noMachineNameErr User has not named his Macintosh in the Network Setup
Control Panel.
–922 noDefaultUserErr User has not specified owner name in Sharing Setup
Control Panel.
11 ECAP No capability.
0 — No error.
2 — Argument error.
3 — Out of zone.
4 — End of file.
9 — Disk full.
10 — Duplicate path.
26 — Null window.
28 — Null menu.
29 — Print aborted.
42 — Generic error.
43 — Cancelled by user.
47 — Unknown heap.
52 — Unknown message.
54 — Bad address.
55 — Connection in progress.
59 — Network error.
60 — Address in use.
62 — Connection aborted.
63 — Connection refused.
64 — Not connected.
65 — Already connected.
66 — Connection closed.
68 — Bad occurrence.
72 — Unused.
74 — Memory corrupt.
85 — Scan failed.
2 errNoGlobals The CIN in the PPC VI could not get its globals.
1002 kLVE_CtrlErr The VI has controls on its front panel that are in an
error state.
00000 — No error.
AT-MIO-16F-5 16SE, 8DI 12 bits 0.5, 1, 2, ±5, ±10, 16F-5: 256; Up to 512
AT-MIO-64F-5** 64SE, 5, 10, 20, 0 to 10 64F-5: 512
32DI 50, 100
NB-MIO-16 16SE, 8DI MIO-16: 12; (L) 1, 10, ±10, ±5, 16; Up to 16;
NB-MIO-16X MIO-16X: 16 100, 500; 0 to 10, MIO-16, MIO-16:
(H) 1, 2, 0 to 5 Rev. G: 512 groups of 2,
4, 8 4, 8, and 16
1 You can determine the limit settings of your device by multiplying the range and the voltage values together. For more
information on limit settings in LabVIEW, refer to Chapter 3, Basic LabVIEW Data Acquisition Concepts, in the LabVIEW
Data Acquisition Basics Manual.
2 Scanning = channels, in any order.
* The valid channels for the AT-MIO-64E-3 in Differential Mode are 0–7, 16–23, 32–39, and 48–55.
** The valid channels for the AT-MIO-64F-5 in Differential Mode are 0–7 and 16–39.
.
Table B-3. Analog Input Characteristics—MIO and AI Devices (Part 2)
Note For NB-MIO devices, software triggering actually is done in the interrupt service
routine (interrupts only) and is different than conditional retrieval.
Channel Numbers
Transfer Method
Update Clocks
DAC Type
FIFO Size
Device
Channel Numbers
Transfer Method
Update Clocks
DAC Type
FIFO Size
Device
Channel Numbers
Transfer Method
Update Clocks
DAC Type
FIFO Size
Device
AT-MIO-XE-50 No No No No Yes
NEC-MIO-16XE-50
DAQPad-MIO-16XE-50 No No No No Yes
VXI-MIO-64XE-10 No No No No Yes
1 These devices appear more than once in this table because they have enhanced digital functionality.
Timebases Available
Counter Chip Used
Counters Available
Outputs Available
Count Direction1
Number of Bits
Output Modes
Available
Device
Table B-9. Counter Usage for Analog Input and Output—MIO and AI Devices
E Series Devices DAQ-STC The DAQ-STC chip uses dedicated clocks for these purposes.
AT-MIO-16F-5 Am9513 Ctr 3 Ctr 4 (& 5)1 Ctr 2 (or 1)2 Ctr 5, 2 or 1
AT-MIO-64F-5
AT-MIO-16X
AT-MIO-16/16D Am9513 Ctr 3 Ctr 4 (& 5)1 Ctr 2 (or 1)2 Ctr 2 (and
NB-MIO-16X via DMA for
NB-MIO-16X)
NB-MIO-16 Am9513 Ctr 3 Ctr 4 (& 5)1 None (or 1)2 (via DMA)
1 If the total number of samples is less than 65535, only the first counter is used. If the number of samples exceeds 65536,
the first counter is used together with the second counter as a 32-bit sample counter.
2 Ctr 2 (or no counter for NB-MIO-16) is used for normal scanning operations, and Ctr 1 is used for AMUX-64T and
SCXI hardware scanning.
Note By Device means you select the value of a parameter with hardware jumpers, and
the selection affects any group of channels on the device. By Group means you
program the selection through software, and the selection affects all the channels
used at the same time. By Channel means you program the selection with hardware
jumpers or through software on a per channel basis. When a specific value for a
parameter is shown, that parameter value is fixed.
Table B-11. Analog Input Characteristics—Lab and 1200 Series and Portable Devices (Part 1)
DAQCard-500 8SE 12 1 ±5 16
1 You can determine the limit settings of your device by multiplying the range and the voltage values together. For more
information on limit settings in LabVIEW, refer to Chapter 3, Basic LabVIEW Data Acquisition Concepts, in the LabVIEW
Data Acquisition Basics Manual.
Table B-12. Analog Input Characteristics—Lab and 1200 Series and Portable Devices (Part 2)
Max
Sampling
Device Scanning Triggers Rate (S/s) Transfer Method
Lab-LC Any single channel; Software trigger, pretrigger, and 62.5 k Interrupts
Lab-NB for multiple channels, posttrigger with digital trigger
N through 0, where N≤7
Lab-PC+ Any single channel; Software trigger, pretrigger, and 100 k; Interrupts;
SCXI-1200 for multiple channels, posttrigger with digital trigger Lab-PC+: Lab-PC+:
DAQPad-1200 N through 0, where N≤7. 83 k Interrupts,
DAQCard-1200 DMA
PCI-1200
Table B-12. Analog Input Characteristics—Lab and 1200 Series and Portable Devices (Part 2) (Continued)
Max
Sampling
Device Scanning Triggers Rate (S/s) Transfer Method
Table B-13. Analog Output Characteristics—Lab and 1200 Series and Portable Devices
Output
Channel DAC Limits Waveform Transfer
Device Numbers Type (V) Update Clocks Grouping Methods
Note The DAQCard-516 and PC 516 devices do not have analog output.
Table B-14. Counter Usage for Analog Input and Output—Lab Series and Portable Devices
Table B-14. Counter Usage for Analog Input and Output—Lab Series and Portable Devices (Continued)
1 The second counter is used as an extended timebase for timed analog input or output when sample interval exceeds 65.535 ms.
Table B-15. Digital I/O Hardware Capabilities—Lab and 1200 Series and Portable Devices
54xx Devices
Table B-16. Analog Output and Digital Output Characteristics—54XX Series Devices
Channel Numbers 0
Waveform Grouping 0
- DDS Mode Must be equal to 16,384 samples. If you load less number of
samples then you will see the contents of unfilled sections of
memory also appearing in the waveform generation.
Output Attenuation (after the DAC) 0 through 74.000 dB (Decibels) in 0.001 dB steps
Table B-16. Analog Output and Digital Output Characteristics—54XX Series Devices (Continued)
Note Refer to your hardware user reference manual for default settings of your device.
Table B-17. Counter/Timer Characteristics—Lab and 1200 Series and Portable Devices
Purpose Counters Available
Outputs Available
Number of Gen.
Count Direction
Number of Bits
Output Modes
Available
Device
Input
Number of Voltage Excitation
Module Channels Range (V) Gains1 Filter1 Channels1 Mode Support
Input
Number of Voltage Excitation
Module Channels Range (V) Gains1 Filter1 Channels1 Mode Support
1DS/C = dip switch-selectable per channel, JS/C = jumper-selectable per channel, JS/M = jumper-selectable per module,
SW/C = software-selectable per channel, SW/M = software-selectable per module
2 The SCXI-1141 has an automatic filter setting. LabVIEW sets the filter frequency based on the scan rates used with the module.
Number of
Module Channels Output Voltage Range (V or mA) Mode Support
Number of Latched or
Module Channels1 Non-latched Start-up Relay Position1 Mode Support
1 You can set or reset each SCXI relay individually without affecting other relays, or you can change all of the relays
at once.
Module Type of Module Number of Channels1 Input Voltage Range Mode Support
SCXI-1124 SCXI-1325 —
SCXI-1140 SCXI-1301 —
SCXI-1304 —
SCXI-1141 SCXI-1304 —
SCXI-1160 SCXI-1324 —
SCXI-1162 SCXI-1326 —
SCXI-1162HV
SCXI-1163
SCXI-1163R
SCXI-1180 SCXI-1302 —
SCXI-1200 SCXI-1302 —
CB-50 —
1 SCXI-1121 only
Note By Device means you select the value of a parameter with hardware jumpers, and
the selection affects any group of channels on the device. By Group means you
program the selection through software, and the selection affects all the channels
used at the same time. By Channel means you program the selection with hardware
jumpers or through software on a per channel basis. When a specific value for a
parameter is shown, that parameter value is fixed.
PC-AO-2DC 0, 1 — 0 to 10V, — — —
(Plug and Play) ±5V,
0–20mA
sink
software-
selectable
DAQCard-AO-2DC 0, 1 — 0 to 10V, — — —
±5V,
0–20mA
sink
software-
selectable
*AT-AO-10 only
Note By Device means you select the value of a parameter with hardware jumpers, and
the selection affects any group of channels on the device. By Group means you
program the selection through software, and the selection affects all the channels
used at the same time. By Channel means you program the selection with hardware
jumpers or through software on a per channel basis. When a specific value for a
parameter is shown, that parameter value is fixed.
Channel Transfer
Device Numbers DAC Type Output Limits Update Clocks Method
Number of Channels
Max Sampling
Input FIFO
Resolution
Range (V)
Rate (S/s)
Scanning
Transfer
Triggers
Method
(words)
Device
AT-DIO-32F 8-bit ports 0, 1, 8-bit port Read or write Two DMA for each
NB-DIO-32F 2, 3 Handshaking on clocks group; dual
or off; extensive available channel DMA
handshaking 16-bit with for groups
modes variable containing port 0
timebase
Timebases Available
Counters Available
Outputs Available
Count Direction
Number of Bits
Output Modes
Counter Chip
Available
Used
Device
Message Definitions
Mnemonics Definition
DCL Device Clear
GET Group Execute Trigger
GTL Go To Local
LLO Local Lockout
MLA My Listen Address
MSA My Secondary Address
MTA My Talk Address
PPC Parallel Poll Configure
PPD Parallel Poll Disable
PPE Parallel Poll Enable
Mnemonics Definition
PPU Parallel Poll Unconfigure
SDC Selected Device Clear
SPD Serial Poll Disable
SPE Serial Poll Enable
TCT Take Control
UNL Unlisten
UNT Untalk
National Instruments has technical assistance through electronic, fax, and telephone systems to quickly
provide the information you need. Our electronic services include a bulletin board service, an FTP site,
a fax-on-demand system, and e-mail support. If you have a hardware or software problem, first try the
electronic support systems. If the information available on these systems does not answer your
questions, we offer fax and telephone support through our technical support centers, which are staffed
by applications engineers.
Electronic Services
Bulletin Board Support
National Instruments has BBS and FTP sites dedicated for 24-hour support with a collection of files
and documents to answer most common customer questions. From these sites, you can also download
the latest instrument drivers, updates, and example programs. For recorded instructions on how to use
the bulletin board and FTP services and for BBS automated information, call 512 795 6990. You can
access these services at:
United States: 512 794 5422
Up to 14,400 baud, 8 data bits, 1 stop bit, no parity
United Kingdom: 01635 551422
Up to 9,600 baud, 8 data bits, 1 stop bit, no parity
France: 01 48 65 15 59
Up to 9,600 baud, 8 data bits, 1 stop bit, no parity
FTP Support
To access our FTP site, log on to our Internet host, ftp.natinst.com, as anonymous and use
your e-mail address, such as [email protected], as your password. The support files and
documents are located in the /support directories.
If you are using any National Instruments hardware or software products related to this problem,
include the configuration forms from their user manuals. Include additional pages if necessary.
Name __________________________________________________________________________
Company _______________________________________________________________________
Address ________________________________________________________________________
_______________________________________________________________________________
Fax ( ___ ) ________________Phone ( ___ ) __________________________________________
Computer brand____________ Model ___________________ Processor_____________________
Operating system (include version number) ____________________________________________
Clock speed ______MHz RAM _____MB Display adapter __________________________
Mouse ___yes ___no Other adapters installed _______________________________________
Hard disk capacity _____MB Brand_________________________________________________
Instruments used _________________________________________________________________
_______________________________________________________________________________
National Instruments hardware product model _____________ Revision ____________________
Configuration ___________________________________________________________________
National Instruments software product ___________________ Version _____________________
Configuration ___________________________________________________________________
The problem is: __________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
List any error messages: ___________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
The following steps reproduce the problem: ___________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
LabVIEW Hardware and Software Configuration Form
Record the settings and revisions of your hardware and software on the line to the right of each item.
Complete a new copy of this form each time you revise your software or hardware configuration, and
use this form as a reference for your current configuration. Completing this form accurately before
contacting National Instruments for technical support helps our applications engineers answer your
questions more efficiently.
Other Products
Computer make and model ________________________________________________________
Microprocessor __________________________________________________________________
Clock frequency or speed __________________________________________________________
Type of video board installed _______________________________________________________
Operating system version __________________________________________________________
Operating system mode ___________________________________________________________
Programming language ___________________________________________________________
Programming language version _____________________________________________________
Other boards in system ____________________________________________________________
Base I/O address of other boards ____________________________________________________
DMA channels of other boards _____________________________________________________
Interrupt level of other boards ______________________________________________________
Documentation Comment Form
National Instruments encourages you to comment on the documentation supplied with our products.
This information helps us provide quality products to meet your needs.
Title: LabVIEW™ Function and VI Reference Manual
If you find errors in the manual, please record the page numbers and describe the errors.
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
_______________________________________________________________________________
I K
ICTR Control, 27-5, 28-10 Kaiser-Bessel Window, 42-6
IIR Cascade Filter, 41-10
IIR Cascade Filter with Integrated Circuit, 41-11
IIR Filter, 41-11
L
IIR Filter with Integrated Circuit, 41-11 Less Or Equal To 0?, 9-8
Implies, 5-4 Less Or Equal?, 9-8
Impulse Pattern, 38-4 Less Than 0?, 9-8
Impulse Response Function, 40-4 Less?, 9-8
In Port (Windows 3.1 and Windows 95), 13-7 Lexical Class, 9-8
In Range?, 9-7 Line Feed, 6-20
Index & Append, 6-8 Linear Fit, 43-4
Index & Bundle Cluster Array, 8-5 Linear Fit Coefficients, 43-4
Index & Strip, 6-8 List Directory, 11-17
Index Array, 7-5 llo – Local lockout, 34-11
Initialize Array, 7-5 loc – Go to local, 34-7
Insert Menu Items, 12-10 loc – Place Controller in local state, 34-11
Insert Queue Element, 13-13 Local Variable, 3-4
Integral x(t), 39-13 Lock Range, 11-17
Interleave 1D Arrays, 7-6 Logarithm Base 2, 4-18
Interpolate 1D Array, 7-6 Logarithm Base 10, 4-18
Inv Chebyshev Coefficients, 41-12 Logarithm Base X, 4-18
Inv Chi Square Distribution, 44-8 Logical Shift, 13-4
Inv F Distribution, 44-9 LPM-16 Calibrate, 29-14
Inv Normal Distribution, 44-9 LU Factorization, 45-13
Inv T Distribution, 44-9
Inverse Chebyshev Filter, 41-12 M
Inverse Complex FFT, 39-13
Make Alias, 52-13
MakeAddr, 35-10 O
Mantissa & Exponent, 13-5 Octal Digit?, 9-10
Master Slave Config, 29-14
off – Take controller offline, 34-12
Match Pattern, 6-8
off – Take device offline, 34-7
Matrix Condition Number, 45-13 One Button Dialog Box, 10-8
Matrix Norm, 45-13
Open Application Reference, 12-3
Matrix Rank, 45-14 Open Automation Refnum, 51-2
Max & Min, 9-9
Open Config Data, 11-22
Mean, 44-10
Open File, 11-18
Measure Frequency, 26-3 Open VI Reference, 12-4
Measure Pulse Width or Period, 26-4
Open/Create/Replace File, 11-7
Median, 44-10
Or, 5-5
Median Filter, 41-13 Or Array Elements, 5-5
MIO Calibrate (Windows), 29-15
Out Port (Windows 3.1 and Windows 95), 13-7
MIO Configure (Windows), 29-16
Outer Product, 45-14
Mode, 44-10
Moment About Mean, 44-11
Move, 11-17 P
MSE, 44-11 Parks-McClellan, 41-13
PassControl, 35-3
Path Constant, 11-27
N Path To Array Of Strings, 11-18, 6-19
Natural Logarithm, 4-19
Path To String, 11-18, 6-19
Natural Logarithm (Arg +1), 4-19
Path Type, 11-18
Network Functions (avg), 40-4 pct – Pass control, 34-8
New Directory, 11-17
Peak Detector, 40-5, 47-3
New File, 11-18
Periodic Random Noise, 38-4
Nonlinear Lev-Mar Fit, 43-5 Pick Line & Append, 6-11
Normal Distribution, 44-11
Polar To Complex, 4-20
Normalize Matrix, 46-4
Polynomial Interpolation, 43-5
Normalize Vector, 46-5 Power & Frequency Estimate, 40-5
Not, 5-4
Power Of 2, 4-19
Not A Notifier, 13-10
Power Of 10, 4-19
Not A Number/Path/Refnum?, 9-9 Power Of X, 4-19
Not A Path, 11-27
Power Spectrum, 39-17
Not A Queue, 13-14
ppc – Parallel poll configure, 34-8
Not A Refnum, 11-27 ppc – Parallel poll configure (enable and disable), 34-12
Not A Rendezvous, 13-16
PPC Accept Session, 53-2
Not A Semaphore, 13-18
PPC Browser, 52-5, 53-2
Not And, 5-4 PPC Close Port, 53-2
Not Equal To 0?, 9-9
PPC End Session, 53-3
Not Equal?, 9-9
PPC Inform Session, 53-3
Not Exclusive Or, 5-4 PPC Open Port, 53-3
Not Or, 5-4
PPC Read, 53-4
Number To Boolean Array, 4-11, 5-5
PPC Start Session, 53-4
Numeric Integration, 47-2 PPC Write, 53-5
PPoll, 35-5
PPollConfig, 35-2
S
R
Sample Variance, 44-12
Ramp Pattern, 38-5
Sawtooth Wave, 38-6
Rational Interpolation, 43-5
Scale 1D, 46-7
RcvRespMsg, 35-8
Scale 2D, 46-7
Re/Im To Complex, 4-21
Scaled Time Domain Window, 40-6
Read Characters From File, 11-7
Scaling Constant Tuner, 29-17, 30-9
Read File, 11-7
Scan From String, 6-11
Read from Digital Line, 23-1
Scan String for Tokens, 6-13
Read from Digital Port, 23-2
SCXI Cal Constants, 29-17
Read From I16 File, 11-13
SCXI Temperature Scan, 30-11
Read From SGL File, 11-13
Search 1D Array, 7-7
Read From Spreadsheet File, 11-10
Secant, 4-16
Read Key (Boolean), 11-22
Seconds To Date/Time, 10-9
Read Key (Double), 11-22
Seek, 11-19
Read Key (I32), 11-23
W
U Wait (ms), 10-9
UDP Close, 49-1 Wait at Rendezvous, 13-16
UDP Open, 49-1 Wait for GPIB RQS, 34-6
UDP Read, 49-2 Wait On Notification, 13-10
UDP Write, 49-2 Wait On Notification From Multiple, 13-11
Unbundle By Name, 8-6 Wait On Occurrence, 13-20
Unbundle, 8-6 Wait Until Next ms Multiple, 10-10
Unflatten From String, 13-7 Wait+ (ms), 27-7
Uniform White Noise, 38-10 WaitSRQ, 35-8
Unit Vector, 46-8 While Loop, 3-3
Unwrap Phase, 39-19 White Space?, 9-10
User Definable Arithmetic Constants, 4-8 Write Characters To File, 11-11
Write File, 11-11
Write Key (Boolean), 11-24
V Write Key (Double), 11-24
Variance, 44-13 Write Key (I32), 11-25
VI Library Constant, 11-28 Write Key (Path), 11-25
VISA Assert Trigger, 33-5 Write Key (String), 11-25
VISA Clear, 33-5 Write Key (U32), 11-26
VISA Close, 33-5 Write to Digital Line, 23-2
VISA Disable Event, 33-10 Write to Digital Port, 23-3
VISA Discard Events, 33-10 Write To I16 File, 11-13
VISA Enable Event, 33-11 Write To SGL File, 11-14
VISA Find Resource, 33-6 Write To Spreadsheet File, 11-12
VISA In8 / In16 / In32, 33-12
VISA Lock, 33-6
VISA Map Address, 33-16 Y
VISA Memory Allocation, 33-13, 33-17 Y[i] = Clip {X[i]}, 39-19
VISA Memory Free, 33-13, 33-17 Y[i] = X[i-n], 39-19
VISA Move In8 / Move In16 / Move In32, 33-14
VISA Move Out8 / Move Out16 / Move Out32, 33-14
VISA Open, 33-7
Z
VISA Out8 / Out16 / Out32, 33-15 Zero Padder, 39-20
VISA Peek8 / Peek16 / Peek32, 33-17