Original Code
          Consulting Original Code Consulting

OCC Home Page    MICAS-X  LabVIEW related
              publications  LabVIEW Presentations  BotLabs Web Page - home of the Saurobots!  Links
General VIs and Programs  File and Directory Utilities  LabVIEW Instrument
              Drivers
  Scientific LabVIEW
              Programs for Download  LabVIEW Games for Download

General LabVIEW VIs and Programs
Compare
              Version Strings  OCC Desktop Utilities Program  Make Everything Visible  Wait Until Ready  Presentation Timer  Sync UTC Time  Color Ramp Calculator  Custom Error Parser  Save
              Front Panel Values as Defaults  Serial Tools  Utility VIs

Below are some LabVIEW programs and VIs I have written and have made available to the LabVIEW community. The first program is shareware, but all of the rest are free with the sole condition being that the attribution to their original author be left intact in the VI documentation.  Although it is not required, if you do download any of these programs, I would appreciate hearing from you.  Let me know (using the address at the bottom of this page) how well they work for you, and if you have any suggestions for improvements or observations of bugs that need fixing.

Compare Version Strings OCC Compare Version Strings.vi (15KB, LV 2013) is used to compare version strings of the type "n.n.n.n" to tell if one string represents an earlier or later version than the other.  For version strings, each "n" is interpreted as an integer.  This function interprets each integer, so that version 1.11 is recognized as greater than version 1.2, for example.  Note that missing minor versions are interpreted as 0, so that verion 1.1.0 is equal to version 1.1.  Also note that this VI is only designed to work with version integers of up to four digits.  E.g. it can parse version 1.9999.1.0 correctly, but is not guaranteed to parse version 1.10001.1.0 correctly.  In addition, this VI ignores insignificant formatting issues, such as extra spaces or leading zeros in any of the sub-versions. Compare Version Strings



OCC Desktop Utilities Program OCC Desktop Utilities is a versatile program written in LabVIEW but compiled to an executable program and distributed as a shareware program.  This utility is designed to be run automatically at startup. It presents the user with numerous useful resources, including a virtual sticky-pad for storing quick notes, an encrypted list of accounts and passwords, several file handling utilities for adding security to your computer, various timers, and a mechanism for automatically synchronizing the computer clock to NIST time sources.  The LabVIEW Run Time Engine 6.1 is required to run this program.  Source code is not available.

Make Everything VisibleMake Everything Visible (21KB, LV 2009) is a small utility for use during the development of UI-intensive LabVIEW applications.This VI can be dropped on a block diagram of a top-level VI and is used to make all the controls and indicators on the top-level VI visible for development purposes.  Often, such UI VIs have many elements that are made visible and invisible at different pointsduring execution.  Since many of them are invisiible while editing, it can be difficult to know where to add or how to align new UI elements.  Instructions for its use are included on the front panel of the VI. Make Everything Visible


Wait Until
            Ready  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.
    Wait Until Ready (549 KB, LV 8.6.1) is a program that resolves this issue by querying one or more Daq Devices.  Once it finds that the devices are ready, it starts the desired program.  This optimizes the process by always ensuring that enough time is allotted for the operating system to initialize the devices, but no extra time is wasted before starting the desired program.  A description of the program is available, and the full download includes a build definition for creating an executable version as well as an installer.

Presentation Timer 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
Presentation
                  Timer

Sync UTC
                    Time 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.)
Sync UTC Time

Color Ramp Calculator(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. Color Ramp
                  Calculator

Error
            Parser  (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.

Save Front Panel Values as
            Defaults (LabVIEW 6.0) Save Defaults (130 KB) demonstrates how the VI Server can be used to save the values of front panel controls as defaults so that they are automatically presented the next time the program is run. Additional notes and explanation on how the program works are available.  (This document is included with the download, as is an example program showing how to use the VIs.)

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 Tools (LabVIEW 6.0) Serial Tools (291 KB) version 1.6 is a library of VIs that repackages the "classic" LabVIEW serial functions in a more up-to-date format.  Although VISA is the currently accepted standard for serial port communication in LabVIEW, the "classic" serial port functions have their own benefits, including ease of installation for compiled programs (.exe's), since the VISA software layer does not need to be installed on the target machine in this case.  These VIís include error clusters and error handling, Port Out indicators for better data flow, and enumerated controls for easier handling of Ports and Baud Rates.  In addition, higher level VIís are included that provide for reading from a serial port with time-outs and with termination characters, writing with termination characters, broadcasting test data out a serial port, and snooping on a serial port for diagnostics.  In addition, a Scanning Serial Port Snooper.vi can be used to help determine the port settings (baud rate, parity, etc) for a serial port that is broadcasting data using unknown settings  Additional examples include a simple terminal emulator program, a Virtual Serial Device VI that acts as a serial communications device, and a VSD Driver for controlling the Virtual Serial Device using a LabVIEW driver.

    Note that with the release of LabVIEW 7.0, these VI's are fairly obsolete.  If this toolkit is loaded into LabVIEW 7.0 or later, the calls to the "classic" serial IO functions will automatically be replaced with compatibility VI's that handle the serial IO through VISA.

Serial Port Resources is a Word document listing various useful hardware and software resources and tips for dealing with serial ports.


Utility VIs (LabVIEW 6.0) UtilityVIs (144 KB) currently includes six example/utility programs.  (Note that due to improvements in LabVIEW and in operating systems, most of these programs are outdated and of limited use.  The most useful of them have been extracted and are available individually below.)
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.

OCC Home Page  Top  MICAS-X  LabVIEW related publications  LabVIEW Presentations  BotLabs Web Page - home
                  of the Saurobots!  Links
Please report any bad links, other problems, or comments to: 

Site Map and
                        Downloads