General LabVIEW VIs and Programs
![]()
When a LabVIEW program that uses National Instruments Daq Devices is
configured to start immediately when the computer boots, it is often
the case that the program can start before the operating system has
finished initializing the drivers and devices. In such a case, it
may be necessary to unplug the device or reboot the computer before the
device becomes functional. A typical solution to this issue is to
add a delay in the boot process so as to ensure that the drivers are
initialized properly before the program starts. However, this
delay is inherently inefficient, since it must be made longer than the
longest observed necessary time in order to ensure that it works. The
Presentation Timer program is intended to be used at conferences
and meetings to indicate when an event or presentation should
end. It can be run on a laptop and displayed either on the laptop
screen or on a projector so that the presenter, chair, and audience
have a clear view of when the time has expired. This version
(2.0) of the program was
written in LabVIEW 8.2 and has been compiled to run on Windows 2000 or
XP. This program requires the LabVIEW 8.2 Run Time Engine
(RTE). Two versions of the installer for this program are
available, a 4.8 MB download that does not include the RTE, and a 57 MB
download that does include the RTE. If you already have the LV
8.2 RTE installed on your computer, or if you want to get the LV RTE
directly from National Instruments,
use the smaller download. I appologize for the size of these
downloads. As the LabVIEW program has grown and matured, the size
of this type of compiled program has exploded. I will look at
ways to reduce the size of these downloads in the future.New features in version 2.0 include the ability to play a .wav sound file when an alarm goes of, a graphical interface for configuring the timers and options, a time-of-day clock mode, and features that make it possible to use this timer on the same computer as the presentation (e.g. Powerpoint). Version 2.0 of the Presentation Timer is Shareware. You may try it for up to three weeks. If you choose to continue using the program after that point, please see the Register menu item in the program for instructions on registering the program. Registration costs $10.00. Downloads: Presentation Timer ver 2.0 for Windows (58 MB) (installer includes LV-RTE, sample sounds, and instructions) (Note that when this version is installed, a license agreement appears. This license refers to the LabVIEW Run Time Engine.) Presentation Timer ver 2.0 for Windows without RTE (4.8 MB) (includes instructions and sounds) Presentation Timer Instructions |
![]() |
The OCC
Sync UTC Time program provides a simple interface for synchronizing a
Windows computer to the time signal provided by an NTP server.
Both time and date are synchronized to a sub-second accuracy.
Note that this program sets the computer System Time to the UTC time on
the NTP server. The computer time will be further adjusted
according to the time zone selected in the OS.The list of available NTP servers is determined by the OCC Sync UTC Time.ini file, located in the program directory. If this file is not present, it is created with a single NIST NTP server listed. To alter the list of NTP servers, edit the .ini file and add entries of the form NTP n = xxx.xxx.xxx.xxx where n is an integer starting with 0 and increasing sequentially andxxx.xxx.xxx.xxx is the IP address of an NTP server. This software is freeware licensed under the Creative Commons Attribution-No Derivative Works 3.0 License (http://creativecommons.org/). It may be freely distributed and used as long as no derivative products are developed and the attribution to the original author remains intact. Downloads: OCC Sync UTC Time ver 1.0.0.1 for Windows (55MB) (This installs a built executable program with the LabVIEW Run-Time Engine and can be run on any Windows 2000 or XP system without additional software.) OCC Sync UTC Time LabVIEW 8.2.1 source code version 1.0.0.1 (543KB) (This zip file includes the LabVIEW source code for the program, the dll that it calls, and all the project files required for building an executable and installer.) |
![]() |
(LabVIEW
8.20) Color Ramp
Calculator (56KB) is a set of three VIs that implement a simple
interface for choosing a color ramp of up to 256 colors. This zip
file contains three VIs. Color Ramp Calculator is the main
working VI. The Choose Color Ramp.vi (shown on the right) is an
implementation of a user dialog showing how the Color Ramp Calculator
can be used. The Color Component Generator is a sub-vi used by
the Color Ramp Calculator and is a modification of a VI distributed by
Naitonal Instruments in an example. Compared to NI's color ramp
interface, this implementation has two advantages: the user
interface is simpler, and it is able to generate a color ramp of any
number of elements up to 256. |
![]() |
(LabVIEW 8.20) Custom
Error Parser (18KB) is a VI that converts an error cluster into a
single string which includes the error number, the error description,
and the complete VI path in which the error occurred. It uses the
same error description database as the General Error Handler, and also
includes the option for user-defined errors and descriptions.
This VI is useful for programs that need to log errors to a file and
need to avoid dialog boxes. The dialog boxes that can occur with
the General Error Handler can be highly undesireable for autonomous or
long-running programs. This VI can be part of a solution for
avoiding those dialog boxes.Although many programmers have noticed that a VI Server method for
saving default values exists, the fact that this method can not be
executed on a running VI has presented difficulties in getting this
much-requested functionality to work. This utility simplifies the
process by encapsulating the required code in a single sub-vi call and
another dynamically-called VI. Note, however, that this program
does not work in compiled executables. (The notes discuss this
limitation and reference other methods that can be used in this case.)
Serial Port Resources is
a Word document listing various useful hardware and software resources
and tips for dealing with serial ports.
Set File Attributes.vi is a program that changes the file attributes (read-only, archive, and/or hidden) for all files matching user specified criteria. It is especially useful when files are moved to a new hard drive via a CD-R disk, since direct copies from CD-R's (as opposed to installed programs) leave the Read-Only attribute set, which makes it impossible to save changes to the new copies. (Note that this is a Windows-only VI, as it calls the Windows API through a dll.)Error Cluster Generator.vi (15 KB) takes a simple error number and converts it to an error cluster. It also parses the calling VI's calling chain to create a legible "source" string. An error in cluster input also allows passing errors through from previous VI's and functions. This VI is useful for converting older VIs that use simple error numbers to the more modern use of error clusters. See the Serial Tools above for examples of its use.
Error Selector.vi (13 KB) selects one error cluster out of up to four inputs. It selects error inputs over warnings, and warnings over empty clusters. If more than one error (or more than one warning, with no errors) is input, it chooses the error (or warning) closest to the top of the connector pane (or front panel).
Although it is usually wise to log or acknowledge every error, there are times when one may need to combine errors from multiple sources and report only one. One such case is when acquisition is occuring from multiple sources in parallel. These parallel calls should often not be wired together with their error clusters, since that serializes them (losing any benefit of parallel execution) and because an error in one could prevent legitimate data from being acquired from the others. Although you may want to log all errors from all sources, it may be useful to present the operator with a single error. If more than one data source is generating an error, the operator may not see the second error right away, but when he/she fixes the first fault, the second will likely still be occuring and will then be seen.Control Memory.vi is a re-entrant, polymorphic VI based on an article in LabVIEW Technical Resources. It can be used to facilitate user interface polling loops. In this situation, this VI can replace a shift register and related logic for detecting when a control has changed value. This VI supports Booleans, all numeric types, strings, and arrays of doubles. Other simple numeric arrays can be used with coercion. For more complex data types (clusters), a new instance of this VI must be made..
Wait+ (ms) (reentrant).vi is a minor revision on an NI VI. The Wait+ (ms).vi is a relatively useful packaging of the Wait (ms) function in a Vi that provides error chaining. Unfortunately, NI hid this VI in a low Daq sub-pallette. The main difference between this VI and NI's is that this VI is set to be reentrant, so that it acts more like the Wait (ms) function when called from more than one place in a set of parallel VI's. (In LabVIEW 6.0 and later, their version of this function is also reentrant.)
The sixth VI in this library is Search Recursively.vi, which is used by the Set File Attributes.vi. It was developed by NI. It returns a list of all files in a directory and in all sub-directories in that directory's hierarchy.