It is not easy to make a correlation plot in LabVIEW in which two
quantities are graphed relative to each other, with each point color
coded according to a third quantity. With the advent of XControls
in
LabVIEW 8, it became possible to implement such a graph in a way that
is easy for other programmers to use. This Correlation Plot XControl
(LV 8.2.1)
(636 KB)includes an example program showing how to use the XControl as
well as a short document describing the XControl and its properties.Version 1.1.1 posted 10/22/07 contains minor cosmetic improvements. |
![]() |
The
Gaussian Beam Calculator (LV 6.0) or Gaussian Beam Calculator (LV 8.2) is a
program I wrote for calculating the propagation of a Gaussian (laser)
beam through a series of simple lenses. The user specifies the
wavelength, the initial beam waist and position, and (optionally) M2.
The program then calculates the transformation of the beam as it
encounters each lens (positive or negative focal length), yielding a
new waist and position. The results are presented in a table and
graphically. Configurations of lenses can be saved and reopened
later, and results can be exported to ASCII (Excel-compatible)
files. There is no fixed limit to the number of lenses that can
be
analyzed.
This program is available either as LabVIEW
VIs (LV 6.0.2) (307 KB), LabVIEW
VIs (LV 8.2) (433 KB), an executable
for LV 6.0.2
(685 KB) or as an executable for LV
8.2 (3.8 MB). The LabVIEW 6.0.2 VIs require the Utitlity VIs available on
the Utilities page and also
require
that LabVIEW to be installed on the end-user's computer. (Also
note that in the LV version, it is possible for one of National
Instruments' VI's to become unlinked, depending on where you install
the VI's. To launch the help file display, this program uses the
Open URL in Browser.vi which is located under
LabVIEW/help/_browser.llb It may be necessary to relink this VI
to
get the program to run.) The LabVIEW 8.2 souce code has the
Utility VIs built into the same download.
The executable version does not require
that LabVIEW be installed on the end-user's computer, but does require
that the LabVIEW run-time engine be installed. The LabVIEW
run-time engine is free and can be downloaded from National Instruments, by navigating
through Download Software/Drivers and Updates/All Software
Versions/LabVIEW/platform/Run Time Engine, or by going through
their ftp site at ftp.ni.com and navigating through
Support/LabVIEW/Runtime/(platform). (I cannot supply a direct
link
to their web download since their addresses are dynamic and it may be
necessary to register in order to access the download.
Registration is not necessary if you go through their ftp site.)
Note that the correct version (6.0.2 or 8.2) of the Run Time Engine is
required. If
you download a different version instead, the
executable version of the Gaussian Beam Calculator will not
operate. If you already have one of the required versions of the
LabVIEW Run Time Engine installed on your computer, then choose the
appropriate version of the Gaussian Beam Calculator and you won't need
to install the RTE again.
Version 1.2 of the Gaussian Beam Calculator, posted 20020128, fixes
a small bug in the Units menu that manifested itself when
previously-saved files were read into the program.
The help file describing the program (which is included in the
downloads) can be viewed here.
This VI (LV 8.2.1,
35KB) is used to calculate the angel in radians between two lines
in three dimensions that both pass through the origin. In
addition to the simple calculation sub-vi, an example program (shown to
the right) is included to help visualize how it works. Note that
this example program uses the LabVIEW 3D Graph, and so cannot be used
in the LabVIEW Base package.This program was updated to version 1.1 in February, 2008, to correct a wiring error in the example VI. |
![]() |
Note that the factor of 2.772589 scales the peak so that the width is expressed in terms of FWHM. If you wish other measures of the width, you can rescale the result or alter the VI as needed. Depending on your data, you may also wish to alter the calculations of the initial guesses for the coefficients. (E.g., you may need to calculated the DC Offset based on the first few and last few points of data, or you may want to smooth the data before calculating the intial guesses.)
Requirements: Since it is based on the Advanced Analysis package, this VI cannot be run from the LabVIEW Base package or the Student Edition. The Full Development System or a higher package is required in order to support the low-level routines used in this program. Also note that this VI calls the Error Cluster Generator, which is part of the UtilityVIs.llb described on the Utilities page.
Version 2.0, posted 20020914, is significantly revised and improved. In order to improve performance, the Target Function was rewritten so that it is called once for the entire array of data, rather than once for each point. This and other improvements were suggested by Christian Altenbach and Don Wagner. Christian and Don also assisted generously in testing these algorithms and made numerous helpful suggestions. Version 2.0 is significantly cleaner and more powerful than the older versions previously posted here. This version includes support for standard deviations for each data point, numerically calculated derivatives as well as analytical derivatives, and more than one target function definition. (The original Exponential function in NI's example is included as well as the Gaussian fit.) VI's written by Christian and Don use dynamically called target functions, which is a great way to support a large number of fitting functions. This version uses a type-def enum control to select which target function to use. It is fairly easy to edit the enum and the Target Function VI to add a small number of additional functions. In addition, this direct call is slightly more efficient than the dynamic call.![]() |
Please
report any bad links, other problems, or comments to: ![]() |
![]() |