Windaq Add-ons
|
|
The following is a sample vi on
how to use Ultimaserial ActiveX in LabView 9 (LabView 9 Evaluation
Package is what we tested on). It also demonstrates how to retrieve
individual data from the variant returned by GetData.
The following example VI is created on Labview 9, if you are using an older version of LabView that has
compatibility issue with the example vi, please follow the Step-by-Step
tutorial to create your own VI
Required hardware: DI-148U/145/149/155 or other Windaq starter kit
To use
it:
-
Locate LabView Sample VI, us.vi
-
If you install the
latest Ultimaserial, you can find us.vi in c:\ultimaserial\labview
directory.
-
-
Launch us.vi
-
Enter the Device model number. Supported hardware include DI-148U
(default) or other Windaq Starter kit
-
Select the COMM port, 0 for USB port (default)
-
Choose a
sample rate
-
Click Start, and here is what you
will see
To retrieve the latest data from the
variant returned by GetData (See the image below for reference)
-
The returned from
Ultimaserial::GetData is a variant of two dimensional 16-bit
integer array, with the latest data at the end of the array. Refer to GetData
for more detail.
-
This variant is first fed
to Variant to Data
from the Variant palette to
be converted to a data array.
-
Once it is converted to a integer
array, Array Size
from Array
palette is used to retrieve the
size of the array.
-
Index of Array
from
Array palette is used to retrieve
the max column index
-
max column
index -1 yields the last data
scan in the array
-
Use Index Array
from the Array palette to extract
the last data point
-
Next, the
16-bit integer data is multiplied by
10 then divided by 32768
to convert to volt reading. Note,
this is
an approximation by assuming the input
range of +/- 10V
To add an ActiveX control in LabView 8 (See the image below
for reference)
-
Right click on the grid panel
-
When the drop down menu shows up,
click on the double down arrow
at the bottom of the menu, select .NET & ActiveX->ActivX
Container:
-
An ActiveX container will be placed
in the grid panel
-
Right click inside the ActiveX
container, select Insert ActiveX Object...., then Ultimaserial from the
list.
-
If
you need to interface to multiple Windaq Starter kits at the same time, you will need to create
one ActiveX container with Ultimaserial in it for each
device
Last update: 03/14/22
Copyright: 2000-2005 www.UltimaSerial.com
|