Sie sind auf Seite 1von 61

ActiveX Application

Programming Interface
User Guide
Rev. 1.6

Library Software Installation


Sample Programs
Object Definitions

E-mail: ldsdactron-techsupport@bksv.com
Web Site: www.bksv.com
Information in this document is subject to change without notice. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Brüel & Kjær Sound & Vibration
Measurement A/S (“Brüel & Kjær”).

By installing, copying or using the Software, the user agrees to be bound by the terms of the
Brüel & Kjær End User License Agreement which is a legally binding agreement between the
user (“the Licensee”) and Brüel & Kjær for the Brüel & Kjær software, which includes software
components and tools, and written documentation (“Software”).

Brüel & Kjær makes no warranties on the Software, whether express or implied, nor implied
warranties of merchantability or fitness for a particular purpose. Brüel & Kjær does not
warrant your data, that the software will meet your requirements, or that the operation will be
reliable or error free. The Licensee of the Software assumes the entire risk of use of the
Software and the results obtained from use of the software. Brüel & Kjær shall not be liable for
any incidental or consequential damages, including loss of data, lost profits, cost of cover or
other special or indirect damages.

Copyright © 2009. Brüel & Kjær Sound & Vibration Measurement A/S. All rights reserved

All trademarks and registered trademarks are the property of their respective holders.
Table of Contents
1  Introduction ............................................................................................................................. 1 
2  Installation............................................................................................................................... 4 
LDS-Dactron Hardware Installation ....................................................................................... 4 
ActiveX API Software Installation ......................................................................................... 4 
Run Get Status Sample Program............................................................................................. 6 
3  Sample ActiveX Programs ...................................................................................................... 7 
Get Status VB ......................................................................................................................... 8 
Button Status Sample VB ....................................................................................................... 9 
Measurement Sample VB ..................................................................................................... 10 
Source Sample VB ................................................................................................................ 11 
Throughput Sample VB ........................................................................................................ 12 
4  Measurement Without Programming .................................................................................... 15 
Visual Basic .......................................................................................................................... 15 
Matlab ................................................................................................................................... 15 
Using MeasEngine object in Microsoft Visual Basic ........................................................... 16 
Using MeasEngine object in Mathworks Matlab.................................................................. 17 
Using MeasEngine object in Agilent VEE ........................................................................... 18 
Using MeasEngine object in NI LabVIEW .......................................................................... 19 
5  Library Overview .................................................................................................................. 21 
Object model ......................................................................................................................... 21 
Basic Setup............................................................................................................................ 22 
Measurement Setup ........................................................................................................... 23 
Channel Setup ................................................................................................................... 24 
Using source output .......................................................................................................... 24 
Arm and trigger ................................................................................................................. 24 
Recovering from Software Failure.................................................................................... 25 
6  MeasEngine Object ............................................................................................................... 26 
MeasEngine methods ............................................................................................................ 26 
MeasEngine.Open ............................................................................................................. 26 
MeasEngine.Close ............................................................................................................ 26 
MeasEngine.Start .............................................................................................................. 27 
MeasEngine.Initialize ....................................................................................................... 27 
MeasEngine.Stop .............................................................................................................. 27 
MeasEngine.Arm .............................................................................................................. 27 
MeasEngine.Trigger.......................................................................................................... 28 
MeasEngine.Abort ............................................................................................................ 28 
MeasEngine.ReadDone ..................................................................................................... 29 
MeasEngine.SaveSetup(file) ............................................................................................. 29 
MeasEngine.LoadSetup(file) ............................................................................................ 29 
MeasEngine properties.......................................................................................................... 29 
MeasEngine.NumberOfInputs .......................................................................................... 30 
MeasEngine.NumberOfSources........................................................................................ 30 
MeasEngine.Error ............................................................................................................. 30 
MeasEngine.MeasState ..................................................................................................... 31 
MeasEngine.State.............................................................................................................. 32 
MeasEngine.DataAvailable .............................................................................................. 32 
MeasEngine.xData(channel)............................................................................................. 33 
MeasEngine.yData(channel)............................................................................................. 33 
MeasEngine.yReal(channel) ............................................................................................. 33 
MeasEngine.yImag(channel) ............................................................................................ 34 
MeasEngine.MeasSetup .................................................................................................... 34 
MeasEngine.ArmTrigger .................................................................................................. 34 
MeasEngine.Average ........................................................................................................ 34 
MeasEngine.Input ............................................................................................................. 34 
MeasEngine.Source .......................................................................................................... 34 
MeasEngine.Thruput ......................................................................................................... 35 
MeasEngine.Hardware ...................................................................................................... 35 
MeasEngine.HardwareCommand ..................................................................................... 35 
MeasEngine.ErrorString ................................................................................................... 35 
MeasEngine.SystemReady................................................................................................ 35 
MeasEngine.Log ............................................................................................................... 35 
MeasEngine.DataType ...................................................................................................... 35 
MeasEngine.Version ......................................................................................................... 36 
MeasEngine.LibraryVersion ............................................................................................. 36 
MeasEngine.Address ........................................................................................................ 36 
MeasEngine events ............................................................................................................... 36 
DataAvailable event .......................................................................................................... 36 
MeasEnded event .............................................................................................................. 37 
Error event ........................................................................................................................ 37 
SystemReady event ........................................................................................................... 37 
HardwareCommand event ................................................................................................ 37 
RecordDone event ............................................................................................................. 37 
7  MeasSetup Object ................................................................................................................. 38 
MeasSetup properties ............................................................................................................ 38 
MeasSetup.Span, MeasSetup.Spans ................................................................................. 38 
MeasSetup.SamplingFreq, MeasSetup. SamplingFreqs ................................................... 39 
MeasSetup.BlockSize, BlockSizeRange ........................................................................... 39 
MeasSetup.Window, Windows ........................................................................................ 40 
MeasSetup.Overlap, OverlapRange .................................................................................. 40 
MeasSetup.CenterFreq, CenterFreqRange........................................................................ 40 
8  ArmTrigger Object................................................................................................................ 42 
ArmTrigger properties .......................................................................................................... 42 
ArmTrigger.ArmMode, ArmModes ................................................................................ 42 
ArmTrigger.TriggerMode, TriggerModes ....................................................................... 43 
ArmTrigger.TriggeChannel .............................................................................................. 43 
ArmTrigger.TriggerDelay, TriggerDelayRange .............................................................. 43 
ArmTrigger.TriggerLevel, TriggerLevelRange ............................................................... 44 
ArmTrigger.TriggerSlope, TriggerSlopes ....................................................................... 44 
9  Average Object ..................................................................................................................... 45 
Average properties ................................................................................................................ 45 
Average.Type, Types ........................................................................................................ 45 
Average.Number, NumberRange...................................................................................... 46 
10  Input Object .......................................................................................................................... 47 
Input properties ..................................................................................................................... 47 
Input.Enable(channel)....................................................................................................... 47 
Input.Range(channel), Input.Ranges(channel) ................................................................. 47 
Input.Coupling(channel), Couplings(channel) ................................................................ 48 
Input.RangeStatus(channel) .............................................................................................. 48 
Input.EU(channel) ............................................................................................................ 48 
Input.EUScale(channel) .................................................................................................... 48 
11  Source Object ........................................................................................................................ 49 
Source methods ..................................................................................................................... 49 
Source.Start ....................................................................................................................... 49 
Source.Stop ....................................................................................................................... 49 
Source properties .................................................................................................................. 49 
Source.Enable(channel) .................................................................................................... 50 
Source.Name(channel)...................................................................................................... 50 
Source.Type(channel), Source.Types(channel) ............................................................... 50 
Source.Amplitude(channel), AmplitudeRange(channel) ................................................. 51 
Source.SineFreq(channel), SineFreqRange(channel) ...................................................... 51 
Source.BurstDutyCycle(channel), BurstDutyCycleRange(channel)............................... 51 
Source.ControlCoupling(channel) .................................................................................... 51 
Source.ArbBufferSize(channel), ArbBufferSizeRange(channel) ................................... 52 
Source.ArbData(channel) ................................................................................................. 52 
Source.State(channel) ....................................................................................................... 53 
12  Thruput Object ...................................................................................................................... 54 
Thruput Properties ................................................................................................................ 54 
Thruput.Enable.................................................................................................................. 54 
Thruput.FileFolder ............................................................................................................ 54 
Thruput.FileFormat ........................................................................................................... 54 
Thruput.RecordTime ......................................................................................................... 55 
Thruput.State ..................................................................................................................... 55 
13  Hardware Object ................................................................................................................... 56 
Hardware Properties.............................................................................................................. 56 
Hardware.HardwareType .................................................................................................. 56 
Hardware.HardwareVersion ............................................................................................. 56 
Hardware.SerialNumber ................................................................................................... 56 
Introduction

1 Introduction
The LDS-Dactron ActiveX API (Application Programming Interface) is a library of
functions that allows ActiveX enabled software to drive the LDS-Dactron hardware. This
allows users to develop customized user interfaces for specific applications while taking
advantage of the powerful LDS-Dactron hardware, signal conditioning, data processing and
throughput to disk. The ActiveX API can be used with any ActiveX enabled software such
as Visual Basic, Visual C, Matlab, Labview, Excel, etc. The developer programs the
ActiveX enabled software to invoke the ActiveX commands, which are implemented on the
LDS-Dactron hardware. These commands include sending commands to set up the
hardware, obtaining status, and data.

Dactron Front End


Hardware

Dactron Data Server

Dactron API Interface

Customized User
Interface

Figure 1. LDS-Dactron ActiveX API Architecture

The user must install the ActiveX API library onto the PC before the ActiveX API can be
used. The installation copies sample files, this manual and the ActiveX API library onto the
hard drive. It also registers the API library in Windows as “ME4R 1.0 type library.” Refer
to the installation instructions for more information

1
Introduction

After the ActiveX API is installed on the PC it is strongly suggested that the developer run
the sample programs provided with the software. These programs include samples in Visual
Basic and are intended to illustrate the applications of the methods, properties and events of
the ActiveX API. They can also be used to test that the software and hardware are installed
correctly and are functioning properly. Refer to the section on Sample Programs for more
information.

The current version software, version 1.3, supports following types of hardware platforms:

FOCUS, Photon, Comet, LASER and SpectraBook

A detailed description of the properties, methods and events of the ActiveX API are
included in this manual. The architecture of the API consists of a Measurement Engine with
several sub objects as shown below.

MeasEngine

MeasSetup

Average

Input

Source

Hardware

Throughput

Figure 2. MeasEngine Object methods and properties

The sub objects have their own methods and properties and are categorized below. To use
ActiveX API library, the user must first create a MeasEngine object and then get a reference
of its sub-object through its properties. Refer to the Library Objects section for more
information.

2
Introduction

Class(Object) Description
MeasSetup Measurement and sampling setup
ArmTrigger Arm and Trigger mode setup
Average Averaging setup
Input Analog input channel
Source DAC output channel
Thruput Throughput record and playback
Hardware Information about hardware

3
Installation

2 Installation
The installation includes two steps. First the LDS-Dactron hardware must be installed on
the PC including the device driver. Second the ActiveX API library and documentation must
be installed. These are described below. After installation is complete it is recommended to
run the Get Status Sample VB program to verify that the communication between the PC
and the hardware is established. Instructions to uninstall the ActiveX API library are also
given below.

LDS-Dactron Hardware Installation

Before installing the LDS-Dactron ActiveX API, the LDS-Dactron hardware must be
installed. Refer to the System Guide that was delivered with the hardware and follow the
instructions to connect the front and to the PC and install the device drivers.

Note the system guide includes instructions to install the LDS-Dactron RT Pro application
software. The ActiveX API is intended for use without the LDS-Dactron RT Pro software
so these steps can be skipped.

ActiveX API Software Installation

The LDS-Dactron hardware and drivers must be installed before installing the ActiveX API
software. Refer to the previous section for details. The following instructions give the steps
to install the ActiveX API software onto your PC. This software must be installed onto any
PC that will be used with the LDS-Dactron Hardware and API including the PC for
development and a PC to run developed software with the LDS-Dactron ActiveX API and
LDS-Dactron hardware.

1. Insert the LDS-Dactron RT Pro Installation CD into the CD drive. The installation
interface will automatically launch after a few seconds.

2. Click on Enabling Applications

3. Click on ActiveX API and then follow the instructions.

4. Next you will be prompted for the software codes and hardware serial number/s. (You
will also be asked for the hardware activation code if you are using LDS-Dactron Laser,
SpectraBook or Focus hardware.) Refer to the packing list that came with the system

4
Installation

shipment. Please make sure that you store this information where it is easily retrieved so
that you can have it available when installing a newer version of the software.

Figure 3. Software Code Dialog

Enter the information and click Next and follow the instructions to complete the installation.

When the installation is complete you should have the following items installed on the PC:

• Sample Program Files C:\LDS-Dactron\LDS-Dactron ActiveX\Samples

• User Guide C:\LDS-Dactron\LDS-Dactron ActiveX\User Guide.doc

• Library Files C:\LDS-Dactron\LDS-Dactron ActiveX\bin

Note the Software Codes that unlock the API functions are saved in a file named
passcodes.txt, located in the bin folder. If this file is changed or deleted then the software
will not function. This text file can be manually edited to modify the hardware and software
codes as needed.

5
Installation

Figure 4. Passcode Test File

Run Get Status Sample Program

After the hardware driver and ActiveX API library are installed the user should run the
sample program named “Get Status VB.exe”. This program communicates with the
hardware and indicates that the software is installed correctly. It also initiates installation of
the calibration files. Refer to the Sample ActiveX Programs section for instructions to run
this sample program.

6
Sample ActiveX Programs

3 Sample ActiveX Programs


Several sample programs are installed on the PC during the ActiveX API installation. They
are copied to a folder on your hard drive in the following location:

C:\LDS-Dactron\LDS-Dactron ActiveX\Samples

The compiled executable and the source code are both available for examination and testing.
These sample programs are good tools for understanding the implementation of the ActiveX
API. It is strongly recommended that the developer study the samples before starting a new
application. In most cases the building blocks needed to implement most functions can be
found in the sample programs and the code can be used as a template for building new
applications.

A summary description of the sample programs is given below and detailed instructions
follow.
Table 1. Sample Programs Included with ActiveX API
Sample Program Name Programming Description
Language
Get Status Sample VB Visual Basic This simple sample program gets
several status variables form the
hardware and verifies that the
communication between the PC and
the hardware is okay.
Button Status Sample VB Visual Basic This simple sample program checks
the status of the hardware button
located on the Photon enclosure.
Measurement Sample VB Visual Basic This sample program sets up the front
end parameters, acquires any
available signal and plots it.
Source Sample VB Visual Basic This sample program sets up the
hardware source output, allows the
user to start and stop the source and
acquires time signal and plots it.

7
Sample ActiveX Programs

Get Status VB

Location of source files: C:\LDS-Dactron\ActiveX API\Samples\Visual Basic\Get Status VB

This simple sample program connects to the hardware and returns several status variables. The
purpose of running this program is to simply verify that the hardware and software are installed
correctly and communication is established between the PC and the hardware. It is also a
simple method of determining the API library version number installed on the PC.

To run the sample program, follow these steps:

1. Be sure the device driver and ActiveX API libraries are installed. Refer to the
Installation section in this User Guide.

2. Connect the hardware to the PC.

3. Launch the Get Status VB.exe program.

4. Click on Get Status.

Click on the close window button on the upper right to quit.

Figure 5. Get Status VB Interface

Get Status returns the status variables below.

8
Sample ActiveX Programs

Number of Inputs displays the number of input channels that are available on the hardware.

Number of Outputs displays the number of output channels that are available on the
hardware.

Status displays the status of the hardware. The normal value is “Ready for Init.”

Error Messages displays any error messages sent from the hardware. The normal value is
“OK.”

Hardware Type displays the type of current hardware. The available hardware types are
Photon, Focus, Laser, SepctraBook and Comet.

Hardware Version displays the hardware version number

Hardware SN displays the hardware serial number

API Version Number displays the ActiveX API Library version number installed and
registered on the PC.

Note: In sample program FEB means “Front-End Box”, i.e., the hardware unit.

Button Status Sample VB

Location of source files: C:\LDS-Dactron\ActiveX API\Samples\Visual Basic\Button Status

This simple sample program is for Photon only. It connects to the hardware and returns the
status of the hardware button that is located on the Photon enclosure. This button can be used to
initiate an event such as start and stop acquisition.

When the user clicks on Check Button Status, it returns the HardwareCommand Status. The
value 0 indicates the Photon hardware button has not been pressed, 1 indicates the Photon
hardware button has been pressed. After the user checks the status of the HardwareCommand,
the HardwareCommand status is automatically changed to 0.

The HardwareCommand Event Status display shows “HardwareCommand Fired” when the
Photon hardware button is pressed.

9
Sample ActiveX Programs

Measurement Sample VB

Location of source files: C:\LDS-Dactron\ActiveX API\Samples\Visual Basic\Measurement

This sample program illustrates the procedures for setting up and acquiring data from the
hardware. It also controls the output waveform source so the user can connect the source to an
input and measure live data.

To run the sample program, follow these steps:

1. Be sure the device driver and ActiveX API libraries are installed. Refer to the
Installation section in this User Guide.

2. Connect the hardware to the PC.

3. Launch the Measure Sample VB.exe program.

4. Click on Set Parameters to open the Set Parameters dialog. This dialog can be used to
change the channel and sampling parameters. Click on OK to accept any changed
parameters in the Set Parameters dialog.

5. Select the Source Wave Type

6. Select the Measurement Type, Channel, and Display Mode.

10
Sample ActiveX Programs

7. Click Start Source (connect the source to the active input if desired).

8. Click Start Measurements.

9. To quit the program, click the close window button in the upper right corner of the
window.

Figure 6. Measurement Sample VB Interface

Source Sample VB

Location of source files: C:\LDS-Dactron \ActiveX API\Samples\Visual Basic\Source

1. This sample program illustrates the procedures for setting up and controlling the output
waveform source/s on the hardware. The user can select the waveform type, amplitude,
frequency, etc. start and stop the source and start and stop the display of the waveform.

2. To run the sample, follow these steps:

11
Sample ActiveX Programs

3. Be sure the device driver and ActiveX API libraries are installed. Refer to the
Installation section in this User Guide.

4. Connect the hardware to the PC.

5. Launch the Source Sample VB.exe program.

6. Change any Settings and click Set Parameters

7. Click Start Source (connect the source to input 1 if desired).

8. Click Start Measurement.

9. To quit the program, click the close window button in the upper right corner of the
window.

Figure 7. Source Sample VB Interface

Throughput Sample VB

Location of source files: C:\LDS-Dactron \ActiveX API\Samples\Visual Basic\Throughput

12
Sample ActiveX Programs

This sample program illustrates the procedures for through putting data to disk. This sample
program will only work with Photon or Focus hardware. The user can select the data format,
record time and location of the data files. The source generates a sine wave, which can be
measured for sample data.

To run the sample, follow these steps:

1. Be sure the device driver and ActiveX API libraries are installed. Refer to the
Installation section in this User Guide.

2. Connect the hardware to the PC.

3. Launch the Throughput Sample VB.exe program.

4. Click Enable Throughput

5. Select the File Format and Record Time in seconds.

6. Enter the File Folder. This is the path to the folder where the date file will be saved at
the end of the recording. For example, the following path, “C:\My Documents\Data”
will place the data file in a folder named Data, which is located in the My Documents
folder on the C drive. The file must exist before running the program.

7. Click Set Parameters

8. Click Start Source (connect the source to input 1 if desired).

9. Click Start Measurement.

10. Wait a few seconds or until the Record Time expires then click the Stop button. At this
time the data is unpacked and saved to the File Folder in the specified format.

11. To quit the program, click the close window button in the upper right corner of the
window.

13
Sample ActiveX Programs

Figure 8. Throughput Sample ‘VB Interface

14
Measurement Without Programming

4 Measurement Without Programming


You can perform a simple measurement without writing a single line of program. To test
this example, you’ll need Visual Basic or Matlab. These tools allow you to execute
commands interactively.

Visual Basic

Open a new Visual Basic project.

Add a reference to ActiveX API library. See Using MeasEngine in Microsoft Visual Basic
for detail.

Make Immediate Window visible unless it is already visible. From View menu, select
Immediate Window.

In the Immediate Window, type the following commands

Set h = New MeasEngine


h.Open
h.Start
y = h.yData(1)

That’s it. Now you have the first ADC channel data in variable y. Since the default
measurement blocksize is 1024, y is an array of 1024 floating point numbers. To print any
element in the array, just type

? y(100)

where, 100 is the 101th element of array y. As default, the index starts from zero in Visual
Basic.

Matlab

It is even easier with Matlab. To do the same, in the Matlab command window, type the
following commands.

h = actxserver(‘ActiveX API. MeasEngine’);


invoke(h,’Open’);

15
Measurement Without Programming

invoke(h,’Start’);
y = get(h,’yData’, 1);

To see the measurement result, you can use Matlab plot command.

plot(y);

This command will plot the measurement result in a separate Figure window.

Using MeasEngine object in Microsoft Visual


Basic

To create and use a MeasEngine object in Visual Basic, you will need to add a reference to
your project first. You can do this by the following steps:
• From the Project menu, choose Reference.
• Select the check box next to each reference you want to add to your project. For
MeasEngine, select Agilent Technologies measurement engine type library.
• Choose OK to add the selected references to your project.

You can use the Object Browser to display the description of classes, properties and
methods.

To display the Object Browser,


• From the View menu, choose Object Browser

or,
• Click the Object Browser button on the toolbar.

The Object Browser displays information in three levels. By default, Object Browser
shows all the libraries referenced by your project. From the top menu, you can select a
single library, "ActiveX APIlib" to view MeasEngine object only. Click on a class in the
Classes list to view its description in the description pane at the bottom. The class’s methods
and properties will appear in the Members list on the right. You can view the description,
arguments and return value of a member by clicking on the member in the Members list.

To use ActiveX object in Visual Basic,


• Create a reference to an object.
• Write code using object’s methods and properties

16
Measurement Without Programming

• Release the object when you are finished using it.

For example,
‘Declare object variable of MeasEngine
Dim h As MeasEngine
‘Create a new object and assign a reference
Set h = New MeasEngine
‘Use method or a property
h.Open
Text1.Text = h.NumberOfInputs
h.Close
‘Release the object
Set h = Nothing

Using MeasEngine object in Mathworks Matlab

Unlike Visual Basic, Matlab 5.3 does not have Object Browser. The user needs to use other
tools such as Visual Basic to find out the methods and properties of Object or rely on the
documents provided with the library.

Matlab provides five functions to use ActiveX automation. These functions are,
• actxserver: Create an instance of object.
• invoke: Execute a object method
• set: Set a property value.
• get: Get a property value.
• release: Release a object.

The basic procedure to use ActiveX objects in Matlab is the same as Visual Basic:
• Create a reference to an object.
• Write code using object’s methods and properties
• Release the object when you are finished using it.

For example,

%Create a new object and assign a reference


h = actxserver(‘ActiveX API.MeasEngine’);
%Use method or a property
invoke(h,‘Open’);
get(h,’NumberOfInputs’)

17
Measurement Without Programming

invoke(h,’Close’);
%Release the object
release(h);

Using MeasEngine object in Agilent VEE

To create and use a MeasEngine object in VEE, you will need to add a reference to your
project first. You can do it by the following steps,
• From the Device menu, choose ActiveX Automation References.
• Select the check box next to each reference you want to add to your project. For
MeasEngine, select Agilent Technologies measurement engine type library.
• Choose OK to add the selected references to your project.

You can use the Function & Object Browser to display the description of classes,
properties and methods.

To display the Function & Object Browser,


• From the Device menu, choose Function & Object Browser

or,
• Click the Function & Object Browser button on the toolbar.

To view the information about the ActiveX object, click on ActiveX Objects from
Function & Object Browser Type list. Function & Object Browser shows a list of
Library, Class and Member. From the Library list, you can select ActiveX APILib to view
MeasEngine object. Click on a class in the Class list to view its members. The class’s
methods and properties will appear in the Members list on the right. You can view the
description, arguments and return value of a member by clicking on the member in the
Member list.

To use ActiveX object in VEE,


• Create a reference to an object.
• Write code using object’s methods and properties
• Release the object when you are finished using it.

For example,

Declare global variable of an object.

18
Measurement Without Programming

From Data menu, select Variable and Declare Variable sub menu.

In the Declare Variable dialog box,


• Enter h as a name
• Select global from Scope menu
• Select Object from Type menu
• Click the Specify Object Type and Edit
• Select ActiveX APILib from Library menu and MeasEngine from Class menu.

To create a MeasEngine object, click Built-In Functions from Type list of Function &
Object Browser and select ActiveX Automation from the Category list. Select
CreateObject member and click Create Formula button at the bottom. Use ActiveX
API.MeasEngine as an object name.

‘Create a new object and assign a reference


Set h = CreateObject("ActiveX API.MeasEngine");
‘Use method or a property
h.Open();
h.NumberOfInputs
h.Close();
‘Release the object

From Data menu, select Variable and Delete Variable.

Using MeasEngine object in NI LabVIEW

To use a MeasEngine object in LabVIEW, first create a reference to your project. This is
done using the following steps:
• From the Functions toolbox, choose Communication.
• Select ActiveX from the Communication tool and click Automation Open…
• Place the Automation Open icon on your project diagram.

Once you create an Automation Open icon, then you’ll need to specify the object class.

To select a class:
• Right mouse click at the Automation Open icon.
• From a pop up menu, click Select ActiveX class and Browse…

19
Measurement Without Programming

• Select Agilent Measurement Engine from Type Library menu and click MeasEngine
from the list of Creatable Objects

To use properties or methods of a created object, you’ll need to add an Invoke Node or
Property Node on your project diagram. To do this:
• From the Functions toolbox, choose Communication.
• Select ActiveX from the Communication tool and click Invoke Node or Property Node.
• Place the Invoke Node or Property Node on your project diagram.
• Connect a wire from the Automation Open icon to the Node you have just placed by the
following steps:
• From the Tools toolbox, click at Connect wire. Your mouse icon now looks like wiring
tool.
• Single click at Automation Refnum terminal at the top right of Automation Open icon.
• Move the mouse to reference terminal of Invoke or Property Node and click once.
• The title of node should now change from Automation to IMeasEngine.
• To select a method or property, right mouse click at the Method or Property of Invoke or
Property Node. From a pop up menu, select a Methods or Properties. Select a desired
method or property from the list.
• To change the property type from read property to write property (or vice versa), select
Change To Write (or Change To Read) from a pop up menu using a right mouse click.

When you finish with the object, you’ll need to release it. The object can be released by
connecting the wire to an Automation Close icon.

20
Library Overview

5 Library Overview
The LDS-Dactron ActiveX API is created based on Microsoft ActiveX technologies. It
provides a high level, easy interface to the most common development tools in the Windows
environment, such as Microsoft Visual Basic, Mathworks Matlab, Agilent Technologies
VEE and National Instruments LabVIEW. The driver is created as an automation server
DLL (Dynamic Link Library) so that it can be used in many common script languages.

The current version of the ActiveX API supports the following functions:

Time Capture both block by block time capture or continuous throughput to disk

Frequency Analysis: single channel auto power spectrum and linear FFT

Averaging: linear, exponential, overlap, peak hold.

Triggering: data acquisition can be triggered by an input level on any input channel, manual
mode, auto mode, or with source mode.

Waveform Source: outputs Sine, Random, Burst Random, Periodic Arbitrary, DC, Square,
Triangle, Pseudo Random, Impulse Chain, and Arbitrary waveforms

Object model

The architecture of the API consists of a Measurement Engine with several sub objects as
shown below.

21
Library Overview

MeasEngine

MeasSetup

ArmTrigger

Average

Input

Source

Thruput

Hardware

Figure 10. MeasEngine Objects

The sub objects have their own methods and properties and are categorized below. To use
ActiveX API library, the user must first create a MeasEngine object and then get a reference
of its sub-object through its properties.

Class(Object) Description
MeasSetup Measurement and sampling setup
ArmTrigger Arm and Trigger mode setup
Average Averaging setup
Input Analog input channel
Source DAC output channel
Thruput Throughput record and playback
Hardware Provide hardware information

Basic Setup

The basic setup includes defining the measurement type, channel parameters, averaging,
triggering, and waveform source settings, then starting the source, staring the measurement
and acquiring the date. The following is a short program in Visual Basic that demonstrates
these typical steps and the associated API commands.

22
Library Overview

‘Connect to hardware

ME4RLib.MeasEngine.Open ‘Connect to hardware

‘Setup Input (Channel 1 only)


ME4RLib.MeasEngine.Input.Enable(1) = True ‘Enables channel 1
ME4RLib.MeasEngine.Input.Coupling(1) = "ICP" ‘Set coupling to ICP
ME4RLib.MeasEngine.Input.Range (1) = 10 ‘Set voltage range to 10 volts max

‘Setup the sampling parameters


ME4RLib.MeasEngine.MeasSetup.BlockSize = 1024
ME4RLib.MeasEngine.MeasSetup.Span = 9600 'Set span
ME4RLib.MeasEngine.MeasSetup.Window = “Hanning” 'Set window type
ME4RLib.MeasEngine.Average.Type = “Linear” 'Set average type
ME4RLib.MeasEngine.Average.Number = 100 'set Average number

‘Turn on the source


ME4RLib.MeasEngine.Source.Start

‘Start measurement
ME4RLib.MeasEngine.Start

‘Get data
yData = ME4RLib.MeasEngine.yData(1) ‘Get the y data
xData = ME4RLib.MeasEngine.xData(1) ‘Get the x data

‘Stop measurement and Source


ME4RLib.MeasEngine.Stop ‘Stop measurement
ME4RLib.MeasEngine.Source.Stop ‘Stop source

‘Disconnect
ME4RLib.MeasEngine.Close ‘Disconnect from hardware

Measurement Setup
MeasSetup (MeasEngine.MeasSetup) object is used to setup basic sampling parameters
such as measurement span or measurement blocksize. When FreqCoupling
(Source.FreqCoupling) property of Source channel is TRUE (default), then the source
output channel uses the same frequency setup parameters.

Average (MeasEngine.Average) object is used to setup averaging parameters. The


averaging is available for the frequency spectrum. Averaging parameter has no effect on the
time or angle domain data.

ArmTrigger (MeasEngine.ArmTrigger) specifies the arming and triggering conditions.

23
Library Overview

Channel Setup
Input and source channel parameters are set by Input and Source object properties. Unlike
other objects, these channel objects usually take channel number as a parameter. For
example, to set an input range on channel 5, the Visual Basic syntax looks like

Input.Range(5) = 10.0

The channel numbers are automatically assigned from 1 to N at MeasEngine.Open method.


In general, channels are numbered in the order of top to bottom and left to right. The first
channel is at the top of the left most module (slot) and the last channel is located at the
bottom of the right most module (slot). The user can use 0 for the channel number to set a
property of all the channels to the same value, but it is illegal to use zero for getting the
property values.

Input.Enable(0) = FALSE ….. Legal

X = Source.Type(0) ….. Illegal

MeasEngine creates a data buffer in the host PC during the initialization of the
measurement. By default, the data buffer can hold a single block/scan of data for all enabled
input ADC channels. The number of samples for each block is determined by BlockSize.
When an acquired data block is uploaded to this data buffer, the MeasEngine.DataAvailable
property value changes to TRUE, and the user can read data out of this buffer.

Using source output


By default, the source channel is disabled. To output a signal, the user must enable the
channel by setting Enable property to TRUE. When the channel is enabled, it begins signal
output when the channel is started by MeasEngine.Start method.

The Source object sets source output of the hardware. The frequency parameters and source
start and stop are coupled to the input. For example, the frequency span of the random
output signal is the same as the measurement span. The signal from the source channel starts
by the measurement MeasEngine.Start method.

The source start and stop can be de-coupled by the Source.ControlCoupling property. When
the Source.ControlCoupling is FALSE, the signal output starts when the Start method of
Source object is invoked.

Arm and trigger


"Ready to Init" is the state when the measurement is not running or not yet initialized. The
measurement goes to the "Ready to Init" state when it is aborted by Abort method, or

24
Library Overview

some fundamental setup parameters have changed before the Start. The Initialize or Start
method moves the measurement state from "Ready to Init" to "Ready to Start" state. At
the "Ready to Start" state, the data buffer in the host PC memory has been allocated and
the hardware is ready to start its measurement state machine. When the MeasEngine.Start
method is used, the state automatically moves to the next state, "Ready for Arm" state and
waits until the arming condition is met. The next state is a "Ready for Trigger" state. A
block of data is collected and uploaded to the host data buffer when the trigger condition is
met.

Arm (ArmMode) mode specifies the average or group of data collection starting condition.
The default mode is "Auto".

Trigger (TriggerMode) mode specifies the data acquisition starting condition. The default
mode is "Auto".

Recovering from Software Failure


Occasionally during development the software can crash due to improper use of the API.
Though the programming interface may terminate, other LDS-Dactron processes may not
and must be manually terminated before proceeding. Failure to terminate running process
will result in multiple instances of processes, which will lead to unstable performance.

To terminate running processes open the Windows Task Manager and select the following
items from the Image Name list, then click on End Process. Verify that all instances have
been terminated before proceeding. The following processes may need to be terminated:

VPUSER~1.EXE

PHOTON~1.EXE

VpuMgr.exe

25
MeasEngine Object

6 MeasEngine Object
The MeasEngine object includes methods, properties and events. Each is described in
detail below.

MeasEngine methods

MeasEngine object provides the following methods:


Open Make connection to the hardware
Close Terminate hardware connection
Start Start measurement
Stop Stop measurement
Arm Arm measurement
Trigger Trigger measurement
Abort Abort measurement
Initialize Initialize measurement for immediate start
ReadDone Finish reading a data scan
SaveSetup(<file>) Save current setup to a file
LoadSetup(<file>) Load setup from a file

MeasEngine.Open
Open sets most hardware and measurement parameters to their default states.

When you want to release the opened hardware so it can be used by another engine, call
MeasEngine.Close.

MeasEngine.Close
MeasEngine.Close disconnects a measurement engine from its hardware set.

MeasEngine.Close disconnects the measurement engine from its hardware set. You can
reconnect to hardware using MeasEngine.Open.

26
MeasEngine Object

MeasEngine.Start
MeasEngine.Start starts a measurement.

MeasEngine.Start advances the measurement state machine from its “Ready for Start”
state to it “Ready for Arm” state.

MeasEngine.Initialize
MeasEngine.Initialize is automatically called by the engine before it calls
MeasEngine.Start if you have changed any measurement parameters. Since
MeasEngine.Initialize creates a new data buffer, any data in the current data buffer will be
lost.

An error is returned if the measurement is not in either the “Ready for Init” or “Ready for
Start” state when MeasEngine.Start is called. Call MeasEngine.Abort to return the
measurement to its “Ready for Init” state. Call MeasEngine.Stop to return the
measurement to its “Ready for Start” state.

See MeasEngine.State for more information about the measurement state machine.

MeasEngine.Stop
MeasEngine.Stop stops a running measurement after it completes the current scan.

MeasEngine.Stop causes the measurement to stop collecting data and return to the “Ready
for Start” state after it has finished the current scan.

MeasEngine.Stop returns control to your program as soon as the input hardware has been
notified to stop collecting data.

If you want to know when the measurement has finished, use any of the following methods:

Use MeasEngine.State to look for the “Ready for Init” or “Ready for Start” string.

Use MeasEngine.MeasState to look for either the “Ready for Init” or “Ready for Start”
state number.

If throughput function is enabled, recorded data will be saved after measurement is stopped.

MeasEngine.Arm
MeasEngine.Arm arms all active channels if they are waiting to be armed.

27
MeasEngine Object

MeasEngine.Arm manually arms a measurement by advancing it from the “Ready for


Arm” state to the “Ready for Trigger” state.

Two conditions must be met before you can use MeasEngine.Arm:

The arm mode must be set to manual arming.

The measurement must be in the “Ready for Arm” state.

To set the arming mode, use MeasEngine.ArmMode.

To determine the measurement state, use MeasEngine.MeasState.

MeasEngine.Trigger
MeasEngine.Trigger triggers active channels if they are waiting to be triggered.

MeasEngine.Trigger manually triggers a measurement. It does this by moving the


measurement from the “Ready for Trigger” state to the Measure state.

Two conditions must be met before you can use MeasEngine.Trigger:

The trigger mode must be set to manual triggering.

The measurement must be in the “Ready for Trigger” state.

If these conditions are not met when you call the function, it returns an error code.

To set the trigger mode, use ArmTrigger.TriggerMode.

To determine the measurement state, use MeasEngine.MeasState.

MeasEngine.Abort
MeasEngine.Abort immediately stops a running measurement.

MeasEngine.Abort immediately stops a running measurement, making no attempt to


preserve data, and returns to the “Ready for Init” state.

You can call MeasEngine.Abort at any time during a measurement. When you do, the
input hardware FIFOs are cleared without transferring any data to the data buffer. Since the
measurement returns to the “Ready for Init” state, the data buffer will be clear the next
time you start a measurement.

28
MeasEngine Object

If throughput function is enabled, recorded data will be discarded after measurement is


stopped.

MeasEngine.ReadDone
MeasEngine.ReadDone will update the data from the DSP.

MeasEngine.SaveSetup(file)
MeasEngine.SaveSetup saves current setup information to a file.

MeasEngine.SaveSetup saves a current setup information into a binary file. You can load
this setup file later to recover the measurement configuration.

MeasEngine.LoadSetup(file)
MeasEngine.LoadSetup loads a file to recover previously saved setups.

MeasEngine.LoadSetup loads a setup file into the MeasEngine object. You can load setup
files created with MeasEngine.SaveSetup.

MeasEngine properties

MeasEngine object provides the following properties:

NumberOfInputs Number of ADC input channels


NumberOfSources Number of DAC output channels, Not supported. The hardware has
always one source channel
Error The last error
MeasState Measurement state
State Measurement state string
DataAvailable New data available
XData(<ch>) Array of x-axis data
YData(<ch>) Measurement data samples
YReal(<ch>) Real part of measurement data samples

29
MeasEngine Object

YImag(<ch>) Imaginary part of measurement data samples


MeasSetup MeasSetup object
ArmTrigger ArmTrigger object
Average Average object
Input Input object
Source Source object
Thruput Thruput object
Hardware Hardware object
ErrorString Provide more detail error information.
SystemReady Hardware initialization is finished
Log Log information about measurement
DataType Type of measurement data
Version Version of ActiveX API
LibraryVersion Library version of ActiveX API

MeasEngine.NumberOfInputs
MeasEngine.NumberOfInputs is the number of input channels found by
MeasEngine.Open.

You can use Input.Enable to enable or disable any of the input channels.

MeasEngine.NumberOfSources
The source channel number is always one.

MeasEngine.NumberOfSources is the number of source channels found by


MeasEngine.Open.

You can use Source.Enable to activate or deactivate any of the opened channels.

Note that source can be started or stopped independently.

MeasEngine.Error
MeasEngine.Error is the last error number.

30
MeasEngine Object

MeasEngine.Error is an integer number that indicates the last error that occurred. When an
error occurred, MeasEngin generates an error event. The application can trap this error
event. At the same time, the application can query the error number using
MeasEngine.Error, and take proper action. The error numbers are listed as bellow.

-1 No error
0 Unexpected internal error
3 Generic I/O error
4 Invalid hardware detected
5 Fail to connect to hardware
6 File I/O error

MeasEngine.MeasState
MeasEngine.MeasState indicates the current measurement state.

MeasEngine.MeasState indicates the current state of the measurement's state machine as an


integer value. MeasEngine.MeasState can have one of the following values:

E_READY_FOR_INIT_STATE (0) indicates that the measurement is in the “Ready for


Init” state. There is no measurement in progress. When you call MeasEngine.Inititialize
or MeasEngine.Start a Data Buffer will be created and initialized.

E_READY_FOR_START_STATE (1) indicates that the measurement is in the “Ready to


Start” state. There is no measurement in progress, but there is a Data Buffer. The
measurement is ready to be started with MeasEngine.Start.

E_SETTLING_STATE (2) indicates that the measurement is in the Settling state. All active
channels are synchronizing to the system sample clock and collecting data to settle their
digital filters.

E_READY_FOR_ARM_STATE (4) indicates that the measurement is in the “Ready for


Arm” state. All active channels are ready to respond to arming conditions or to be manually
armed with MeasEngine.Arm. You can only call Arm when the measurement is in the
“Ready for Arm” state. A measurement passes immediately through this state if you have
enabled automatic arming using ArmTrigger.ArmMode.

E_ACQUIRING_PRE_TRIGGER_STATE (5) indicates that the measurement is in the


Acquiring Pre Trigger state. All active channels are collecting pre-trigger data. A
measurement passes immediately through this state unless you have selected Input or
Manual triggering using ArmTrigger.TriggerMode and you have specified a pre-trigger
delay using ArmTriger.TriggerDelay.

31
MeasEngine Object

E_READY_FOR_TRIGGER_STATE (6) indicates that the measurement is in the “Ready


for Trigger” state. All active channels are ready to respond to triggering conditions or to be
manually triggered with Trigger. Trigger events are ignored unless a measurement is in this
state. Choose the trigger mode using ArmTrigger.TriggerMode.

E_PROCESSING_DATA_STATE (7) indicates that the measurement is in the Processing


Data state. All enabled channels are collecting data. When the input hardware has collected
a complete scan the MeasEngine can transfer the scan to the Data Buffer and continue the
measurement. Check MeasEngine.DataAvailable to determine whether the Data Buffer
has data waiting to be read.

E_TRANSITION_STATE (8) is an internal state that is used by the MeasEngine. No


methods should be called when system is in this state.

The numeric value assigned to each state also indicates the order in which the measurement
passed through its states. However, some states may be repeated or bypassed, depending on
the type of measurement:

For measurements made in “Block” or “Overlapped Block” mode, you start a


measurement by calling MeasEngine.Start. It passes through the Settling state only once,
but passes through the remaining states multiple times; once for each block of data.

For measurements made in “Continuous” mode, with or without a throughput file open,
you start the measurement by calling MeasEngine.Start. It passes through each state only
once.

MeasEngine.State
MeasEngine.State indicates the current measurement state in text.

MeasEngine.State is the same as MeasEngine.MeasState , but indicates the current state


of the measurement's state machine as a text string instead of an integer.

MeasEngine.DataAvailable
MeasEngine.DataAvailable indicates whether there is any unread scan in host Data
Buffer.

TRUE: Unread data available in Data Buffer.

FALSE: No new data available in Data Buffer.

32
MeasEngine Object

MeasEngine.xData(channel)
MeasEngine.xData is an x-axis information of the measurement result.

MeasEngine.xData returns an array of floating numbers that represents the x-axis


information of each data points. For example, this returns an array of time values when
MeasEngine. DataType is “Time”. Usually, MeasEngine.xData are the same for all
channels and does not change during the measurement. The user can save time by reading
MeasEngine.xData only once during a measurement.

MeasEngine.yData(channel)
MeasEngine.yData is the measurement result.

MeasEngine.yData returns an array of floating numbers that is the measurement data


results specified by MeasEngine. DataType at the specified input channel. The user can
set the channel parameter to zero to get all enabled channel data into a two dimensional
array.

When the data is complex, real and imaginary parts are interleaved as

Real(1), imag(1), real(2), imag(2), …., real(N), imag(N)

To get real and imaginary part in separate arrays, the user may want to use
MeasEngine.yReal or MeasEngine.yImag properties.

MeasEngine.yData reads data from the host Data Buffer. The user must check for the
data availability by MeasEngine.DataAvailable before reading data.

MeasEngine.yReal(channel)
MeasEngine.yReal is the real part of measurement result.

MeasEngine.yReal returns an array of floating numbers that is the real part of measurement
data results specified by MeasEngine. DataType at the specified input channel. The user
can set the channel parameter to zero to get all enabled channel data into a two dimensional
array.

MeasEngine.yReal reads data from the host Data Buffer. The user must check for the data
availability by MeasEngine.DataAvailable before reading data.

When the measurement result does not have imaginary part, MeasEngine.yReal and
MeasEngine.yData returns the same result.

33
MeasEngine Object

MeasEngine.yImag(channel)
MeasEngine.yImag is the imaginary part of measurement result.

MeasEngine.yImag returns an array of floating numbers that is the imaginary part of


measurement data results specified by MeasEngine. DataType at the specified input
channel. The user can set the channel parameter to zero to get all enabled channel data into
a two dimensional array.

MeasEngine.yImag reads data from the host Data Buffer. The user must check for the
data availability by MeasEngine.DataAvailable before reading data.

MeasEngine.MeasSetup
MeasEngine.MeasSetup returns are reference to a MeasSetup object.

MeasSetup specifies the basic measurement setup parameters such as measurement span
and blocksize.

MeasEngine.ArmTrigger
MeasEngine.ArmTrigger returns are reference to an ArmTrigger object.

ArmTrigger specifies the arming and triggering condition parameters.

MeasEngine.Average
MeasEngine.Average returns are reference to an Average object.

Average specifies averaging setup parameters such as average type and numbers.

MeasEngine.Input
MeasEngine.Input returns a reference to an Input object.

Input object specifies the input channel setup parameters and control.

MeasEngine.Source
MeasEngine.Source returns a reference to a Source object.

Source object specifies the source channel setup parameters and control.

34
MeasEngine Object

MeasEngine.Thruput
MeasEngine.Thruput is a reference to the Thruput object.

MeasEngine.Hardware
Hardware object provide the information of underlying hardware.

MeasEngine.HardwareCommand
This property is set to TRUE when the hardware button is pressed. After a user
read this property, it is reset to FALSE.

MeasEngine.ErrorString
MeasEngine.ErrorString is a string which describes the last error. It provides more detail
error information than MeasEngine.Error.

MeasEngine.SystemReady
MeasEngine.SystemReady indicates whether the hardware initialization is finished.

MeasEngine.Log
MeasEngine.Log provide the log information about measurement.

MeasEngine.DataType
MeasEngine.DataType specifies the data type when you are using some properties, such as
MeasEngine.yData, to get measurement result.

This property must be set before you use the properties, such as MeasEngine.yData,
MeasEngine.yImag and MeasEngine.Real,.

The API supports the following data type:

Time Time domain data.


FFT Linear spectrum data.
APSD Power spectrum density.
APS Power spectrum.

35
MeasEngine Object

MeasEngine.Version
MeasEngine.Version specify the version of ActiveX API.

MeasEngine.LibraryVersion
MeasEngine.LibraryVersion specify the library version of ActiveX API.

Library version is used to save or load a setup files by using methods,


MeasEngine.SaveSetup or MeasEngine.LoadSetup. The ActiveX API can only load or
save a setup file, of which library version is less than or equal to the ActiveX API.

MeasEngine.Address
MeasEngine.Address specify the IP address of Hardware. IP address can specify a remote
computer other than the one running the client user interface program (i.e., the program user
wrote). In this case the ActiveX service program must be installed to the remote computer;
the hardware unit must be connected to the remote computer.

This property is only available when Net-Remote option is turned on.

MeasEngine events

MeasEngine object provides the following events:

DataAvailable New measurement data is available to read


MeasEnded Measurement has ended
Error An error occurred.
SystemReady The Hardware initialization is finished.
HardwareCommand Start/Stop button is pressed.(on Photon only)
RecordDone Throughput data has been recorded and saved to specified files

DataAvailable event
MeasEngine fires this event when new data is available in DataBuffer to read.

36
MeasEngine Object

MeasEnded event
MeasEngine fires this event when the running measurement ended. Measurement can end
by one of the following reasons.

The measurement has been stopped or aborted by the user.

Throughput recording has finished for the specified recording time length recording time
length.

The measurement has stopped because of some unexpected error.

Error event
MeasEngine fires this event when an error occurred.

SystemReady event
MeasEngine fires this event when the hardware initialization is finished.

HardwareCommand event
This event will be fired when a user presses the hardware button on Photon.

RecordDone event
This event will be fired when throughput function has finished recording data and saved all
data to specified files.

37
MeasSetup Object

7 MeasSetup Object
MeasSetup properties

MeasSetup object provides the following properties:

Span Measurement span in Hz


SamplingFreq Hardware sampling frequency in Hz
BlockSize Measurement blocksize
Window Window function used in frequency measurement
Overlap Rate of data overlap in overlapped block data mode
CenterFreq Zoom measurement center frequency in Hz

MeasSetup.Span, MeasSetup.Spans
MeasSetup.Span specifies the measurement bandwidth. Spans provides the available span
values.

MeasSetup.Span specifies the measurement bandwidth. For an input channel, the span
specifies the maximum frequency at which valid alias-protected data will be received
(frequencies above that are filtered out).

The valid values of span are always equals to the data sampling rate times (1/2.56). This
formula is inherited from the historical spectral line calculations that for each 1024 points
FFT, the user can get 400 useful lines. However, due to the usage of recent digital filtering
techniques, the useful lines can be as much as 450 for the same 1024 real data transform.
This provides higher actual usable frequency span.

Below is a list of sampling frequencies, nominal spans (user assigned value) and the actual
frequency span user can get from the analysis:

Nominal Span Sampling Actual Usable Span


(user assigned Frequency ( = Fs * (450/1024))
value)
37.5 kHz 96kHz 42kHz
32 kHz 81.92kHz 36kHz
18.75 kHz 48 kHz 21 kHz

38
MeasSetup Object

16 kHz 40.98 kHz 18 kHz


9.5 kHz 23.9 kHz 10.5 kHz…

If the span is changed while a measurement is running, the module will flush any data from
before the span change. All data read from the module after the span change will be data at
the new span.

MeasSetup.SamplingFreq, MeasSetup. SamplingFreqs


MeasSetup.SamplingFreq specifies the hardware sampling frequency in a measurement.
SamplingFreqs provides the available sampling frequency values.

Changing the setting of MeasSetup.SamplingFreq will also change MeasSetup.Span, and


vice versa

MeasSetup.BlockSize, BlockSizeRange
MeasSetup.BlockSize specifies the measurement blocksize. BlockSizeRange provides the
available block size values.

MeasSetup.BlockSize is the number of data samples produced, for each active channel,
each time there is a trigger.

MeasSetup.BlockSize selects the number of sample points in a block. The minimum legal
value is 1; the maximum depends on how much RAM is available, how many channels are
active in a module. If the block size is more than 8192 points, the system will change to
Memory Throughput mode and the data will be buffered on the PC memory instead of the
DSP memory. In this mode the average function (Average object) and throughput function
(Thruput Object) are not available. Trigger function is available in Memory Throughput
mode.

When the module is doing FFTs, the following restrictions on blocksize hold:

Minimum: 64

Maximum block size in DSP memory mode: 8192

Maximum block size in Memory Throughput mode: 262,144, this feature is only
available on Photon at the time when this Manual is made

The default value of measurement blocksize is set to 1024.

39
MeasSetup Object

The block size is generally governed by the other two factors: total enabled channel number
and available memory space. It is preferred to enable the channels first, then set the block
size based on its candidates.

MeasSetup.Window, Windows
MeasSetup.Window defines the windowing function used in computing the FFT. The
available functions are listed below. Windows provides the available windows.

Bartlett
Hamming
Welch
Tukey
Blackman (Common)
Blackman’s 4th Min. Side Lob
Blackman’s 4th Max. Decay
Kaiser-Bessel
Force/Exponential

By default, MeasSetup.Window is set to “Hanning”.

MeasSetup.Overlap, OverlapRange
MeasSetup.Overlap specifies the amount of overlap in “Overlapped block” data mode.
OverlapRange provides the available overlap values.

MeasSetup.Overlap selects the ratio of blocksize that can overlap between one block and
the next. The value may be positive or negative. A negative value for the overlap means
that there is a separation between successive blocks.

By default, MeasSetup.Overlap is set to 0.

MeasSetup.CenterFreq, CenterFreqRange
MeasSetup.CenterFreq specifies the center frequency for "zooming". CenterFreqRange
provide the range of center frequency. (CenterFreq and CenterFreqRange are only
available on Photon or Focus platform.)

If MeasSetup.CenterFreqRange returns {0, 0}, zoom is not available for current


MeasSetup.Span setting.

40
MeasSetup Object

If MeasSetup.CenterFreq is set to 0, zoom is disabled.


By default, MeasSetup.CenterFreq is set to 0.

41
ArmTrigger Object

8 ArmTrigger Object
ArmTrigger properties

ArmTrigger object provides the following properties:

ArmMode Measurement arm mode.


TriggerMode Measurement Trigger mode.
TriggerChannel Channel used for trigger
TriggerDelay Pre/post trigger delay in seconds
TriggerLevel Trigger threshold level in volts
TriggerSlope Trigger detection slope, positive or negative

ArmTrigger.ArmMode, ArmModes
ArmTrigger.ArmMode specifies the event that will arm a measurement. To acquire and
process a block of data, the measurement must be first armed and then triggered.
ArmModes provides the available arm modes.

The mode can have the following values:

The “Auto” specifies Automatic arming. The measurement is armed automatically when it
enters the “Ready For Arm” state. This is a default mode.
In "Free Run" mode, the measurement only needs to be armed once. When measurement is started,
the system first enter the "Ready for Arm" state and will be automatically armed to enter the "Ready
for Trigger" state. After the system is triggered (if trigger is not enabled), the system will begin to
process data and stay in the "Processing Data" state until measurement is stopped.

In “Manual” mode, the measurement needs to be armed manually every frame. After one
frame of data is processed. The system will enter the "Ready for Arm" state and wait for
arm. A call to method MeasEngine.Arm will make the system enter the "Ready for
Trigger" state. After the system is triggered (if trigger is not enabled), the system will begin
to process the next frame of data.

A measurement can be armed only when it is in the “Ready For Arm” state. If arming
conditions are met at any other time, the measurement is not armed. After arming, the
measurement advances to the “Ready For Trigger” state. See MeasEngine.MeasState for
more information about the measurement state machine.

42
ArmTrigger Object

ArmTrigger.TriggerMode, TriggerModes
ArmTrigger.TriggerMode specifies the event that will trigger a measurement.
TriggerModes gives the available trigger modes.

The “Auto” specifies automatic triggering. The measurement is triggered automatically


when it enters the “Ready For Trigger” state.

The “Input Level” specifies input level triggering The measurement is triggered when an
input signal in trigger channel crosses its channel's hysteresis limit and trigger level in the
specified direction. The trigger channel must have been enabled to trigger a measurement
using Input.Enable. Use ArmTriger.TriggerLevel, and ArmTriger.TriggerSlope to
specify trigger conditions.

Only 1 channel could be specified as trigger channel.

The “Source” specifies Source triggering. The measurement is triggered when a source
starts a new burst cycle.

The “TimeDelay” specifies time delay triggering. The measurement is triggered after
ArmTrigger.TriggerDelay time.

A measurement can be triggered only when it is in the “Ready For Trigger” state. If trigger
conditions are met at any other time, the measurement is not triggered. After triggering, the
measurement advances to the Processing Data state. See MeasEngine.MeasState for more
information about the measurement state machine.

ArmTrigger.TriggeChannel
ArmTrigger.TriggerChannel specifies the channel used for trigger.

It is only take effect when the trigger mode (ArmTrigger.TriggerMode) is set to "Input
Level".

ArmTrigger.TriggerDelay, TriggerDelayRange
ArmTrigger.TriggerDelay specifies the trigger delay for all input channels.
TriggerDelayRange provides the available trigger delay values.

ArmTrigger.TriggerDelay is the elapsed time, in seconds, between the occurrence of a


trigger and the beginning of the data acquisition. A negative delay indicates a pre-trigger
condition, where samples prior to the trigger event are included in the first measurement
block. The minimum and maximum values for this parameter vary depending on the
amount of RAM and the number of active channels in the hardware modules.

43
ArmTrigger Object

The default value of delay is set to 0.

ArmTrigger.TriggerLevel, TriggerLevelRange
ArmTrigger.TriggerLevel sets the trigger level in volts for all input channels.
TriggerLevelRange provides the available levels.

ArmTrigger.TriggerLevel is the value of the trigger level in volts. Its value should be
within the current input range.

If the trigger mode (ArmTrigger.TriggerMode) is set to "Input Level" and the trigger
slope is positive, then the module triggers when the signal crosses both the level in the
positive direction. If the trigger slope is negative, the module triggers when the signal
crosses the level in negative direction.

ArmTrigger.TriggerSlope, TriggerSlopes
ArmTrigger.TriggerSlope specifies the slope of input triggering for all input channels.
TriggerSlopes provides the available trigger slopes that are available.

ArmTrigger.TriggerSlope selects the edge of the trigger source (i.e. the direction) on
which the trigger occurs. “Positive” sets it to a positive going crossing of the level.
“Negative” sets it to a negative going crossing of the level. If the trigger mode
(ArmTrigger.TriggerMode) is other than “Input Level”, ArmTrigger.TriggerSlope property
has no effect to the triggering condition.

44
Average Object

9 Average Object
Average properties

Average object provides the following properties:

Type Type of average


Number Number of averages

Average.Type, Types
Average.Type specifies the averaging method. Types provides the averaging types that are
available.

Average.Type specifies the data averaging mode. Averaging allows the data from multiple
frames to be averaged together before being uploaded to the host Data Buffer. This method
both reduces noise on the data and reduces the amount of data uploaded to the host. The
number of averages is set with the Average.Number property.

The “No” turns off averaging.

The “Linear” selects a mode where the real and complex components of the frequency data
are averaged separately for the number of times specified by Average.Number.

The “Exponential” selects an exponential averaging mode where a weighted sum of the
squares of the real and complex components of the frequency data. The weighting factor is
set by the Average.Number property. The algorithm for this weighted average is:

result = new point for n = 1 (first point)

result(n) = (((weight - 1.0) * result(n-1)) + new point) / weight for n = 2 --> N

where n = point number in the average and N = total number in the average.

The “Peak” selects a mode where the maximum values of the sum of the squares of the real
and complex components of the frequency data is saved over the number of times specified
by Average.Number.

NOTE: The number of the averaged frequency data points for the sum of squares modes are
one half that of the non-averaged and “Linear” modes, since the real and imaginary

45
Average Object

components are combined to form a single magnitude number. Instead of BLOCKSIZE


points, the magnitude squared modes will only have BLOCKSIZE/2 points.

The default Average.Type is set to “No”.

Average.Number, NumberRange
Average.Number specifies the number of averages. NumberRange provides the available
average numbers.

Average.Type sets the data averaging mode. Averaging allows the data from multiple
frames to be averaged together before being uploaded to the host Data Buffer. This method
both reduces noise on the data and reduces the amount of data uploaded to the host. The
number of averages is set with the Average.Number property.

46
Input Object

10 Input Object
Input properties

Input object provides the following properties:

Enable(<ch>) Enable input channel


Range(<ch>) Input ADC range
Coupling(<ch>) Input ADC, DC or AC coupling
RangeStatus(<ch>) Input Overload/Underrange status
EU(<ch>) Engineering Unit
EUScale(<ch>) Conversion ratio between Voltage and EU.

Input.Enable(channel)
Input.Enable enables or disables a single input channel.

Input.Enable can have the following values:

FALSE: A channel is disabled.

TRUE: A channel is enabled.

The time capture and non-cross frequency analysis will be available for those channels that
are enabled. To measure the cross spectra, additional request has to be made by
appropriately assigning the value to MeasEngine.ReqDataType property and
MeasEngine.ReqDataType.

Input.Range(channel), Input.Ranges(channel)
Input.Range specifies an input ADC range. Ranges provides the available ranges.

Input.Range is the full-scale range in volts. Signal inputs whose absolute value is larger
than full scale will generate an ADC overflow error. (Actually, there are several dB of
overhead before the ADC will overflow, to avoid spurious overflow indications.)

47
Input Object

The actual range that is set will be the nearest legal range value that is greater than or equal
to the value specified by the range parameter.

The legal ranges vary depending on the Input.Function. Input.Ranges (channel) returns a
list of legal ranges for the specified channel. When the Input.Function is “Charge”, the
Input.Range property is in pico-Coulombs rather than volts.

Input.Coupling(channel), Couplings(channel)
Input.Coupling specifies input coupling to AC, DC or ICP. Couplings provides the
available coupling types.

Input.Coupling specifies a channel's coupling mode

Use “DC” to connect the input directly to the amplifier.

Use “AC” to insert a series capacitor between the input connector and the amplifier.

Use “ICP” to provide constant current source to an ICP enabled sensor and insert a series
capacitor between the input connector and the amplifier.

Input.RangeStatus(channel)
Input.RangeStatus is a read only property and it returns the range status of a channel's most
recently collected data block.

E_RANGE_NORMAL (0) indicates that at least one point in the most recently collected
data block was within the optimal area of the current range setting, and no points exceeded
the upper limit of this area. The upper limit is 1.25 * range and the lower limit is 0.4 *
range, where range is the value you get with Input.Range.

E_RANGE_OVER (1) indicates that at least one point in the most recently collected data
block exceeded the upper limit for the current range setting. The input channel was
overloaded when the block was collected. You should usually select the next higher range
setting if you get this value.

Input.EU(channel)
Input.EU specifies the engineering unit of measurement.

Input.EUScale(channel)
Input.EUScale specifies the conversion ratio between Voltage and EU. The ratio is in
“Volt/EU”.

48
Source Object

11 Source Object
Source methods

Source object provides the following methods:

Start Start sources of uncoupled control


Stop Stop sources of uncoupled control

Source.Start
Source.Start starts independently controlled source channel.

Source.Stop
Source.Stop stops independently controlled source channel.

Source.Stop stops source channels that are independently controlled from input channels.
Source channels of E1434A module can be controlled independently from input channels by
setting the property Source.ControlCoupling to FALSE. Otherwise the source channels
stop at the same time as the input channels. The default value of Source.ControlCoupling
is TRUE.

Source properties

Source object provides the following properties:

Enable(<ch>) Enable source channel


Name(<ch>) Source DAC channel name. Not supported
Type(<ch>) Source signal type
Amplitude(<ch>) Output signal amplitude in Volts
SineFreq(<ch>) Sine output frequency in Hz

BurstDutyCycle(<ch>) Burst output duty cycle


ControlCoupling(<ch>) Couple source control with the measurement
ArbBufferSize(<ch>) Size of arbitrary output buffer
ArbData(<ch>) Load arbitrary waveform data

49
Source Object

State State of uncoupled control sources

Source.Enable(channel)
Source.Enable enables or disables a source channel.

If a source channel is disabled then the channel will not produce an output signal.

Changing a source channel from disabled to enabled will not start a source, only
measurement Start or Source.Start does that. However, changing a source channel from
enabled to disabled stops the source immediately.

Source.Name(channel)
Source.Name specifies a source channel's name.

The name contains the character string used to name the channel. The default name is set to
blank.

Source.Type(channel), Source.Types(channel)
Source.Type specifies the source signal type. SourceTypes provides the types of outputs
that are available.

The current signal source types available to ActiveX API are:


Sine
Random
Burst Random
Periodic Arbitrary
DC
Square
Triangle
Pseudo Random
Impulse Chain
Arbitrary

There is no "Off" source type. To turn a source channel off, make it disabled using
Source.Enable

The default value of Source.Type is set to “Sine”.

50
Source Object

Source.Amplitude(channel), AmplitudeRange(channel)
Source.Amplitude specifies the maximum signal amplitude (in volts) of a single source
channel. AmplitudeRange provides the maximum and minimum amplitudes that are
available.

The default value of Source.Amplitude is set to 1 volt.

Source.SineFreq(channel), SineFreqRange(channel)
Source.SineFreq specifies the source sine frequency of a single source channel.
SineFreqRange provides the upper and lower frequencies that are available.

When the Source.Type is “Sine”, this is the frequency that is generated.

Source.SineFreq is the sine frequency in Hertz.

The default value of Source.SineFreq is set to 1 kHz.

Source.BurstDutyCycle(channel),
BurstDutyCycleRange(channel)
Source.BurstDutyCycle specifies the burst duty cycle for a source channel.
BurstDutyCycleRange provides the upper and lower values that are available.

Source.BurstDutyCycle specifies the burst duty cycle for a source channel. This duty cycle
is used only when the Source.Type is a burst mode, such “Bust Random”.

Source.BurstDutyCycle specifies the duty cycle for a burst. The duty cycle is a fraction
that must be between zero and one. The total burst period is equal to the current blocksize;
the duty cycle specifies the fraction of that burst that the source is on. If the source ramp
time is non--zero, the source will ramp up and down within the duty--cycle portion of the
burst period.

Source.ControlCoupling(channel)
Source. ControlCoupling specifies whether the source starts its signal output coupled with
the measurement start.

TRUE: Signal output starts when the measurement is started by MeasEngine.Start and
triggered.

FALSE: Signal output starts when the Source.Start is called and it is triggered.

51
Source Object

The default value of Source.ControlCoupling is set to TRUE.

Source.Span(channel), Spans(channel)

The hardware sets the span to 11kHz if the input span is equal or less than 11kHz, and
22kHz if the input span is 11kHz or 22kHz.

Source.ArbBufferSize(channel),
ArbBufferSizeRange(channel)
Source.ArbBufferSize specifies the size of arbitrary data buffer. ArbBufferSizeRange
gives the minimum and maximum buffer size.

Source.ArbBufferSize specifies the number of points contained in a source's arbitrary data


buffer. It specifies the number of data points that can be loaded into the source's arbitrary
data buffer by Source.ArbData . Any integer value in the range 1 though 4,096 is valid.

If the Periodic Arbitrary or Burst Arbitrary source mode is selected, data in the buffer is re-
circulated. When the source outputs the buffer's last data point, it automatically starts over
at the beginning of the buffer. If you want the same signal to be repeated for each block of
data, set size equal to the value you specified with MeasSetup.BlockSize .

The Arbitrary data buffer will also be used to pass shaped random spectrum when
SourceType is selected as “ShapeRandom”.

Source.ArbData(channel)
Source.ArbData loads an arbitrary waveform.

Source.ArbData loads an arbitrary waveform into a source channel from an array. Before
setting Source.ArbData you must first set the source channel's type, Source.Type to
“Periodic Arb”.

The array must contain a block of time-domain data points with values between -1 and 1.
During source output, each value is multiplied by the source amplitude setting. If there are
more points in the array than there are in the arbitrary data buffer, excess points at the end of
array are not loaded. If there are more points in the buffer than there are in array, excess
points at the end of the buffer are filled with zeros. You specify the buffer size with
Source.ArbBufferSize . The time interval (delta T) between points changes with the
source span setting:

delta T = 1 / (2.56 * span), where span is the value returned with Source.Span

52
Source Object

Source.State(channel)
Source.State indicates the current state of the independently controlled source channel.

Source.State can take one of following three values,

The “Source idle” indicates that the source channel has not started.

The “Source ready for trigger” indicates that the source channel is waiting for the
trigger. If the Source.TriggerMode is “Manual” ,it can be triggered using the
Source.Trigger method.

The “Source running” indicates that source has been triggered and outputting signal.

53
Hardware Object

12 Thruput Object
Thruput Properties

Thruput object is only available on LDS-Dactron Photon and Focus platform.

Thruput object provides the following properties:


FileFolder Folder used to save Throughput files.
RecordTime Throughput recording time length in seconds
FileFormat Format of saved throughput files.
Enable Enable throughput function
State State of throughput function.

Thruput.Enable
Thruput.Enable enable throughput function.

When Thruput.enable is TRUE. The system will begin to record data after measurement is
started.

The default value is FALSE.

Thruput.FileFolder
Thruput.Folder specify the folder which will be used to save throughput data.

Thruput.FileFormat
Thruput.FileFormat specify the format of throughput files.

Thruput.FileFormat could be selected from the following values:


"LDS-Dactron Binary",
"Tab Delimited : X-Y Pair”,
"Tab Delimited : Y only”,
"UFF Text format”,
"UFF Binary format,

54
Hardware Object

"WAVE Audio file,


"Agilent SDF file”.

Thruput.FileFormat also assigns different extension names for throughput files.

LDS-Dactron Binary *.sig


Tab Delimited : X-Y Pair *.txt
Tab Delimited : Y only *.txt
UFF Text format *.uff
UFF Binary format *.buff
WAVE Audio file *.wav
Agilent SDF file *.sdf

Thruput.RecordTime
Thruput.RecordTime specifies the length of throughput recording in seconds.

Thruput.RecordTime specifies the desired duration of your recording (in seconds). If the
value you specify is not an integral multiple of the time-record length, it is quantized to the
next larger multiple. Two other parameters also affect the length of time you can record. If
the time you specify in Thruput.RecordTime cannot be realized with the current setup, you
will need to modify one of these parameters:

The number of enabled channels - You can increase recording time by decreasing the
number of enabled channels. Use Input.Enable to modify the number of active channels.

The sampling frequency of your measurement - You can increase recording time by
decreasing the span, and hence the sampling frequency. Use MeasSetup.Span to modify
the span.

The data transfer rates of the measurement hardware limit the number of active channels you
can record during a particular throughput session.

Thruput.State
Thruput.State indicates the current throughput state in text.

There are three available states: “Idle”, “Recording data” and “Saving Data”.

55
Hardware Object

13 Hardware Object
Hardware Properties

The hardware object provides the following properties:

HardwareType The underlying hardware that the software is running on


HardwareVersion Version of hardware
SerialNumber Serial Number of hardware

Hardware.HardwareType
Hardware.HardwareType provides the information about the current underlying hardware.

Hardware.HardwareVersion
Hardware.HardwareVersion provide the information about the hardware version.

Hardware.SerialNumber
Hardware.SerialNumber provide the information about the hardware serial number.

56

Das könnte Ihnen auch gefallen