Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
LMS Test.Lab
Rev 13A
Rev 13A 3
Section 3.7.3 How to change the run name and to be informed if it is changed ...... 37
Section 3.7.4 How to define the Channel Setup parameters .................................... 38
Section 3.8 Using the module loader .................................................................... 38
Section 3.8.1 How to load a module (in VB6.0) ...................................................... 38
Section 3.8.2 How to load a module (in VB.NET) .................................................. 40
Section 3.8.3 How to access the PictureManager of a Module Loader ................... 43
Section 3.8.4 How to access data via a Module Loader .......................................... 44
Section 3.9 General guidelines ............................................................................. 44
Section 3.9.1 How to access the Test.Lab Type library in VB ................................ 44
Section 3.9.2 How to access the Test.Lab Type library in VB.NET ....................... 45
Section 3.9.3 How to use data watches .................................................................... 46
Section 3.9.4 How to make your own add-in in VB.6.0 .......................................... 48
Section 3.9.5 How to make your own add-in in VB.NET ....................................... 50
Section 3.9.6 How to deal with Test.Lab objects..................................................... 52
Section 3.9.7 How to read/write an enumeration value ........................................... 53
Section 3.9.8 How to specify a path ........................................................................ 54
Rev 13A 5
Section 5.30.2 Definition ......................................................................................... 153
Section 5.30.3 Methods ........................................................................................... 154
Section 5.30.4 Properties ......................................................................................... 156
Section 5.31 InProcApplication ............................................................................ 157
Section 5.32 InputBasket ...................................................................................... 158
Section 5.32.1 Contents ........................................................................................... 158
Section 5.32.2 Methods ........................................................................................... 158
Section 5.32.3 Properties ......................................................................................... 159
Section 5.33 IPicture............................................................................................. 159
Section 5.34 IPictureManager............................................................................... 159
Section 5.35 IPrintManager .................................................................................. 159
Section 5.36 IQuantity .......................................................................................... 159
Section 5.37 IRatioCursor .................................................................................... 160
Section 5.38 IScalar .............................................................................................. 160
Section 5.39 ISheet ............................................................................................... 160
Section 5.40 ISheets.............................................................................................. 160
Section 5.41 ISingleCursor ................................................................................... 160
Section 5.42 IUnitSystem ..................................................................................... 160
Section 5.42.1 Contents ........................................................................................... 161
Section 5.42.2 Definition ......................................................................................... 161
Section 5.42.3 Methods ........................................................................................... 162
Section 5.42.4 Properties ......................................................................................... 164
Section 5.43 LMS Unit System ............................................................................ 164
Section 5.44 IWatch.............................................................................................. 165
Section 5.45 IWaterfall (not yet implemented) ..................................................... 165
Section 5.45.1 Content ............................................................................................. 166
Section 5.45.2 Methods ........................................................................................... 166
Section 5.45.3 Properties ......................................................................................... 167
Section 5.46 SearchBasket.................................................................................... 169
Section 5.47 SearchEngine ................................................................................... 169
Section 5.47.1 Contents ........................................................................................... 170
Section 5.47.2 Definition ......................................................................................... 170
Section 5.47.3 Methods ........................................................................................... 171
Section 5.47.4 Properties ......................................................................................... 171
Section 5.48 StartPointFactory ............................................................................. 172
Section 5.48.1 Content ............................................................................................. 173
Section 5.48.2 Definition ......................................................................................... 173
Section 5.48.3 Properties ......................................................................................... 174
Section 5.49 Workspace ....................................................................................... 174
Section 5.49.1 Contect ............................................................................................. 175
Section 5.49.2 Methods ........................................................................................... 175
Section 5.49.3 Properties ......................................................................................... 177
In This Chapter
Revision news.....................................................................7
Rev 13A 7
Chapter 1 What's New
Rev 13A 9
Chapter 1 What's New
Rev 13A 11
Chapter 1 What's New
In This Chapter
How to use this help ...........................................................13
Tutorial 1 ............................................................................14
Tutorial 2 ............................................................................15
This help is written for Visual Basic 6.0 users of LMS Test.Lab Automation.
Test.Lab Automation can also be used with as Visual Basic.net. The work
method might be little different in VB.net.
The first part gives you a lot of work methods, without going into depth about
why things are as they are. The background about all this can be found in the
reference guide.
Tutorial In this part (see "Tutorial 1" on page 14), we start directly with
creating a little program that controls a simple signature
measurement, and then display the resulting data. All the steps
for this task are explained one by one.
Reference In this part (see "Reference guide" on page 59), after a short
guide introduction to Automation, the complete object model of
Test.Lab is described in detail. The module loader and
datawatches get special attention.
Rev 13A 13
Chapter 2 Getting started
Display a block in a Test.Lab Picture. Let us create a little program that displays
a (fixed) block in a Test.Lab Picture.
You can find the visual basic code of this example on <the installation
directory>/AutomationHelp/Tutorial/DisplayBlock
Step 1
The first thing you need is an installation of Test.Lab
Automatically, its automation interface is registered and its functionality is
available in the COM layer of MS Windows. This means that the automation
interface is already available when starting programming in Visual Basic.
Step 2
Let us start up Visual Basic, and make that it can access the Test.Lab
Automation objects.
Step 3
After this, you can start writing the code.
Step 4
Connect with the running application.
Dim TL As New LMSTestLabAutomation.Application
Step 5
Get the active project
Dim my_db As LMSTestLabAutomation.IDatabase
my_db = TL.ActiveBook.Database
Step 6
Read in the block from the active project
In this example, we use a fixed path to the block. If it does not exist, an error
message is given.
Dim my_block As LMSTestLabAutomation.IBlock2
my_block = my_db.GetItem("Section1/Run 1/Fixed
sampling/Runup/\Sections/Orders/Order 2.00 Point1")
Step 7
Get the picture manager
Dim datawatch_PictManag As LMSTestLabAutomation.DataWatch
Dim my_PictManager As LMSTestLabAutomation.IPictureManager
datawatch_PictManag =
TL.ActiveBook.FindDataWatch("Navigator_DataViewing_PictureManager")
my_PictManager = datawatch_PictManag.Data
Step 8
Add a Picture to the picture manager
Dim my_picture As LMSTestLabAutomation.IPicture
my_picture = my_PictManager.AddPicture("1x2")
Step 9
Get the first display of this picture:
Dim my_display As LMSTestLabAutomation.IDisplay
my_display = my_picture.Display(0)
Step 10
Add the block to the display
my_display.AddData 0, my_block
Our little program first loads a default project. It contains a very simple setup,
where 1 stationary measurement is done. Within the user interface of our
program, you can start the measurement and stop it. Meanwhile, you are kept
informed about the status (measuring, saving data, etc.) and overload info.
Rev 13A 15
Chapter 2 Getting started
gDataWatch_AcqState =
TL.ActiveBook.FindDataWatch("Measure_Acquisition_State")
Then, a ValueChanged-callback must be installed.
Private Sub gDataWatch_AcqState_ValueChanged.(ByVal newValue as
Variant)
The newvalue is an enum of type:
LmsHq::DataModelI::SMonProcessingAttributes::IEnumRunAcquisitionState.
Since this is an enumerate, we can use this interface to interpret it.
The attribute map of Idata objects contains 1 item "EnumValue", containing the
int-value of the enumeration. You can read this enumeration value.
Dim enum_state As LMSTestLabAutomation.Enumerate
enum_state = newValue
txtRunStatus_Value = enum_state.LocalValue
End Sub
...
Step 7
Implement the overload bar
The datawatch then indicates if there has been an overload or not, is named
"Overload". Its type is:
LmsHq::DataModelI::Base::IBoolean.
This datawatch has to be defined as a global variable:
dim WithEvents gDataWatch_Overload As
LMSTestLabAutomation.DataWatch
Initialising the datawatch is done in the Form_Load:
gDatawatch_Overload = TL.ActiveBook.FindDataWatch("Overload")
Then, a ValueChanged-callback must be installed
Private Sub gDataWatch_overLoad_ValueChanged (ByVal newValue as
Variant)
The newvalue is a BOOLEAN
If NewValue = False Then
txtOverloadInfo_Value = "No Overload"
Else
txtOverloadInfo_Value = "Overload"
End If
End Sub
Step 8
Run the program. You should be able to do start and stop an acquisition with
your little program.
Rev 13A 17
Chapter 3 Using Test.Lab Automation
In This Chapter
Connceting with the application .........................................19
Selecting and saving a block ..............................................20
Reading and changing a block............................................22
Searching ............................................................................27
Block commands ................................................................29
Display and plotting ...........................................................32
Controlling a measurement in Signature ............................36
Using the module loader.....................................................38
General guidelines ..............................................................44
If you want to access any Test.Lab object, you always need a 'start' object. In
this case, this is a reference to the application itself. If a Test.Lab already runs,
you can connect to it. If not, you can start up the application you want to start.
Dim TL As LMSTestLabAutomation.Application
TL = New LMSTestLabAutomation.Application
Step 1
Declarations.
Dim TL As New LMSTestLabAutomation.Application
Step 2
Load the workbook.
Rev 13A 19
Chapter 3 Using Test.Lab Automation
Load the desktop workbook, using the method Init on the application object
TL.Init ("-w DesktopStandard")
OR
Load the signature application.
TL.Init ("-w SignatureAcquisitionFSStandard")
OR
Load the signature application with a specific template and a specific project.
If you create further on a new project, this template will be used.
TL.Init ("-w SignatureAcquisitionFSStandard -t my_template
D:/LmsLocal/data/myproj")
When you have your application object (and your Test.Lab is running), how can
you then select a block? If you know the exact path of a block, you can look for
one specific block in a database. Another possibility is to select a block in the
navigator. Other ways of getting a block are not specified here: with some
Block Commands you can create a block, you can use the search functionality...
. Finally, an example of saving the block in a database is given.
For getting and saving data, some methods on an IDatabase object are used.
Step 1
Declarations.
Dim TL as New LMSTestLabAutomation.Application
Dim my_db As LMSTestLabAutomation.IDatabase
Dim my_block As LMSTestLabAutomation.Iblock2
Step 2
Get a reference to the specified database.
my_db = TL.Database("c:/temp/PrintResults/OrderTracking.lms")
Step 3
Get the specific block.
my_block =
my_db.GetItem("Section1/Run1/Fixedsampling/Runup/Sections/Orders/Order
2.00 Mic1")
Step 1
Declaration
Dim TL As New LMSTestLabAutomation.Application
Dim my_db As LMSTestLabAutomation.IDatabase
Dim datawatch_NavigatorSelection As LMSTestLabAutomation.DataWatch
Dim datawatch_Block As LMSTestLabAutomation.DataWatch
Dim data_BlockPath as LMSTestLabAutomation.IData
Dim data_selection As LMSTestLabAutomation.IData
Dim my_block As LMSTestLabAutomation.IBlock2
Step 2
First thing to do is to create a data watch to the selection in the navigator.
This is a data watch on the Active Book of the application.
datawatch_NavigatorSelection =
TL.ActiveBook.FindDataWatch("Navigator_SelectedOIDs")
Step 3
Get the link to the selected items: read the data on this data watch:
data_selection = datawatch_NavigatorSelection.Data
For vi = 0 To data_selection.AttributeMap.Count - 1 Step 1
Step 4
Get the link to the vith selected item.
data_BlockPath = data_selection.AttributeMap(vi)
Step 5
Get the port to the vith selected item.
datawatch_block = TL.FindDataWatch(data_BlockPath)
Step 6
Test the type of the selected item.
Rev 13A 21
Chapter 3 Using Test.Lab Automation
If datawatch_block.Data.Type =
"LmsHq::DataModelI::Expression::CBufferIBlock" Then
Step 7
The block is found!
my_block = datawatch_block.Data
End If
Next vi
You can save blocks somewhere in a database, on a path you specify yourself.
First verify if this path exists. If not, create it.
If you have a block, how can you interpret and change it? What are its values,
what is in the header? Access to these functionalities is via the IBlock2
interface.
Changing the block that you have found is not possible! If you change
something, you will always create another (new) block!!! You are not wasting
memory, only the part of the block that you change will be duplicated. It is then
up to you what you do with this new block.
There can be different X-axis on 1 block. In the example, we will read them all
one by one. If there is no number specified, the first one is taken as default.
Note: The values read are MKS-values. If you want them to be in user units,
you still have to do that conversion.
Step 1
Declarations
Dim My_block as LMSTestLabAutomation.IBlock2
Dim Y_val() As Double
Dim X_val() As Double
Step 2
Read the Y-values.
Y_val = My_block.YValues
Step 3
Read the X-values of all different X-axis.
For vi = 0 To My_block.XCount - 1 Step 1
X_val = My_block.Xvalues(vi)
Next vi
Note: The block itself never is changed. When the 'Replace' functions are used
on a block, you will always get a new block.
There can be different X-axis on 1 block. By specifying their number, you can
edit 1 of them. When specifying no number, the first one is take as default. You
can change the X-axis by specifying all values as integers, as doubles, or by
specifying the increment and start value. The latter is taken in the example. It
replaces the start value to 1, the increment to 0.05 of the default X-axis.
Step 1
Declarations
Dim My_block as LMSTestLabAutomation.IBlock2
Rev 13A 23
Chapter 3 Using Test.Lab Automation
Note: The block itself will never be changed. When you use the 'Replace'
functions on a block, you will always get a new block.
You can create the new block with integers, or doubles, or complex values (as
they can be read out from a block). In this example, we use complex values.
Step 1
Declarations.
Dim my_block as LMSTestLabAutomation.IBlock2
Dim array_of_double_values () as Double
Dim block_result as LMSTestLabAutomation.IBlock2
Step 2
Change the Y-values
block_result = my_block.ReplaceYComplexValues ( array_of_double_values)
The information that is looked for, can be found in the properties of a block.
The of properties depends on the type of blockdata you have. All existing
properties are described in the file 'attributes.txt' on (the Test.Lab installation
directory)/central/gridfilters. When asking for "Properties" on a block, you can
have a look to all available properties on this (kind of) block.
If a specific 'property' of a block needs to be changed, for the moment you first
have to change the header, and then replace the header. In the future, you can
use the function 'ReplaceProperty'. As a result, you will have a new block!
In the example, the point Id and the reference Id are read and changed into a
fixed string. Then, the direction is read out and changed.
Step 1
Declarations.
Dim my_block as LMSTestLabAutomation.IBlock2
Dim block_result as LMSTestLabAutomation.IBlock2
Dim ReferenceId as String, PointId as String, Direction as string
Step 2
Read out the reference Id and point id of the block.
ReferenceId = my_block.Properties.Item("Reference point id")
PointId = my_block.Properties.Item("Point id")
Step 3
the reference Id and point id of the block to "myownpointid" and "myownrefId"
block_result = my_block.ReplaceHeader(my_block.Header.Edit("Reference
point id", "myownrefid"))
block_result = my_block.ReplaceHeader(my_block.header.edit("Point id",
"myownpointid"))
Step 4
Read out the direction.
The direction is stored as an enumeration object. The type of this IData object is
'LmsHq::DataModelI::Channel::CBufferIEnumDirections '
For types like this, you can use the "Enumerate" interface
Dim enumDirection as Enumerate
enumDirection = my_block.Properties.Item("Point direction")
Step 5
Now, change the direction of the new block to +RX.
enumDirection = enumDirection.ReplaceLocalValue("+RX")
block_result = my_block.ReplaceHeader(my_block.header.edit("Point
direction", enumDirection))
Note: The block itself will never be changed. When you use the 'Replace'
functions on a block, you will always get a new block.
Each axes of a block has a quantity, that can be read out and changed.
This quantity is interpreted by the unit system, to recognize the unit of it.
In the example, the unit label of the Y-axis is read out. Then, this unit is
changed into the unit in the current unit system for Force.
Rev 13A 25
Chapter 3 Using Test.Lab Automation
Step 1
Declarations.
Dim TL as new LMSTestLabAutomation.Application
Dim my_block As LMSTestLabAutomation.IBlock2
Dim Quant1 As LMSTestLabAutomation.IQuantity
Dim Quant2 As LMSTestLabAutomation.IQuantity
Dim UnitSys As LMSTestLabAutomation.IUnitSystem
Dim UnitLabel as String
Step 2
Read the current Y-unit.
UnitSys = TL.UnitSystem
Quant1 = my_block.YQuantity
UnitLabel = UnitSys.Label(Quant1)
Step 3
Change the Y-quantity to Force.
Quant2 = unitsys.QuantityForce
block_result = my_block.ReplaceYQuantity(Quant2)
Corrected_Y_values = Unitsys.MKSToUserValues(Quant,Y_val)
Section 3.4.1 How to search for all blocks on the active project
Rev 13A 27
Chapter 3 Using Test.Lab Automation
my_eplorer = datawatch_explorer.Data
my_searchEngine = my_eplorer.Search
Step 3
Define the watch on the state of the searchEngine
watch_searchBusy = my_searchEngine.State
Step 4
Launch the search (specifying the startpoint and the searchtype)
my_startpoint = my_searchEngine.StartPoint.ActiveProject
Call my_searchEngine.Search(my_startpoint, TestLab_Block)
Step 5
Implement the 'Value_changed' routine. This routine is called, anything changes
on the state of the SearchEngine.
Public Sub watch_searchBusy_ValueChanged(ByVal NewValue As Variant)
dim my_data_found As LMSTestLabAutomation.IData
dim my_block_found As LMSTestLabAutomation.IBlock
If (NewValue) Then
'Search is running
Else
'Search is not running
... '(check if it is already launched!)
If my_searchEngine.SearchBasket.Count >= 1 Then
'then some results are found
'read in the first result
my_data_found = my_searchEngine.SearchBasket.Item(0)
if my_ data_found.IsSubTypeOf ("LmsHq::DataModelI::Expression::IBlock")
= True Then
my_block_found = my_data_found
End If
...
End If
...
End If
End sub
The scalar object is used frequently by block commands. This Idata object
contains a value (double or complex) and its unit.
Parameters:
Starting at 2s
Duration of 1.3s
Sample rate of 1024 Hz
Step 1
Declarations.
Rev 13A 29
Chapter 3 Using Test.Lab Automation
Step 1
Declarations.
Dim scalarAmplitude as LMSTestLabAutomation.IScalar
Dim scalarDuration as LMSTestLabAutomation.IScalar
Dim scalarFrequency as LMSTestLabAutomation.IScalar
Dim scalarOffas LMSTestLabAutomation.IScalar
Dim scalarPhaseShift as LMSTestLabAutomation.IScalar
Dim BlockSine as LMSTestLabAutomation.IBlock2
Step 2
Create scalars for Duration (in time), Off(in time), Amplitude, Frequency (in
frequency), PhaseShift (in Angle)
scalarDuration = TL.cmd.DOUBLE_TO_SCALAR(2#,
TL.UnitSystem.QuantityTime,MKS)
scalarOff= TL.cmd.DOUBLE_TO_SCALAR(0,
TL.UnitSystem.QuantityTime,MKS)
scalarAmplitude = TL.cmd.DOUBLE_TO_SCALAR(8,
TL.UnitSystem.QuantityForce,MKS)
scalarFrequency= TL.cmd.DOUBLE_TO_SCALAR(100,
TL.UnitSystem.QuantityFreq,MKS)
scalarPhaseShift = TL.cmd.DOUBLE_TO_SCALAR(50,
TL.UnitSystem.QuantityAngle,MKS)
Step 3
Create the SineBlock
BlockSine = TL.cmd.BLOCK_SINE(scalarDuration, scalarOffset, 1024,
Step 1
Declarations.
Dim BlockResult as LMSTestLabAutomation.IBlock2
Dim BlockSource as LMSTestLabAutomation.IBlock2
Dim scalarToAdd as LMSTestLabAutomation.IScalar
Step 2
Add a scalar and a block
scalarToAdd =
TL.cmd.DOUBLE_TO_SCALAR(8,BlockSource.YQuantity,MKS)
BlockResult = TL.cmd.BLOCK_ADD_SCALAR(BlockSource, scalarToAdd)
Step 1
Declarations.
Dim weightingType As CONST_EnumWeighting
Dim BlockSource as LMSTestLabAutomation.IBlock2
Dim BlockResult as LMSTestLabAutomation.IBlock2
Step 2
Perform the weighting
weightingType = WeightingA
BlockResult = TL.cmd.BLOCK_WEIGHTING(BlockSource, weightingType)
Step 1
Declarations.
Dim Block1 As LMSTestLabAutomation.IBlock2
Dim Block2 As LMSTestLabAutomation.IBlock2
Dim BlockResult As LMSTestLabAutomation.IBlock2
Step 2
Add two blocks
Rev 13A 31
Chapter 3 Using Test.Lab Automation
If you have time data, you first have to calculate the spectrum. For a spectrum,
calculate the Octave Spectrum. Only then, the command BLOCK_LOUDNESS
is available.
Step 1
Declarations.
Dim TL As New LMSTestLabAutomation.Application
Dim BlockTime As LMSTestLabAutomation.IBlock2
Dim BlockFFT As LMSTestLabAutomation.IBlock2
Dim BlockOctave As LMSTestLabAutomation.IBlock2
Dim scalarLoudness As LMSTestLabAutomation.IScalar
Dim loudnessValue as Double, dummy as double
Step 2
For time data, calculate spectrum
BlockFFT = TL.cmd.BLOCK_SPECTRUM(BlockTime)
Step 3
For spectra, calculate octave spectrum
BlockOctave = TL.cmd.BLOCK_OCTAVE(BlockFFT)
Step 4
Calculate the loudness on an octave spectrum
scalarLoudness = TL.cmd.BLOCK_LOUDNESS(BlockOctave)
Step 5
Get the scalarLoudness value out of the IScalar
Call scalarLoudness.GetValue(loudnessValue, dummy)
Step 1
Declarations.
Note: Use AddDataLink to add data to the display, if you want to do printing
afterwards!. That way, you keep the link with the origin of the data, and you
still have access to all its related attributes. With ‘AddData’, the display has
no link to the origin of the data anymore.
Step 1
Declarations.
Rev 13A 33
Chapter 3 Using Test.Lab Automation
PrintManager.PrintOut()
Rev 13A 35
Chapter 3 Using Test.Lab Automation
The datawatch of the run name is called "Measure_Run", its data type is a
string.
Step 1
Declarations
Dim TL As new LMSTestLabAutomation.Application
Dim WithEvents datawatch_Run as LMSTestLabAutomation.DataWatch
Dim currentRunName as String
Step 2
Define the correct datawatch
datawatch_Run = TL.ActiveBook.FindDataWatch("Measure_Run")
Step 3
Read the current run name on the datawatch
currentRunName = datawatch_Run.Data
Change the run name to "MyRun"
datawatch_Run.Data = "MyRun"
...
Step 4
Write the routine datawatch_Run_ValueChanged.
This routine will be executed when the user changes the Run Name in the
application interface.
Rev 13A 37
Chapter 3 Using Test.Lab Automation
Changing the channel setup parameters from within Automation is not yet
supported. You can work with specific setups, that are already saved in
templates.
Step 1
Open a new project, using a specific template
TL.NewProject("C:/LmsLocal/Template/mytemplate.tpl")
There are two main ways of working with Test.Lab Automation. They can be
combined in the same program.
You can connect with an existing application, and then you can, for example,
show blocks in the display of the application.
Components - Controls
Step 2
Switch on LMS Test.Lab ModuleLoader and push OK.
Step 4
Rev 13A 39
Chapter 3 Using Test.Lab Automation
With the properties, you can change the ModuleName into the name of the
module you want: From 6A on, PictureManager, Picture and Explorer are
supported.
The following will appear:
Properties - AcivecXModuleLoader1
If you run this project now, a little interface appears with an empty Picture
Manager.
Next item explains how to access this Picture Manager.
Step 1
First, in the toolbar of VB.net, the module loader control must be add.
With a right click on the mouse on the Toolbar, you can do ["Add/Remove
Items"].
Add/Remove Items
Step 2
Select the LMS Test.Lab Module Loader Control by the list of the COM
Components and click [OK].
Customize Toolbox
Rev 13A 41
Chapter 3 Using Test.Lab Automation
Toolbox - Control
Step 3
If you click on it and draw it on a form (as if it were a button), the following
appears on your form:
Form1: LMS Test.Lab
Step 4
With the properties, you can change the ModuleName into the name of the
module you want. From 6A on, PictureManager, Picture and Explorer are
supported. If you want an explorer, you need an open project, so the
openProject item to TRUE!
Properties - Module
If you run this now, you will see the interface coming up with an explorer in it.
Rev 13A 43
Chapter 3 Using Test.Lab Automation
When blocks are displayed in the picture(s) of a module loader, the reference to
these blocks must be defined via the module.
Step 1
Declarations.
Dim module As LMSTestLabAutomation.IModule
Dim myBlock as LMSTestLabAutomation.IBlock2
Dim myDatabase As LMSTestLabAutomation.IDatabase
Step 2
Get database
Set myDatabase = module.Database("C:/LmsLocal/Data/myproj.lms")
Step 3
Get a block
Set myBlock =
myDatabase.GetItem("Sect1/Run1/Fixedsampling/Runup/Sections/Orders/Orde
r 2.00 Mic1")
When you start up Visual Basic, only the basic references are available. All
extra libraries that are to be used, need to be selected manually. This can be
done as follows:
Step 1
In the menubar of Visual Basic, go to Projects > References.
This menu will pop up:
When you start up Visual Basic .NET, only the basic references are available.
Extra libraries that are to be used, can be selected manually. This can be done as
follows:
Step 1
Rev 13A 45
Chapter 3 Using Test.Lab Automation
With a right click of the mouse on the Solution explorer, select Add References.
Step 2
In the appearing menu, Lms Test.Lab® Automation Type library can be found
by the COM references.
From now on, the Test.Lab type library can be used.
A datawatch is a kind of port, where you can read data from and data on. You
also can be notified if the data changes on this datawatch. The meaning of this
data, depends on the datawatch. Each data watch has its data type, all data on
this data watch is always of this data type.
A big part of the supported datawatches corresponds with an existing item in the
application user interfaces.
Step 3
In the list that shows up, you can find "Measure_Run"
The 'port type' is 'LmsHq::DataModelI::Base::IStringValue'.
The object on this datawatch must always be such an IStringValue. In this case,
also a simple string will do. For other data types, you have to create an object of
that specific type.
datawatch_RunName = TL.ActiveBook.FindDataWatch("Measure_Run")
Rev 13A 47
Chapter 3 Using Test.Lab Automation
Step 4
Read out the current Run Name.
CurrentRunName = datawatchRun_Name.data
Step 5
Change the current Run Name to "MyRun".
datawatch_RunName.Data = "MyRun"
Step 6
Implement the Value_Changed routine.
This routine will be executed when the user changes the Run Name in the
application interface.
Private sub datawatch_RunName_ValueChanged (ByVal NewValue As
Variant)
...
End Sub
More information about this, you can find in the Data Watches.
It is possible to create your own user programs and add them as add-in in
Test.Lab. There are 5 possible user add-inns.
Step 1
You have to create your program as an ActiveXControl(*) and register it.
Step 2
On the installation directory, you have to edit the file
<Installation directory>/central/Configuration/ExternalUI.
ExternalU - Notepad
Step 3
You can choose your sheetname, and you have to enter the ID of your
ActiveXControl.
The ID of your ActiveXControl in Visual Basic 6.0 for the OCX as in the
picture beneath looks like this: Project1.my_user_control
ActiveXControl - ID
When starting Test.Lab the next time, your program will be available as an
Rev 13A 49
Chapter 3 Using Test.Lab Automation
Add- In.
Step 4
To activate it, go to Tools > Add-Ins and select User 1-5.
An extra sheet with your program appears.
(*) When creating a user program, you can decide to create an ActiveXControl.
With this kind of a 'program', you are not creating a standalone program, but a
Control. Such a control needs an interface, where it can be plugged in. This
program will never run itself, it will be a part of its 'mother' program. When
making an ActiveXControl in Visual Basic, the new control is registered.
Test.Lab can pick up registered control and show it in a new sheet. For more
information, please turn to your Microsoft documentation.
It is possible to create your own user programs and add them as add-in in
Test.Lab. There are 5 possible user add-inns.
Step 1
You have to create your program as an ActiveXControl(*).
In VB.net, your project is eg a Windows Control Library.
Make User Control Project
4. You can choose your sheetname, and you have to enter the ID of your
ActiveXControl.
Rev 13A 51
Chapter 3 Using Test.Lab Automation
It is created from the name of the project and the name of the user control.
Without changing names, it is WindowsControlLibrary1.UserControl1. Of
course, these names can be changed in the VB project.
When starting Test.Lab the next time, your program will be available as an
Add-In.
5. To activate it, go to Tools > Add-Ins and select User 1-5.
The structure of such an IData object is like this: an attribute map, next to its
type.
DataObject
Creating a Test.Lab object depends on its type. A (rather simple) IData object is
the Enum type. You can find how to create it in the next item
Without claiming to be complete, the following list give for some types their
corresponding interface:
Types Interfaces
LmsHq::DataModelI::Base::IBoolean Boolean
LmsHq::DataModelI::Base::IReal Long/Double
LmsHq::DataModelI::Base::IInt Integer
LmsHq::DataModelI::DataStructure::IScalarDoubleVariable IScalar
LmsHq::DataModelI::DataStructure::IScalarComplexVariable IScalar
LmsHq::DataModelI::Expression::IBlock IBlock2
LmsHq::DataModelI::Expression::CBufferIBlock IBlock2
LmsHq::ActiveCompVI::AutomationPictures::IPictureManag IPictureManage
er r
LmsHq::ActiveCompVI::AutomationPictures::IPrintManager IPrintManager
Enumerate (see
LmsHq::DataModelI::DataAttributes::IEnum...
next item )
Enumeration values are Idata objects. The type of this object is an enum type.
The attribute map of this object contains 1 item "EnumValue", containing the
int-value of the enumeration.
From 6A on, there exists an interface "Enumerate" in the Test.Lab Type library.
Step 1
How to know whether a IData object is a Enumerate?
Via the method on a IData object "IsSubTypeOf".
dim myData as IData
dim myEnum as Enumerate
if (myData.IsSubTypeOf("LmsHq::DataModelI::Base::IEnumerate"))
myData = myEnum
end if
Of course, if the type of an object is known (e.g. because you read it from a
datawatch), this check is not needed. If there is "Enum" somewhere in the
internal type name of a IData object, or it is in the list of all Enum Types in the
Automation documentation tool (by browsing to "Test.Lab Enumerate
Definitions"), you can use the "Enumerate" interface.
Step 2
How to read a Enumerate object?
Presume the direction of a block is read.
Rev 13A 53
Chapter 3 Using Test.Lab Automation
Step 3
How to change a Enumerate object?
Let us work further with the direction object of the example above.
You can change an Enumerate both with its int-value as with its string-value
(=LocalValue). All possible values can be found by the property range.
In the next figure, the content of the range is shown. You can find the possible
localValues by having a look at the keynames of the items of the attributemap
gotten from the property ‘Range’.
In the next lines code, all possible values from the enumDirection object are
read in the string array strEnumValues.
Dim strEnumValues() As String
Dim i As Integer
ReDim strEnumValues(enumDirection.Range.Count)
For i = 0 To enumDirection.Range.Count - 1
strEnumValues(i) = enumDirection.Range.KeyNames(i)
Next i
Changing the direction of the object to +X can be done like this
enumDirection = enumDirection.ReplaceLocalValue("+X")
For several functions in Test.Lab, you can enter a path to specify the location of
an object. Also, in some functionalities, Test.Lab returns a path.
Some examples:
for the search, when indicating the location from where to look from
StartPointFactory: Property File(FilePath As String, [SubPath As String]
To identify a specific database Application: Function
Database(ProjectPathName As String)
for the search, when indicating the location from where to look from
StartPointFactory: Property File(FilePath As String, [SubPath As String])
for the location of blocks in a database IDatabase: Function
GetItem(PathToTop As String)
to edit an IData object IData: Function Edit(PathWithinObject As String,
NewAttribute)
Rules:
Different parts are separated by a "/"
If in the name of one part a special character is used, it must be escaped by
a "\"
List of the special characters: # / \ { }
block = TLDB.GetItem("Sect1/Run1/Coherence/Coherence
plat:1:+Z\/plat:1:+Z")
Rev 13A 55
Chapter 4 Examples
Chapter 4 Examples
In This Chapter
General: ..............................................................................57
Example 1:..........................................................................57
Example 2:..........................................................................57
Example 3:..........................................................................57
Example 4:..........................................................................58
Example 5:..........................................................................58
Example 6:..........................................................................58
Example 7:..........................................................................58
Example 8:..........................................................................58
Open Test.Lab and open a Block. Add a Picture to the PictureManager and add
the Block to this Picture. Finally crear all the data from the display.
Open Test.Lab and retrieve the Workspace and InputBasket from the Explorer.
Create and delete a folder in the Workspace and copy all items from the
InputBasket to the new created folder in the Workspace.
Open test.Lab and retrieve the SearchEngine from the Explorer. Create search
criteria and perform a search with this criteria. Wait for the search to finish and
display all results.
Rev 13A 57
Chapter 4 Examples
Open Test.Lab and read the AttributeMap of a Block. The first part is to retrieve
a value if the name and path in the map is known. The second part consists of
listing all attributes in the AttributeMap. Create an object corresponding with
the type of the object. and display a readable enum value.
Open Test.lab and add a cursor to a Display. Move this cursor to a new position.
For this it is neccesairy to convert the user units to MKS units.
Open Test.lab and select a block. Perform actions on this block through Cmd
and AdvancedCmd. Create a new section in the active project and save the new
block in that section. Finally save the project.
Open Test.Lab and open a print template. Add blocks to the print picture in
different displays. Print this picture to a .doc file.
Open Test.Lab and start a measurement. Stop the measurement and display
overloads and status.
In This Chapter
Introduction to Automation ................................................60
The Test.Lab Automation Library......................................65
IApplication ........................................................................65
IAttributeMap .....................................................................78
IDataWatch.........................................................................82
FE35 ...................................................................................83
Enumerate...........................................................................89
Factory ................................................................................92
IBlock2 ...............................................................................94
IBook ..................................................................................106
IBooks ................................................................................117
ICmd ...................................................................................119
AdvancedCmd ....................................................................128
ICrossCursor.......................................................................129
ICursor ................................................................................129
ICursorManager..................................................................129
IData ...................................................................................129
IDatabase ............................................................................130
IDataBrowser......................................................................138
IDisplay ..............................................................................140
IDoubleCrossCursor ...........................................................140
IDoubleCursor ....................................................................140
IDoubleRatioCursor ...........................................................140
IExplorer.............................................................................140
IGeometry...........................................................................144
IHarmonicCrossCursor .......................................................152
IHarmonicCursor ................................................................152
IHarmonicRatioCursor .......................................................152
IHeader ...............................................................................152
IModule ..............................................................................153
InProcApplication ..............................................................157
InputBasket.........................................................................158
IPicture ...............................................................................159
IPictureManager .................................................................159
IPrintManager.....................................................................159
IQuantity.............................................................................159
IRatioCursor .......................................................................160
IScalar.................................................................................160
ISheet ..................................................................................160
ISheets ................................................................................160
ISingleCursor......................................................................160
IUnitSystem ........................................................................160
LMS Unit System ...............................................................164
IWatch ................................................................................165
IWaterfall (not yet implemented) .......................................165
SearchBasket ......................................................................169
SearchEngine ......................................................................169
Rev 13A 59
Chapter 5 Reference guide
StartPointFactory ................................................................172
Workspace ..........................................................................174
Automation services
The previous figure shows how both server and client applications can call upon
the common services to communicate. The automation layer provides language
and Windows platform independence. Although Automation is specially aimed
at supporting interpreted languages, like Visual Basic and MATLAB, it just as
well can be used from compiled languages like Visual C++, J++, Java, C#.
An additional strong point in the binding between client and server application
is that they both can run as separate processes. Such a configuration will
improve stability. When the client application should crash, the server
application will continue running without further disadvantage.
Rev 13A 61
Chapter 5 Reference guide
Using this Excel object model, we can, for instance, change the AxisTitle of a
chart in an Excel workbook. As a convention the main object you can get access
to is called 'Application' and represents the complete application. In the case of
Excel this object can be requested to return a list of all 'Workbooks'. This object
is a collection, i.e. a list, of zero or more individual books opened. A name or
sequence number, to return an individual item, can index such a collection.
Once you have got the target workbook, the client can navigate charts, resulting
in a single chart. From there it goes deeper into the axes structure of the chart
itself, down to the AxisTitle object.
ExcelApp = CreateObject("Excel.Application")
Previous figure shows a subof the list of 'things' you can do with such an
Application object. The highlighted member will return an object, which has
committed to provide all functionality on the Sheets interface.
ExcelSheets = ExcelApp.Sheets
As you can see in figure 4, any object supporting the 'Sheets' interface will need
to implement the 'Count' function, which will return the number of sheets this
application has.
In fact there are only three types of members, which an interface can provide.
Rev 13A 63
Chapter 5 Reference guide
Any Windows system, even with only a few applications installed, will easily
have a couple of hundred type libraries available for client applications to use.
This shows that it is common practice for an application to export functionality
in this way. So if you are acquainted with inspecting one type library, you can
reuse your experience to navigate any object model, described in any type
library.
Test.Lab also has it own of interfaces defined. The description of the Test.Lab
object model can be found in its type library, called
LMSTestLabAutomation.tlb. It is copied to the
<installation>/Central/Configuration directory during Test.Lab installation.
If you add a reference to 'LMS Test.Lab Automation Type Library', the object
browser will show all interfaces supported by the Test.Lab applications.
OLE viewer
This is an 'Object Linking and Embedding' viewing tool. Its File View TypeLib...
entry will allow you to select a .tlb file and opens it in an 'ITypeLib viewer'
window. This OLE viewer comes with the Visual C++ development
environment. This viewer shows the interface type information in a way, which
is closer to the raw description, provided by the server application. Next is an
example of this view viewing the information on the Excel Application object.
ITypeLib Viewer
Freeware tools
There are some standalone type-library-viewing tools available on the Internet.
Rev 13A 65
Chapter 5 Reference guide
Definition
Methods
Init
NewProject
OpenProject
Quit
SaveAll
FindDataWatch
CreateObject
Database
DisallowNewClientConnections
DisallowExit
CreateAttributeMap
InstallationPath
LocalPath
PID
Properties
Books
ActiveBook
UnitSystem
Name
cmd
Factory
Version
The Test.Lab workbook loader is the main executable that offers some
application independent services like for instance unit system manipulation.
Besides, it can load different workbooks, resulting in different functionality e.g.
Desktop, SignatureFS, SpectralAcquisition, Environmental testing, etc. These
workbooks are defined in .awb-files on the directory
<installation>/Central/Workbooks.
The next few lines of Visual Basic code show how to create an automated
Test.Lab.
TestLab = CreateObject("LMSTestLabAutomation.Application")
The execution of the Visual Basic CreateObject instruction can have two
results.
If a Test.Lab application was already running, it hooks up to this running
application, and automatically uses the workbook that is loaded.
If no Test.Lab application is running, it launches the workbook loader
executable, without loading any workbook. You can instruct the loader to
load a workbook using the 'Init' method in the Application interface, e.g.
TestLab.Init("-w ModalImpactStandard")
Application interfaces
Rev 13A 67
Chapter 5 Reference guide
to non-zero (-1). Some type of modules really need an open project (like the
Explorer), others can be used with or without (as the Picture(Manager)).
If the OpenProject is 0, the next two fields (ProjectName and SectionName) are
ignored. If not, the specified project in 'ProjectName' is opened when the
module is loaded. If the 'ProjectName' is left blank, a default project will be
opened, just as with 'New project' in the Test.Lab workbook loader. Specifying
a SectionName will use the settings in that specific section, otherwise it will
revert to the default section.
Module Types:
Default
PictureManager
Picture
Explorer
Default
This module is the module that is loaded by default. It is shown here on the GUI
of an external application.
Default module
NONE
PictureManager
This module contains the picture manager functionality as it is presented in the
'Navigator' of 'Measure' sheet for instance.
PictureManager module
This module can be used in the same way it can be used in Test.Lab itself.
Rev 13A 69
Chapter 5 Reference guide
Picture module
This module is more suited in situations where the developer wants to restrict
access to the different manipulations offered by the PictureManager.
Picture module
Navigator_SelectedOIDs
Navigator_UpdateTreeItem
Navigator_Explorer
IModule interfaces
Init
Signature
Init(ApplicationStartupArguments As String)
Description
'Init' instructs the Test.Lab object to initialize with the passed
StartupArguments. You can supply a number of options as arguments:
-w <workbook name>
Specifies the name of the workbook to be loaded. All workbook descriptions are
in the <installation>/Central/Workbooks directory.
-a <architecture>
Specifies the architecture to be used. This specifies, for instance, options that
are shared between different workbooks. Default value is so that this can be
omitted by normal use.
Rev 13A 71
Chapter 5 Reference guide
-t <template name>
Specifies the template to be used at startup.
–b
Indicates to start the workbook without automatically opening a project.
-c <configuration file>
Specifies the configuration file to be used. This configuration file can contain
some personalization settings, like colors, styles, layouts, etc.
<project name>
Specifies the project name to use at startup.
Example
TestLab.Init ("-w ModalImpactStandard
C:/MyProjects/PrjDB.lms")
Initializes the Test.Lab workbook loader application with the
ModalImpactStandard workbook, using the ModalImpact architecture and
creating one instance, given the C:/MyProject/PrjDB.lms as its project.
NewProject
Signature
NewProject(TemplatePathName As String = Nothing) as String
Description
This method opens a new workbook in the application, while creating a new
temporary project. It uses the default template of the current application, unless
another template is specified. Upon saving the project, , a 'save as' project name
will be required.
The method returns a string. This string holds a unique id associated with the
created workbook instance. You can use this id to select a specific book out of
the list of books.
Example
TestLab.NewProject ()
This will create a new workbook, based on a new project. It does not captures
the returned new book id.
OpenProject
Signature
OpenProject(ProjectPathName As String) As String
Description
This allows you to create a new workbook in the application, based on an
existing project. Again the return value is a unique id of the book created as
result of calling this method.
Example
Bookid = TestLab.OpenProject("c:/MyProject/PRJ1234.lms")
Quit
Signature
Quit()
Description
Quits the complete Test.Lab application. This method does not include saving
any projects before shutting down, nor does it present a message box to ask the
user whether he wants to save his data or not. This can be done in the client
application depending on the desired automation scenario.
Example
TestLab.Quit
SaveAll
Signature
SaveAll()
Description
As mentioned earlier, a single Test.Lab application can have several instances
of a workbook running, each related to a project. The 'SaveAll' method instructs
all books to save their associated project. It is shorthand for iterating all the
open books and save each in turn.
Example
TestLab.SaveAll
FindDataWatch
Signature
FindDataWatch(AbsoluteDataPath As Object, MaxUpdateFrequency
As Integer = 1000, IsAutoBuffered As Integer = 1, InitialFiring
As Integer = 1) As Datawatch
Description
MaxUpdateFrequency: the interval, specified in milliseconds, with which the
system will check the contents of the port and notify the client application if the
value on the port has changed since the previous check. Default is 1000
IsAutoBuffered: a Boolean value to indicate that the value returned from the
datawatch needs to be returned as a buffered, normalized type. Default is 1,
meaning AutoBuffered is true.
InitialFiring : a Boolean value that makes that the ValueChanged callback on
this datawatch will be fired when the datawatch is initialized (default is 1) or
not.
Example
Dim Loaded_AddIns_Port as LMSTestLabAutomation.DataWatch
Loaded_AddIns_Port =
TestLab.ActiveBook.FindDataWatch("Loaded_AddIns")
CreateObject
Rev 13A 73
Chapter 5 Reference guide
Signature
CreateObject(DesiredType As String, Attributes As
AttributeMap) As IData
Description
This method allows a client application to create native Test.Lab objects such as
commands, weighting types, data blocks, calculations, etc. To do so it needs a
string to indicate the type of data to create, and an attribute list, a kind of
parameter list, as input for creation. Please read through the description of the
next interfaces and by the time you get to the AttributeMap interface, the
function of this method should be clear. The function returns an IData object.
Database
Signature
Database(ProjectPathName As String) As IDataBase
Description
This method allows a client application to get hold of the automation object
called IDatabase for databases solely stored on disk. The database is not opened
in a workbook.
This IDatabase interface holds all the functionality for interacting with the
project database.
Example
Dim TL_DB As LMSTestLabAutomation.IDatabase
TL_DB =
TestLab.Database("e:\local\data\Archive\PRJ990604.lms")
DisallowNewClientConnections
Signature
DisallowNewClientConnections()
Description
Prevents other applications from making connections with the application.
DisallowExit
Signature
DisallowExit(ac_bDisallowExit As Integer)
Description
This method enables a client application to get control over
allowing/disallowing the interactively quitting the Test.Lab application. If the
value is 1, then the exit is not allowed.
CreateAttributeMap
Signature
CreateAttributeMap() As Attributemap
Description
This method creates an Attributemap object in Test.Lab and returns a reference
Books
Signature
Books as IBooks
Type
Read-only
Rev 13A 75
Chapter 5 Reference guide
Description
This property returns the collection of workbook instances, currently active in
the Test.Lab application. The Figure below shows the DesktopStandard
workbook, twice instantiated. One based on project1 and a second based on
project2. Such a list of instantiated workbooks can be retrieved by the 'Books'
property. A book is related to an open project.
ActiveBook
Signature
ActiveBook As IBook
Type
Read-only
Description
This property allows an automation client to get a reference to the book that is
selected. The window of the active Book has a highlighted title bar (see Figure
below).
The active book is one of the books in the list returned by the 'Books' property.
UnitSystem
Signature
UnitSystem As IUnitSystem
Type
Read-only
Description
The UnitSystem property, returns a reference to an object in Test.Lab that is
responsible for handling unit system operations. Further interaction with this
unit- system-managing object can be done by means of the members defined on
the IUnitSystem interface.
Name
Signature
Name As String
Type
Read-only
Description
This method returns the name of the opened workbook of the attached Test.Lab
application.
cmd
Signature
cmd As ICmd
Type
Read-only
Rev 13A 77
Chapter 5 Reference guide
Description
This method returns a handle to the command interpreter used in the Icmd
interface.
Factory
Signature
Factory As Factory
Type
Read-only
Description
This property return a factory, where several Test.Lab objects can be created.
Version
Signature
Version As String
Type
Read-only
Description
This property returns the version of the application that is running.
Definition
Methods
Add
Remove
Replace
Properties
Count
Item
KeyNames
These attributemaps are being used for decomposition and composition. In case
of decomposition, it is an attribute list representing an existing object, while in
the case of composition it is used as input to create a new object.
The 'IData.Edit' method, discussed in previous section, can return a new IData
object, based on an existing one. It is also possible to create a Test.Lab IData
object from scratch by means of the 'CreateObject' method on the Application
object. In order to do so, a list of attributes has to be passed, along with a string
indicating the required type of object
Rev 13A 79
Chapter 5 Reference guide
AttributeMap interfaces
Add
Signature
Add(Index As Object, ac_Item As Object)
Description
Adds an attribute to the attributemap. This attribute is added with a keyname
'Index' and value 'ac_Item'.
Example
Dim new_attributes as LMSTestLabAutomation.AttributeMap
new_attributes =
CreateObject("LMSTestLabAutomation.AttributeMap")
new_attributes.Add("LineStyle", local_line_style)
Creates an empty attributemap and adds an attribute value under the name of
"LineStyle".
Remove
Signature
Remove(Index As Object)
Description
Removes an attribute from the AttributeMap. If Index is a string, it will remove
the associated entry from the map. If Index is an integer value n, it will remove
the nth occurrence.
Example
attributes.Remove("LineStyle")
attributes.Remove(1)
Replace
Signature
Replace(Index As Object, ac_Item As Object)
Description
Replaces an attribute from the AttributeMap with a new item. Index can be both
a string (the associated entry is replaced) as an integer (the nth occurrence is
replaced).
Count
Signature
Count As Integer
Type
Read-only
Description
Returns the number of attributes in the map object.
Example
Number_of_attributes_in_object = attribute_map.Count
Item
Signature
Item(Index As Object) As Object
Type
Read-only
Description
Returns the value associated with a specific attribute in the map. The index
specified can be an zero-based sequence number or a string, in which case it
will return the value associated with the matching key.
Example
attribute_value = attribute_map.Item (1)
attribute_value = attribute_map.Item ("LineStyle")
Rev 13A 81
Chapter 5 Reference guide
KeyNames
Signature
KeyNames As IAtrtibuteMap
Type
Read-only
Description
Returns an AttributeMap object, which only holds the names of the original
attribute map, but this time as values. This way the list can be iterated by means
of the Count and Item property to consult all available key names.
Example
'should the attribute_map contain following pairs:
' keyname: "foreground" value:<value_object_1
' keyname: "background" value:<value_object_2
' keyname: "font" value:<value_object_3
keyname_list = attribute_map.KeyNames ()
'keyname_list contains following pairs:
' sequencenr: 1 value:"foreground"
' sequencenr: 2 value:"background"
' sequencenr: 3 value:"font"
For Each keyname In keyname_list
'keyname will contain "foreground", "background" and "font" in turn.
Next
DataWatch interfaces
Definition
Properties
Events
A Test.Lab module does not necessarily need to provide any user interface. In
fact some modules merely provide the core processing, while others do not do
any processing of themselves.
You can think of them as devices, where the user can interact by means of a
front-panel to control the internal services of the device. The front-panel merely
allows a user to get access to some of the internals of the device. Replacing the
front-panel with a more reduced of controls does not require the internal system
to be changed if you would want it to have some fixed settings.
Rev 13A 83
Chapter 5 Reference guide
On the application, some global communication can be done. Most of the data
watches are defined on a specific workbook. The different modules of a
workbook use this way of communication. Automation can pick them up as data
watches on this workbook.
When working with the Test.Lab Module Loader, data watches are available on
the module. There are 2 types there: one is comparable with those on a
workbook, but limited to the data watches that are relevant for the module. The
other are the 'global' ones, comparable with those on the application. To find an
existing data watch, you can use the FindDataWatch method on an Application
on an IBook, or on an IModule.
On an IBook and an IModule, you can even create your own data watches
(method CreateDataWatch on an IBook and an IModule). These methods return
a DataWatch-object. Reading and writing on the data watch is done via its
property Data.
AsyncData
Data
Signature
Data As Object
Type
Read-only
Description
Ports are the carriers that are being used to communicate specific data packages
between subscribers. This property is the means to either get or such a data
package.
Getting data means the latest data package is returned to the client.
Putting data will instruct Test.Lab to broadcast the supplied data to other
subscribers.
Since each port is designed for a specific purpose, it is only able to transport
data of a specific type. It is the users' responsibility to provide correctly typed
data packages. There are a number of different ways in which the user can get a
hold of data to put on ports.
Data objects, gotten from another port. The types of both ports have to be
compatible.
A Test.Lab data object, altered by means of the 'Edit' method in the IData
interface. (Ref Edit)
A Test.Lab data object, created with the 'CreateObject' method in the
Application interface. (Ref CreateObject)
A non-Test.Lab native data object, which fully supports the automation
interfaces as laid out in the Test.Lab object model, e.g. Visual Basic class
supporting the IBlock interface.
Example
Public port_to_override As LMSTestLabAutomation.DataWatch
port_to_override =
testlab.ActiveBook.FindDataWatch("FS_Weighting_Acoustic")
Dim NewWeightingValue As LMSTestLabAutomation.IData
Dim attributes As LMSTestLabAutomation.AttributeMap
attributes =
CreateObject("LMSTestLabAutomation.AttributeMap")
attributes.Add "EnumWeighting", 5
NewWeightingValue =
testlab.CreateObject("LmsHq::DataModelI::DataAttributes::CB
ufferIEnumWeighting", attributes)
port_to_override.Data = NewWeightingValue
DataPathName
Signature
DataPathName As String
Rev 13A 85
Chapter 5 Reference guide
Type
Read-only
Description
Returns the ID of the port the DataWatch represents. This is the ID which was
specified in the 'FindDataWatch' method that returned the DataWatch object in
the first place.
Example
PortID = port_to_override.DataPathName
InitialFiring
Signature
InitialFiring As Integer
Type
Read-only
Description
Returns if the InitialFiring property of the DataWatch is on or off.
IsAutoBuffered
Signature
IsAutoBuffered As Integer
Type
Read-only
Description
Returns a Boolean value to indicate whether the data on the port needs to be
converted into a standardized data type, before handing it over to the client.
Leave this variable to on (=1).
Suppose we have a port, which can transfer real values. Such a data object could
be of the type 'TestLab_Real', holding the value 7.3. Not always do such a port
communicate calculated, self-contained values such as 7.3, but in some cases it
will hold recipes, resulting in a real value, but only after evaluating the recipe.
Lets say this recipe would be of the type 'TestLab_RealAdd', and hold two other
values e.g. 1.2 and 6.5. Evaluating the 'TestLab_RealAdd' would result in the
sum of both values, being 7.7, also a real value.
So even if the port can only hold real values, the actual data types passed, can
differ, depending on the recipe they represent. In order to avoid having to check
for all kinds of different 'recipes' passing on a single port, the user can request to
have the data converted to a predefined buffer-type before handing it over to the
client application. The next figure points out the meaning of the 'IsBuffered'
flag, which can be passed in the 'FindDataWatch' method. The default setting
value for this parameter is to return the buffered-type data.
In the previous scenario, the application holds a port of type real. Such a
Test.Lab real can hold a calculated value, as in the case of Buffer_Real, or it can
hold a recipe to calculate an real value, e.g. Sum_Real. If you turn
'IsAutoBuffered' off, you get the raw object types as they pass on the port. If it
is turned on, the recipe is evaluated and turned into a buffered form, which
contains the result. That way the client application does not have to take all
different possible Test.Lab object types into account.
Example
Spectral_Start_Measure_Port =
TestLab.ActiveBook.FindDataWatch("Spectral\/Measure",5000,T
rue)
...
Does_this_datawatch_have_autobuffering_on =
Spectral_Start_Measure_Port.IsAutoBuffered
IsReadOnly
Signature
IsReadOnly As Integer
Type
Read-only
Description
Returns of the DataWatch is read only or not.
Rev 13A 87
Chapter 5 Reference guide
UpdateFrequency
Signature
UpdateFrequency As Integer
Type
Read-only
Description
Returns the time interval used for event notification. If no event routine is
registered this value is irrelevant. If event notification is required, this update
frequency in milliseconds will specify the rate at which Test.Lab will check for
new values on the port, identified by the datawatch object. This
'UpdateFrequency' is the worst-case latency before getting notified in the client
application. The smaller the value, the more frequent Test.Lab will check for
changes, thus consuming more the server CPU time, but communicating the
changes quicker to the client application.
Example
tacho_value_datawatch =
TestLab.ActiveBook.FindDataWatch("Tacho_Value",250,True)
Rpm_value_update_freq = rpm_value_datawatch.UpdateFrequency
Have Test.Lab check the 'tacho_value' port every quarter of a second for new
values and call the "tacho_value_datawatch_ValueChanged" event routine if
anything has changed.
measurement_state_datawatch =
TestLab.ActiveBook.FindDataWatch("Measure_Acquisition_State",2000,True)
measurement_state_ update_freq =
measurement_state_datawatch.UpdateFrequency
Have Test.Lab check the Measurement state port every 1/2000th of a second for
new values and call the "measurement_state_datawatch_ValueChanged" event
routine if anything has changed.
ValueChanged
Signature
Private Sub <DataWatchName>_ValueChanged(ByVal NewValue As
Variant)
Description
Whereas properties and methods define a synchronous communication between
a client and server application, the automation 'Event' mechanism provides a
way to let the server notify a client application of a specific happening.
The 'ValueChanged' event, defined on the DataWatch object, allows a client to
register a callback routine. This routine, on the client side, will be called
whenever data changes on the specified port. The frequency, with which to
Definition
Methods
ReplaceIntValue
ReplaceLocalValue
Properties
IntValue
LocalValue
Range
Rev 13A 89
Chapter 5 Reference guide
Enumerate interfaces
There exist a lot of these so called enum-types. Some of them do have their own
implementation in the type library (ex. CONST_EnumWindowing), most of
them do not. This provides Automation users a generic interface to all these
types.
If you have a IData object, you can see at its type if it is a Enumerate or not: if
you find "Enum" in its type, it is!
You can read and write the current value of this enum-object, both as integer
and as a string (=LocalValue).
ReplaceIntValue
Signature
ReplaceIntValue(NewValue As Integer) As Enumerate.
Description
This function replaces the current value of an enumerate, by specifying its value
as a number. The number must be in the range. The result is another enumerate
with the replaced value. The original object still exists and is not changed.
ReplaceLocalValue
Signature
ReplaceLocalValue(NewValue As Integer) As Enumerate.
Description
This function replaces the current value of an enumerate, by specifying its value
as a string. This string can be found in the result of the ‘range’ method. The
result is another enumerate with the new value. The original object still exists
and is not changed.
IntValue
Signature
IntValue As Integer
Type
Read-only
Description
This function returns an integer, representing the current value of the enum
object.
LocalValue
Signature
LocalValue As String
Type
Read-only
Description
This function returns a string, representing the current value of the enum object.
Range
Signature
Range As AttributeMap
Type
Read-only
Description
This function returns an attributemap, containing all possible values of the
enumerate. The name of the items of the range are the possible stringvalues it
can have, the content of its items the possible numbers where it corresponds
with.
Rev 13A 91
Chapter 5 Reference guide
Definition
Methods
COMPLEX_TO_SCALAR
DOUBLE_TO_SCALAR
CreateAttributeMap
CreateEnumerate
CreateObject
CreateThroughputData
With the factory, you can create a whole list of typical Test.Lab objects. The
same functionality can also be found in other places (for backwards
compatibility reasons) .
Factory interfaces
COMPLEX_TO_SCALAR
Signature
COMPLEX_TO_SCALAR(Real As Double, Imag As Double, Quantity As
IQuantity, UnitSelection As CONST_EnumUnitSelection = UserUnits) As
IScalar
Description
This function creates a IScalar, starting from its real and imag value and its
quantity. The value can be specified in user units and in MKS, depending on the
UnitSelection.
DOUBLE_TO_SCALAR
Signature
DOUBLE_TO_SCALAR(Value As Double, Quantity As IQuantity,
UnitSelection As CONST_EnumUnitSelection = UserUnits) As IScalar
Description
This function creates a IScalar, starting from its value and its quantity. The
value can be specified in user units and in MKS, depending on the
UnitSelection.
Rev 13A 93
Chapter 5 Reference guide
CreateAttributeMap
Signature
CreateAttributeMap() As IAttributeMap
Description
This function returns an integer, representing the current value of the enum
object.
CreateEnumerate
Signature
CreateEnumerate(DesiredEnumType As String, Value As Object = Nothing) As
Enumerate
Description
This function can be used to create an Test.Lab enum type. The internal type of
the enum has to be specified. The Value of it can also be specified, both as an
int and as a string (= local value). If no value is specified, a default value is
taken.
CreateObject
Signature
CreateObject(DesiredType As String, Attributes As IAttributeMap) As IData
Description
This function returns an attributemap, containing all possible values of the
enumerate. The name of the items of the range are the possible stringvalues it
can have, the content of its items the possible numbers where it corresponds
with.
CreateThroughputData
Signature
CreateThroughputData(TdfFileName As String) As IData
Description
This function returns an IData object, openened from the data file, given as
parameter.
Definition
Properties
XCount
XValues
XAxisId
YValues
YAxisId
RealYValues
XQuantity
YQuantity
Header
Label
UserAttributes
Properties
Methods
ReplaceXDoubleValues
ReplaceXEquidistantValues
ReplaceXIntValues
ReplaceXEquidistantIntValues
ReplaceXEquidistantDoubleValues
ReplaceXQuantity
DeleteXAxis
ReplaceYComplexValues
ReplaceYDoubleValues
ReplaceYIntValues
ReplaceYEquidistantIntValues
ReplaceYEquidistantDoubleValues
ReplaceYQuantity
ReplaceHeader
ReplaceUserAttributes
Rev 13A 95
Chapter 5 Reference guide
IBlock2 interfaces
XCount
Signature
XCount As Integer
Type
Read-only
Description
Returns the number of X-axes in the block.
Since it is possible to define more then 1 x-axis on a block, this functionality
learns how many x-axes there actually are on the block.
Example
Dim number_of_axes as Integer
number_of_axes = BlockData.XCount
XValues
Signature
XValues(ac_nIndex As Integer = 0) As Array
Type
Read-only
Description
Returns an array of double values, holding all the values of the axisNumberth
X-axis. If no axis index is specified the values of the first one are returned.
Index values are zero-based.
Example
If BlockPort.Data.Type =
"LmsHq::DataModelI::Expression::CBufferIBlock" Then
Dim BlockData As LMSTestLabAutomation.IBlock
BlockData = BlockPort.Data
'Get the X-values
Dim xval() As Double
xval = BlockData.Xvalues(1)
length = UBound(xval) - LBound(xval) + 1
End If
XAxisId
Signature
XAxisId(ac-nIndex as Integer) As String
Type
Read-only
Description
Returns the ID of the nth x-axis.
YValues
Signature
YValues As Double
Type
Read-only
Description
Returns a two-dimensional array of double values, holding in its first dimension
all real values and in the second dimension all imaginary values of the Y-axis.
YAxisId
Signature
YAxisId As String
Type
Read-only
Description
Returns the ID of the y-axis.
Rev 13A 97
Chapter 5 Reference guide
RealYValues
Signature
RealYValues As System.Array
Type
Read-only
Description
Returns only the real part of the y-values.
XQuantity
Signature
XQuantity(ac_nIndex As Integer = 0) As IQuantity
Type
Read-only
Description
Gets quantity for the xisNumberth X-axis. Default value for n is zero, which is
the first one.
Example
Read in the label of the unit of the Y-Axis
Dim XUnitLabel As String
XUnitLabel =
TestLab.UnitSystem.Label(BlockData.Xquantity(1))
YQuantity
Signature
YQuantity As IQuantity
Type
Read-only
Description
Gets the Y-axis quantity.
Example
Dim YUnitLabel As String
YUnitLabel = TestLab.UnitSystem.Label(BlockData.YQuantity)
Header
Signature
Header As IHeader
Type
Read-only
Description
Returns the header of the data block. This is for advanced users only: normally
a user works via the properties!
Example
BlockData = BlockPort.Data
Dim Blockheader As LmsTestLabAutomation.IHeader
Blockheader = BlockData.Header
Label
Signature
Label As String
Type
Read-only
Description
Returns the label of the data block.
UserAttributes
Signature
UserAttributes As IAttributeMap
Type
Read-only
Description
Shows the user attributes of this object. The attribute values are returned in an
AttributeMap. There is no application context limitation on the contents of the
'UserAttributes' list, and can be extended freely to host additional information.
This means that the application does not use the contents of the userattributes to
interpret the measurement data, as opposed to the header object.
Note: For UPA users: since headers in CADA-X were fixed and contained some
unused fields, depending on the type of blocks it described, these fields were
'used' to store some user annotation. In Test.Lab the header contains only those
fields essential for the application to interpret the data, these rarely need to be
modified.
All user annotation can be safely stored and retrieved in the UserAttributes.
Example
Dim BlockData As LMSTestLabAutomation.IBlock
BlockData = BlockPort.Data
Dim user_attributes as LMSTestLabAutomation.AttributeMap
user_attributes = BlockData.UserAttributes
Properties
Signature
Properties As IAttributeMap
Type
Read-only
Rev 13A 99
Chapter 5 Reference guide
Description
Shows the properties of this object. The properties are returned in an
AttributeMap object.
Shows some property values. They are a predefined, application dependent of
name value pairs. The information presented is a summary of information
coming from header, axis and user attributes.
ReplaceXDoubleValues
Signature
ReplaceXDoubleValues(ac_xXValues As System.Array, ac_nIndex As Integer
= 0) As IBlock2
Description
This method creates a new IBlock2 object based upon the old block, but with
the X- MKS-values of the 'axisindex'-th axis replaced by the specified array of
doubles. If omitted AxisIndex = 0;
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
Dim array_of_double_values () as Integer
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceXDoubleValues (
array_of_double_values,2 )
ReplaceXEquidistantValues
Signature
ReplaceXEquidistantValues(ac_dStart As Double, ac_dIncrement As Double,
ac_nNumberOfValues As Integer = 0) As IBlock2
Description
Replaces the ' ac_dStart '-th X-axis with an equidistant one, starting with the
Double ac_dStart and increment ac_dIncrement. If omitted, nNumberOfValues
= 0;
ReplaceXIntValues
Signature
ReplaceXIntValues(ac_xValues As System.Array, ac_nIndex As Integer = 0)
As IBlock2
Description
This method creates a new IBlock2 object based upon the old block, but with
the X- MKS-values of the 'axisindex'-th axis replaced by the specified array of
integers. If omitted AxisIndex = 0;
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
Dim array_of_int_values() as Integer
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceXDoubleValues (
array_of_int_values,2 )
ReplaceXEquidistantIntValues
Signature
ReplaceXEquidistantIntValues(ac_nStart As Integer, ac_nIncrement As Integer,
ac_nIndex As Integer = 0) As IBlock2
Description
Replaces the ' ac_nIndex '-th X-axis with an equidistant one, starting with the
integer ac_nStart and increment ac_nIncrement. If omitted, ac_nIndex = 0.
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceXEquidistantIntValues (16,2,2 )
ReplaceXEquidistantDoubleValues
Signature
ReplaceXEquidistantDoubleValues(ac_nStart As Integer, ac_nIncrement As
Integer, ac_nIndex As Integer = 0) As IBlock2
Description
Replaces the ' ac_nIndex '-th X-axis with an equidistant one, starting with the
double ac_nStart and increment ac_nIncrement. If omitted, ac_nIndex = 0.
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceXEquidistantDoubleValues
(10.3,2.5,2 )
ReplaceXQuantity
Signature
ReplaceXQuantity(ac_xXQuantity As IQuantity, ac_nIndex As Integer = 0) As
IBlock2
Description
Replaces the quantity of the ‘ac_nIndex ‘-th X-axis with the specified one. If
omitted, ac_nIndex = 0.
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceXQuantity (new_tl_quantity )
DeleteXAxis
Signature
DeleteXAxis(ac_nIndex As Integer = 0) As IBlock2
Description
Deletes the specified X-axis. If no index is specified the first one is taken as
default.
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. DeleteXAxis (1 )
ReplaceYComplexValues
Signature
ReplaceYComplexValues(ac_xYValues As System.Array) As IBlock2
Description
This method creates a new IBlock2 object based upon the old block, but with
the Y-values replaced by the specified two-dimensional array of doubles. First
dimension will contain the real, second the imaginary values.
Note: The Y-Values must be expressed in MKS, and not in User Unit values
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
Dim array_of_ complex _values (2)() as Integer
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceYComplexValues (
array_of_complex_values)
ReplaceYDoubleValues
Signature
ReplaceYDoubleValues(ac_xYValues As System.Array) As IBlock2
Description
This method creates a new IBlock2 object based upon the old block, but with
the real Y-values replaced by the specified one-dimensional array of doubles.
Note: The Y-Values must be expressed in MKS, and not in User Unit values
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
Dim array_of_double_values () as Integer
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceYDoubleValues (
array_of_double_values)
ReplaceYIntValues
Signature
ReplaceYIntValues(ac_xYValues As System.Array) As IBlock2
Description
Replaces the Y-axis with the values in the passed array of integers and return
the newly created IBlock2 object.
Note: The Y-Values must be expressed in MKS, and not in User Unit values
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
Dim array_of_int_values() as Integer
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceYDoubleValues (
array_of_int_values)
ReplaceYEquidistantIntValues
Signature
ReplaceYEquidistantIntValues(ac_nStart As Integer, ac_nIncrement As Integer)
As IBlock2
Description
Replaces the Y-axis with an equidistant one, starting with the integer
NewStartYValue and increment YaxisIncrement.
Note: The Y-Values must be expressed in MKS, and not in User Unit values
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceYEquidistantIntValues (16,2)
ReplaceYEquidistantDoubleValues
Signature
ReplaceYEquidistantIntValues(ac_nStart As Integer, ac_nIncrement As Integer)
As IBlock2
Description
Replaces the Y-axis with an equidistant one, starting with the double
NewStartYValue and increment YaxisIncrement.
Note: The Y-Values must be expressed in MKS, and not in User Unit values
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
NewBlock = TlBlock. ReplaceYEquidistantIntValues (10.3,2.5)
ReplaceYQuantity
Signature
ReplaceYQuantity(ac_xYQuantity As IQuantity) As IBlock2
Description
Replaces the quantity of the Y-axis with the specified one, and returns the
newly created block.
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
...
Dim NewBlock as LMSTestLabAutomation.IBlock2
ReplaceHeader
Signature
ReplaceHeader(ac_xHeader As IHeader) As IBlock2
Description
Creates a new IBlock2 object, based on the original one, with only the header
object replaced with the passed NewHeader.
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
Dim NewBlock as LMSTestLabAutomation.IBlock2
Dim ModifiedHeader as LMSTestLabAutomation.IHeader
...
ModifiedHeader = OrigHeader.Edit((
"HeaderFieldZ",UpdatedvalueforZ )
NewBlock = TlBlock. ReplaceHeader (ModifiedHeader)
ReplaceUserAttributes
Signature
ReplaceUserAttributes(ac_xAttributeMap As AttributeMap) As IBlock2
Description
Creates a new IBlock2 object, based on the original one, with only the user
attributes replaced with the passed NewUserAttributes.
Example
Dim TlBlock as LMSTestLabAutomation.IBlock2
Dim ModifAttrib as LMSTestLabAutomation.AttributeMap
ModifAttrib = TlBlock.UserAttributes
ModifAttrib.Add("MyOwnAnnotation","VehicleType ABC")
Dim NewBlock as LMSTestLabAutomation.IBlock2
...
NewBlock = TlBlock. ReplaceUserAttributes (ModifAttrib)
Definition
Properties
ActiveMinorWatch
ActiveAlternativeWatch
ActiveSectionName
ActiveSectionWatch
ActuveSheetWatch
AkternativeOnTop
ID
MinorOnTop
SheetOnTop
Sheets
Methods
Close
CreateDataWatch
Database
FindDataWatch
NewSection
Save
SaveAsTemplate
SwitchSection
IBook interfaces
ActiveMinorWatch
Signature
ActiveMinorWatch As Watch
Type
Read-only
Description
This property returns a watch to the Minor sheet. It’s possible to define a
"Value-Changed’ callback on this watch, that will be fired the moment the
operator changes the active minor sheet.
An example of minor sheets is: "Project Info" or "Section Info" in the
Documentation sheet.
ActiveAlternativeWatch
Signature
ActiveAlternativeWatch As Watch
Type
Read-only
Description
This property returns a watch to the Alternative sheet. It is possible to define a
"Value-Changed’ callback on this watch, that will be fired the moment the
operator changes the active alternative sheet.
ActiveSectionName
Signature
ActiveSectionName As String
Type
Read-only
Description
This property will hold the currently active section name for the book of which
you retrieve this property.
Example
Dim Selected_book As LMSTestLabAutomation.IBook
Selected_book = TestLab.Books(0)
SectionName = Selected_book.ActiveSectionName
ActiveSectionWatch
Signature
ActiveSectionWatch As Watch
Type
Read-only
Description
This property returns a watch to the Active Section. It is possible to define a
"Value-Changed’ callback on this watch, that will be fired the moment the
Example
Dim ActiveSheet as LMSTestLabAutomation.Watch
ActiveSheet = TestLab.ActiveBook.ActiveSheetWatch
Currentsheetname = ActiveSheet.Data
'reads the currently active sheetname
ActiveSheet.Data = "Measure"
'sets the Measure sheet on top
AlternativeOnTop
Signature
AlternativeOnTop As Object
Type
Write-only
Description
Brings the specified alternative sheet on top.
An example of an ‘alternative sheet’: on the ‘Channel Setup’ sheet, these are
alternative sheets: ‘Channel Setup’, ‘Use Database’, ‘Read TEDS’, ‘Bridge
Settings’, ‘Use Geometry’.
Example
gAppl.ActiveBook.MinorOnTop = "Use Database"
ID
Signature
ID As String
Type
Read-only
Description
Returns the ID of the book.
MinorOnTop
Signature
MinorOnTop As Object
Type
Write-only
Description
Brings the specified Minor sheet on top.
An example of minor sheets is: "Project Info" or "Section Info" in the
Documentation sheet.
Example
gAppl.ActiveBook.MinorOnTop = "Section Info"
SheetOnTop
Signature
SheetOnTop As Object
Type
Write-only
Description
A book presents a number of sheets to the user to offer some process guidance,
sequencing support, run-time add-in functionality, etc. Once a book is
instantiated, there is always one single sheet selected and drawn as the active
one. The UI content of the active sheet is the one that gets shown.
The property 'SheetOnTop' can be used to retrieve the localized name of the
active sheet. Setting this property however instructs the application to switch to
the indicated sheet. It can be to the localized name of the sheet or to its index
Note: The index to be used is the sheet sequence number, as it occurs in the
initial list of sheets. So if a sheet was moved forward or backwards, by means of
Tools Workbook Configuration ... its index still stays the same.
Example
Dim List_of_sheets as LMSTestLabAutomation.ISheets
List_of_sheets = TestLab.ActiveBook.Sheets
Close
Signature
Close()
Description
Closes the book on which the method was issued. This method will remove all
runtime data from the Test.Lab application without saving any. If saving data is
required, use the, previously described, 'Save' method on the same IBook object.
Example
Dim Open_book as LMSTestLabAutomation.IBook
TestLab.OpenProject("c:/MyProject/PRJ1234.lms")
Open_book = TestLab.ActiveBook
...
Open_book.Close()
CreateDataWatch
Signature
CreateDataWatch(ID As String, PortDataType As String, WatchType As
CONST_EnumDataWatchType = CONST_DataWatchTypeData, IsPersistent
As Integer = 0, MaxUpdateFrequency As Integer = 1000, IsVisible As Integer =
1, IsAutoBuffered As Integer = 1, InitialFiring As Integer = 1) As IDataWatch
General Port ID: ID of the port.
DataType: Type of data the port can hold.
IsPersistent: Boolean value to specify if the value on the port has been saved
upon saving the project.
MaxUpdateFrequency: the interval, specified in milliseconds, with which the
system will check the contents of the port and notify the client application if the
value on the port has changed since the previous check. Default is 1000.
IsAutoBuffered: a Boolean value to indicate that the value returned from the
datawatch needs to be returned as a buffered, normalized type. Default is 1 is
autobuffered.
IsVisible: a Boolean value to indicate whether the port should be visible in the
'online-data' of the Test.Lab GUI. Default is 1 is visible.
Description
Modules communicate by means of ports. All Test.Lab applications implicitly
define a of ports to allow their modules to communicate. Next to these
predefined ports, a user can create his own ports. Such externally created ports
can be used to store data to the active section, or to drag and drop into a
Test.Lab display.
When the user creates a port at runtime, it can be found in the 'Online-Data'
section in the navigator sheet. Once a port is created is treated no different from
any other predefined one and can be dragged and dropped in a display for
instance. Once it is dropped the display will get notified whenever the data on
de port changes. Independent whether the data comes from another Test.Lab
module or an external application.
Example
Dim MyOwn_Port as LMSTestLabAutomation.DataWatch
MyOwn_Port =
TestLab.ActiveBook.CreateDataWatch("BreakSqual_Analysis_Res
ult")
Database
Signature
Database() As IDatabase
Description
This method allows a client application to have access to a project database,
without opening it in a new workbook. The interface IDatabase has all the
functionality of the project database.
Example
Dim TL_DB As LMSTestLabAutomation.IDatabase
TL_DB = TestLab.ActiveBook.Database
FindDataWatch
Signature
FindDataWatch(DataPathName As String, MaxUpdateFrequency As Integer =
1000, IsAutoBuffered As Integer = 1, InitialFiring As Integer = 1) As
IDataWatch
General Port ID: ID of the port.
MaxUpdateFrequency: the interval, specified in milliseconds, with which the
system will check the contents of the port and notify the client application if the
value on the port has changed since the previous check. Default is 1000.
IsAutoBuffered: a Boolean value to indicate that the value returned from the
datawatch needs to be returned as a buffered, normalized type.
Description
Each book has its own of DataWatches. With the function "FindDataWatch",
they can be retrieved.
A user can have different books running, when, for instance, preparing a setup
in one while launching a measurement in another one. In such scenarios,
pushing a start- measure button in one book shouldn't be communicated out of
the boundaries of that one book.
A 'FindDataWatch' call for 'measurement_start' on book1 will return a different
Example
Dim Spectral_Start_Measure_Port as
LMSTestLabAutomation.DataWatch
Spectral_Start_Measure_Port =
TestLab.ActiveBook.FindDataWatch("Start_Measure")
NewSection
Signature
NewSection(av_sSectionName As String)
Description
Creates a new section on the project associated with this book object. This
method has the same effect as if a user would go to Data New Section....
An error status will be returned when the supplied name is the name of an
existing section.
Example
TestLab.OpenProject("c:/MyProject/PRJ1234.lms")
Open_book = TestLab.ActiveBook
Open_book.NewSection("MyAutomationSession")
Save
Signature
Save(ac_SaveAsName As Object = Nothing, Compress As Integer = 0)
Description
Saves all application related information to the active project, with which the
book was created.
When an explicit filename is provided as parameter, the 'Save' method will act
as a 'save as'. If not, it will be saved with the same name as the one it was
opened with. Should the book be created on a temporary project, e.g. with the
CreateProject method, the 'Save' will return an error.
The optional <compress> parameter indicates whether the database should be
compressed upon saving or not. Default value is FALSE.
Example
TestLab.OpenProject("c:/MyProject/PRJ1234.lms")
Open_book = TestLab.ActiveBook
...
Open_book.Save("c:/MyProject/Updated_PRJ1234.lms")
SaveAsTemplate
Signature
SaveAsTemplate(ac_szSaveAsTemplateName As String,
ac_bSaveWithoutMeasuredData As Integer = 1)
Description
This function saves the book as a template project. The name of the template
can be specified. The optional parameter "SaveWithoutMeasuredData" gives
the opportunity to save the measured data or not.
SwitchSection
Signature
SwitchSection(av_sSectionName As String)
Description
Switches all settings data of the book to that in the specified section on the
project associated with this book object. This method has the same effect as if a
user would select a different section name in the toolbar.
An error status will be returned when the supplied name does not exist as
section.
Example
TestLab.OpenProject("c:/MyProject/PRJ1234.lms")
Open_book = TestLab.ActiveBook
Open_book.SwitchSection("Section2")
Definition
Properties
Count
Item
IBooks interfaces
Count
Signature
Count As Integer
Type
Read-only
Description
Returns the number of books currently running in the application. This allows
you to iterate all running instances.
Example
Dim List_of_opened_books As LMSTestLabAutomation.IBooks
number_of_books = List_of_opened_books.Count
For loopcounter = 1 To number_of_books ...
end for
Item
Signature
Item(index As Object) As Object
Type
Read-only
Description
Using the Item property you can retrieve a specific book. The desired book can
be indicated by passing an sequence number n to the 'Item' property, saying give
me a reference to the nth book.
Another way of retrieving a book from the list of books, is by means of its
unique id. Such an id is returned when creating a book. For example when you
have a NewProject or OpenProject.
Example
Dim SingleBook As LMSTestLabAutomation.IBook
SingleBook = List_of_opened_books.Item(1)
SingleBook = List_of_opened_books.Item(Bookid)
SingleBook = List_of_opened_books.Item1
SingleBook = List_of_opened_books.Bookid
All these examples retrieve a book from the available books' list. The last two
are Visual Basic shorthand.
Definition
Methods
BLOCK_ADD
BLOCK_ADD_SCALAR
BLOCK_ARTICULATION_INDEX
BLOCK_AUTOPOWER_SPECTRUM
BLOCK_CONJUGATE_MULTIPLY
BLOCK_CROSSPOWER_SPECTRUM
BLOCK_DIFFERENTIATE
BLOCK_DIVIDE
BLOCK_DIVIDE_SCALAR
BLOCK_FFT
BLOCK_INTEGRATE
BLOCK_INVERSE
BLOCK_LINEARSMOOTHING
BLOCK_LOUDNESS
BLOCK_MULTIPLY
BLOCK_MULTIPLY_SCALAR
BLOCK_OCTAVE
BLOCK_PHASEREFERENCE_SPECTRUM
BLOCK_POL_INTERPOLATE
BLOCK_PULSE
BLOCK_RANDOM
BLOCK_RMS
BLOCK_SAWTOOTH
BLOCK_SHARPNESS
BLOCK_SINE
BLOCK_SMOOTHING
BLOCK_SPECTRUM
BLOCK_SUBTRACT
BLOCK_SUBTRACT_SCALAR
BLOCK_WEIGHTING
BLOCK_WINDOW
COMPLEX_TO_SCALAR
DOUBLE_TO_SCALAR
RECIPROCAL_SWITCH
Properties
AdvancedCmd
This interface provides access to the list of mathematical functions, which you
can perform on different types of Test.Lab data. From 6A on, the standard
interfaces are rewritten, so that they are easy to use.
ICmd interfaces
BLOCK_ADD
Signature
BLOCK_ADD (Source as IBlock2, Operand As IBlock2) As IBlock2
Description
This command allows you to add a Source and an Operand block. The X- axes
of both blocks must be equal, the Y-quantities also.
BLOCK_ADD_SCALAR
Signature
BLOCK_ADD_SCALAR ( Source As IBlock2, Operand as IScalar) As IBlock2
Description
This command allows you to add a 'scalar' to the Source block. The value of the
scalar will be added to all Y-values. The quantity of the scalar must be equal to
the quantity of the X-axes of the block.
BLOCK_ARTICULATION_INDEX
Signature
BLOCK_ARTICULATION_INDEX (Source As IBlock2, ArtMethod As
CONST_EnumArticulationMethod =ArticulationMethodNormal) As IScalar
Description
This calculation will get the Articulation Index out of a 3rd Octave Block.
ArticulationMethod can be normal (default) or open.
BLOCK_AUTOPOWER_SPECTRUM
Signature
BLOCK_AUTOPOWER_SPECTRUM (SourceBlock As IBlock2,
AmplitudeScaling As CONST_EnumAmplitudeScaling = 0, SpectrumFormat
As CONST_EnumSpectrumFormat = 0) As IBlock2
Description
This command does the processing of the Auto Power with given
AmplitudeScaling and SpectrumFormat from a time SourceBlock. If the
SourceBlock already is a spectrum, the result is scaled to the given
AmplitudeScaling and SpectrumFormat.
BLOCK_CONJUGATE_MULTIPLY
Signature
BLOCK_CONJUGATE_MULTIPLY ( Source As IBlock2, Operand As
IBlock2) As IBlock2
Description
This command allows you to do a conjugate multiply between a Source and an
Operand block. The X-axes of both blocks must be equal. The dimensions of
the Y-axes will be added.
BLOCK_CROSSPOWER_SPECTRUM
Signature
BLOCK_CROSSPOWER_SPECTRUM (SourceBlock As IBlock2,
ReferenceBlock As IBlock2, AmplitudeScaling As
CONST_EnumAmplitudeScaling = 0) As IBlock2
Description
This command calculates the Cross Power with given AmplitudeScaling from a
BLOCK_MULTIPLY
Signature
BLOCK_MULTIPLY ( Source As IBlock2, Operand As IBlock2) As IBlock2
Description
This command allows you to multiply a Source and an Operand block. The
X-axes of both blocks must be equal. The dimensions of the Y-axes will be
added.
BLOCK_MULTIPLY_SCALAR
Signature
BLOCK_MULTIPLY_SCALAR (Source As IBlock2, Operand As IScalar) As
IBlock2
Description
This command allows you to multiply a 'scalar' with the Source block. The
value of the scalar will be multiplied to all Y-values. The dimension of the
scalar will be added to the dimension of the X-axes of the block.
BLOCK_OCTAVE
Signature
BLOCK_INTEGRATE(SourceBlock As IBlock2, IntegrateTimes As Long = 1,
IntegrationMethod As CONST_EnumIntegrationMethod =
IntegrationMethodTrapezium) As IBlock2
Description
This command integrates both time signals as spectra. The Integration Method
is only used for time blocks.
BLOCK_PHASEREFERENCE_SPECTRUM
Signature
BLOCK_ PHASEREFERENCE_SPECTRUM (SourceBlock As IBlock2,
ReferenceBlock As IBlock2, AmplitudeScaling As
CONST_EnumAmplitudeScaling = 0) As IBlock2
Description
This command does the calculation of the spectrum with given
AmplitudeScaling from the time SourceBlock. If the SourceBlock already is a
spectrum, the result is scaled to the given AmplitudeScaling. The
PhaseReferenceBlock is used to calculate the phase of the result.
BLOCK_POL_INTERPOLATE
Signature
BLOCK_POL_INTERPOLATE (SourceBlock As IBlock2, ReferenceBlock as
IBlock2, NrOfXaxes As Int =0, InterpolationMethod as
CONST_EnumInterpolationMethod InterpolationMethod =
InterpolationMethodLinXLinY) As IBlock2
Description
This calculation interpolates the SourceBlock to the same axis as the
ReferenceBlock. If your ReferenceBlock contains a multivariable x-axis, you
can indicate which axis to use by NrOfXAxis. Also the interpolation method
can be specified.
BLOCK_PULSE
Signature
BLOCK_PULSE(Duration As IScalar, OffAs IScalar, Samplerate As Double,
PulseLength As IScalar, PulsePeakLevel As IScalar, PulseRaiseTime As
Double, PulseFallTime As Double, PulseRepetitionRate As Long, PulseType
As CONST_EnumPulseType = PulseTypeHalf_Sine) As IBlock2
Description
This command creates a transient pulse signal in time for a given sample rate.
The duration and the offare scalars in quantity time. The PulseRepetitionRate
indicates the number of pulses during the complete duration! The Peaklevel is a
scalar, indicating the maximum level of the pulse.
BLOCK_RANDOM
Signature
BLOCK_RANDOM (Duration As IScalar, OffAs IScalar, SampleRate As
Double) As IBlock2
Description
This command creates a random time signal with a specific Samplerate.
Duration and Offare Scalars with quantity time.
BLOCK_RMS
Signature
BLOCK_RMS(SourceBlock As IBlock2, LowerX As IScalar, UpperX As
IScalar) As IScalar
Description
Returns the RMS value of a block between 2 x-axis points. Those 2 points
(LowerX and UpperX) are scalars, with the same quantity as the x-axis of the
SourceBlock. The result is an IScalar.
BLOCK_SAWTOOTH
Signature
BLOCK_SAWTOOTH(Duration As IScalar, OffAs IScalar, Samplerate As
Double, Amplitude As IScalar, Frequency As IScalar, Width As IScalar,
DcLevel As IScalar) As IBlock2
Description
This command creates a saw tooth in time for a given Samplerate. Duration,
Offand Width are scalars in quantity time. The amplitude and the DcLevel are
scalars, indicating the minimum level and the amplitude. Frequency is a scalar
with quantity frequency.
BLOCK_SHARPNESS
Signature
BLOCK_SHARPNESS (Block As IBlock2, in SoundField asEnumSoundField
SoundField = SoundFieldDiffuse) As IScalar
Description
This calculation will get the sharpness out of a 3rd octave Block. If the Y- axis is
complex, only its real values will be taken into account. The parameter
SoundField indicates how the data was achieved: in the "free field" or in the
"diffuse field".
BLOCK_SINE
Signature
BLOCK_SINE (Duration As IScalar, OffAs IScalar, Samplerate As Double,
Amplitude As IScalar, Frequency As IScalar, PhaseShift As IScalar) As
IBlock2
Description
This command creates a sine wave time signal with a specific Samplerate.
Duration and Offare scalars with quantity time. Frequency is a scalar with
quantity frequency. PhaseShift is a scalar in quantity Angle. The amplitude is a
scalar, indicating the maximum amplitude.
BLOCK_SMOOTHING
Signature
BLOCK_SMOOTHING ( Source As IBlock2, AveragingParameter As Double)
As IBlock2
Description
The Block will be transformed to a smoother one by using exponential
averaging. The Averaging parameter is a weighting function between 0 and 1. 0
implies no smoothing.
BLOCK_SPECTRUM
Signature
BLOCK_SPECTRUM (SourceBlock As IBlock2, AmplitudeScaling As
CONST_EnumAmplitudeScaling =0) As IBlock2
Description
This command does the calculation of the spectrum with given
AmplitudeScaling from the time SourceBlock. If the SourceBlock already is a
spectrum, the result is scaled to the given AmplitudeScaling.
BLOCK_SUBTRACT
Signature
BLOCK_SUBTRACT (Source as IBlock2, Operand as IBlock2) AsIBlock2
Description
This command allows you to subtract the Operand block from the Source block.
The X-axes of both blocks must be equal, the Y-quantities also.
BLOCK_SUBTRACT_SCALAR
Signature
BLOCK_SUBTRACT_SCALAR ( Source As IBlock2, Operand As IScalar) As
IBlock2
Description
This command allows you to subtract a 'scalar' to the Source block. The value of
the scalar will be subtracted from all Y-values. The quantity of the scalar must
be equal to the quantity of the X-axes of the block.
BLOCK_WINDOW
Signature
BLOCK_WINDOW (ReferenceBlock As IBlock2, Window As
CONST_EnumWindowType) As IBlock2
Description
The result of this command is a window in time that can be applied on the
ReferenceBlock (being a time block).
BLOCK_WEIGHTING
Signature
BLOCK_WEIGHTING (SourceBlock As IBlock2, WeightType As
CONST_EnumWeighting) As IBlock2
Description
This command applies weighting to a block, both in time as in frequency
domain. Weighting A, B, C, NONE are possible WeightTypes for time signals
Weighting A, B, C, D, AB, BC, NONE are possible weightings for spectrums.
COMPLEX_TO_SCALAR
Signature
COMPLEX_TO_SCALAR(Real As Double, Imag As Double, Quantity As
IQuantity, UnitSelection As CONST_EnumUnitSelection = UserUnits) As
IScalar
Description
This commands creates a scalar from a complex value and its quantity. The
value can be entered in MKS or in the User Units of the quantity. Internally, the
MKS value is stored.
DOUBLE_TO_SCALAR
Signature
DOUBLE_TO_SCALAR(Value As Double, Quantity As IQuantity,
UnitSelection As CONST_EnumUnitSelection = UserUnits) As IScalar
Description
This commands creates a scalar from a single value and its quantity. The value
can be entered in MKS or in the User Units of the quantity. Internally, the MKS
value is stored.
RECIPROCAL_SWITCH
Signature
RECIPROCAL_SWITCH(OriginalBlock As IBlock2, ModifySignOfPhase As
Integer) As IBlock2
Description
Signature
AdvancedCmd As ICmd
Type
Read-only
Description
This property gives you access to some advanced commands, via the interface
IAdvancedCmd. The list of functions available here is a dynamic list: it will be
extended regularly. If you have Block commands implemented in 5A or earlier,
they can be retrieved here: this replaces the earlier ICmd.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Definition
Methods
AddAttachment
AddFolder
AddItem
AddMemo
AddProperties
AddRun
AddSection
Delete
GetAttachment
GetBridgeElement
GetItem
GetMemo
GetProperties
Rename
Save
Properties
ProjectName
ElementNames
ElementType
SectionNames
IDatabase interfaces
This interface allows you to interact with 'offline' databases stored on disk and
those, which are 'online' that is open in a workbook. There are two ways of
getting a hold of such an object:
Explicitly refer to a database on the file system.
Dim TL_DB As LMSTestLabAutomation.IDatabase
TL_DB =
TestLab.Database(e:\local\data\Archive\PRJ990604.lms"")
Refer to an active project associated with an open book.
Dim TL_DB As LMSTestLabAutomation.IDatabase
TL_DB = TestLab.ActiveBook.Database
A Test.Lab Project Database is a hierarchical structure, which contains two
kinds of hierarchical elements, being 'folders' and 'items'. An item is a
hierarchical endpoint, which contains binary system or user information, while a
folder is a hierarchical structure, which in turn can contain hierarchical
elements. This can be compared with the representation of any normal file
system, thus consisting of directories or folders and files or items.
Project structure
Let us take the tree view on the 'Navigator' sheet in a Test.Lab application to
inspect the Project Database. The red text box points out to the root of the
hierarchical structure of the project database associated with this book. The
black text boxes refer to some of the different folders. Next to general folders
such as the "frequencies" there are two predefined type of folders. First of all
there is the folder that holds the section information (e.g. "Section2" in the
example above) and secondly there is the 'Run' folder, which can hold some
snapshot information associated with one single run.
The blue text box represents an item, containing any type of data.
Attachments
The Test.Lab project database can also embed user informational items like an
attachment or a memo. The above figure shows the visual representation of an
attachment and a memo.
AddAttachment
Signature
AddAttachement(PathToTop As String, AttachmentName As String,
AttachmentFilePath As String)
Description
Embeds the contents of any file as an attachment item on the hierarchical path
in the database. An error is returned if there is already such an item on the
specified path.
AddFolder
Signature
AddFolder(PathToTop As String, Name As String
,PropertyContainer As AttributeMap)
Description
Adds a folder entry to the database project on the given PathToTop. An error is
returned if there is already a folder on the specified path.
AddItem
Signature
AddItem(PathToTop As String, Name As String, Value As IData
,PropertyContainer As AttributeMap ,Override As Boolean =
false)
Description
Adds a data entity to the database project on the given PathToTop. The default
is not to override existing items. In this case an error is returned that there was
an attempt to do so. An error is returned if the PathToTop is invalid.
AddMemo
Signature
AddMemo(PathToTop As String, MemoName As Object = Nothing,
MemoPathName As Object = Nothing)
Description
Adds a memo to the database project on the given PathToTop.
AddProperties
Signature
AddProperties(PathToTop As String, PropertyContainer As
AttributeMap , OverrideIfExists As Boolean = true)
Description
Adds properties to the existing property associated with the database element.
Existing properties will be overridden depending on the setting of the
OverrideIfExists flag. The default value is true. An error is returned if there is
no item on the path specified.
AddRun
Signature
AddRun(PathToTop As String, NewName As String, ac_xPropertyContainer
As Object = Nothing)
Description
Adds properties to the database project on the given PathToTop.
AddSection
Signature
AddSection (NewName As String)
Description
Adds a section to the database in a Test.Lab application independent way, there
will be no settings copied to the newly created section. For creating new
sections and having them taking over settings of a previous section, you can use
'NewSection' on IBook for any specific workbook, since it is part of the
knowledge of each application.
Delete
Signature
Delete(PathToTop As String)
Description
Deletes any type of element (folder or data entity) in the database hierarchy
specified by path. An error is returned if there is no item on the path specified.
GetAttachment
Signature
GetAttachment(PathToTop As String) As String
Description
Retrieves the attachment stored in a Test.Lab database on the hierarchical path
specified by PathToTop. This method returns the pathname to a temporary file,
where the attachment content has been expanded. An error is returned if the
PathToTop is invalid or if the pointed element does not contain an attachment.
GetBridgeElement
Signature
GetBridgeElement(PathToTop As String) As IData
Description
Function to get a bridge element by specifying its top path.
GetItem
Signature
GetItem(PathToTop As String) As IData
Description
Retrieves the value entity stored in a Test.Lab database on the hierarchical path
specified by PathToTop. An error will be returned if the PathToTop is invalid or
if the pointed element is not an hierarchical endpoint.
GetMemo
Signature
GetMemo(PathToTop As String) As String
Description
Retrieves the memo stored in a Test.Lab database on the hierarchical path
specified by PathToTop. This method returns the pathname to a temporary file,
where the memo content has been expanded. An error is returned if the
PathToTop is invalid or if the pointed element does not contain an memo.
GetProperties
Signature
GetProperties(PathToTop As String) As AttributeMap
Description
Returns the complete property associated with a database element. An error is
returned if there is no item on the path specified.
Rename
Signature
Rename(PathToTop As String, NewName As String)
Description
Renames an element on the hierarchical path to the root of the database and
changes the name to NewName. An error is returned if there is no item on the
path specified.
Save
Signature
Save()
Description
Saves the Database object and its changes to disc.
AddToInputBasket
Signature
AddToInputBasket(ByVal PathToTop As String)
Description
Adds an element available in database to input basket. PathToTop is path to
element available in database.
ProjectName
Signature
ProjectName As String
Type
Read-only
Description
Returns the full path name, including the name of the project itself.
ElementNames
Signature
ElementNames(PathToTop As String) As AttributeMap
Type
Read-only
Description
Returns the list of element names contained in a folder, pointed to by the
PathToTop, in the database hierarchical structure. An error will be returned if
the PathToTop is invalid or if the pointed element is not an hierarchical folder.
ElementType
Signature
ElementType(PathToTop As String) As String
Type
Read-only
Description
Returns the type of an database element on the hierarchical level as string. An
error will be returned if there is no item on the path specified. .
Examples of possible database element types are:
"section"
"block"
"waterfall"
"run"
SectionNames
Signature
SectionNames As AttributeMap
Type
Read-only
Description
Returns the list of element names contained in a folder, pointed to by the
PathToTop, in the database hierarchical structure. An error will be returned if
the PathToTop is invalid or if the pointed element is not an hierarchical folder.
Definition
Methods
Elements
GetItem
GetProperties
Properties
ElementType
ElementLabel
IDataBrowser interfaces
Elements
Signature
Elements(PathToTop As String, Labels() As String, IDs() As
String)
Description
This function returns the list of element labels and IDs contained in folder,
pointed by PathToTop.
GetItem
Signature
GetItem(PathToTop As String, PathAsLabels As Long = 1) As IData
Description
This function retrieves the value entity stored in a datafile on the hierarchical
path specified by PathToTop.
GetProperties
Signature
GetProperties(PathToTop As String) As AttributeMap
Description
This function returns the complete property associated with a data element on
path 'PathToTop'.
AddToInputBasket
Signature
AddToInputBasket(ByVal PathToTop As String)
Description
Adds an element available in browser to input basket. PathToTop is path to
element currently being browse in browser.
ElementType
Signature
ElementType(PathToTop As String) As String
Type
Read-only
Description
Returns the type of an database element on the hierarchical level as a string.
ElementLabel
Signature
ElementLabel(PathToTop As String) As String
Type
Read-only
Description
Returns the label of an database element on the hierarchical level as a string.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Definition
Properties
Browser
NetworkBrowser
Search
InputBasket
TecManagerBrowser
Workspace
datawatch_expl =
TL.ActiveBook.FindDataWatch("Navigator_Explorer")
my_eplorer = datawatch_expl.Data
IExplorer interfaces
Browser
Signature
Browser(DataFilePath As String) As IDataBrowser
Type
Read-only
Description
This function returns a DataBrowser object. This way, you can have access to
all data on "My Computer".
NetworkBrowser
Signature
NetworkBrowser As IDataBrowser
Type
Read-only
Description
This function returns a Network DataBrowser object. This way, you can have
access to all data that is on your ‘Network’. The "Network hub" add-in should
be loaded and configured (more information about the Network hub: see Help
for desktop).
Search
Signature
Search As SearchEngine
Type
Read-only
Description
This function returns a search engine object that allows launching searches.
InputBasket
Signature
InputBasket() As nputBasket
Type
Read-only
Description
This function returns an input basket object that allows inputbasket interaction.
TecManagerBrowser
Signature
TecManagerBrowser() As IDataBrowser
Type
Read-only
Description
This function returns a DataBrowser object.
Workspace
Signature
Workspace As Workspace
Type
Read-only
Description
This function returns a Workspace object.
Definition
Methods
AddComponent
AddComponentLine
AddComponentNode
AddComponentNodes
AddComponentQuad
AddComponentTria
AddLine
AddNodeAddNodes
AddQuadAddTria
ComponentLines
ComponentNodesValues
ComponentNodeValues
ComponentQuads
ComponentsValues
ComponentTrias
ComponentValues
DeleteComponent
DeleteComponentNode
DeleteComponentNodes
DeleteNode
DeleteNodes
EditComponent
EditComponentNodesValues
EditComponentNodeValues
EditNodesValues
EditNodeValues
Lines
NewGeometry
NodesValues
NodeValues
Quads
Trias
Properties
ComponentNames
ComponentNodeNames
NodeNames
IGeometry interfaces
AddComponent
Signature
AddComponent(ComponentName As String, X As Double, Y As Double,
Z As Double, XY As Double, XZ As Double, YZ As Double, AxisType
As CONST_EnumGeomAxisType = Cartesian) As IGeometry
Description
With this method, you add a component to a geometry, the result is a new
geometry object.
AddComponentLine
Signature
AddComponentLine(ComponentName As String, NodeName1 As
String, NodeName2 As String) As IGeometry
Description
Add a line to a component. The result is a new geometry object.
AddComponentNode
Signature
AddComponentNode(ComponentName As String, NodeNames As
String, X As Double, Y As Double, Z As Double, XY As Double,
XZ As Double, YZ As Double, LocalCoordinates As Long = 1) As
IGeometry
Description
Add a node to a component. The result is a new geometry object.
AddComponentNodes
Signature
AddComponentNodes(ComponentName As String, NodeNames() As
String, X() As Double, Y() As Double, Z() As Double, XY() As
Double, XZ() As Double, YZ() As Double, LocalCoordinates As
Long = 1) As IGeometry
Description
Add a list of nodes to a component. The result is a new geometry object.
AddComponentQuad
Signature
AddComponentQuad(ComponentName As String, NodeName1 As
String, NodeName2 As String, NodeName3 As String, NodeName4 As
String) As IGeometry
Description
Add a quad component to the geometry.
AddComponentTria
Signature
AddComponentTria(ComponentName As String, NodeName1 As
String, NodeName2 As String NodeName3 As String) As IGeometry
Description
Add a tria component to the geometry.
AddLine
Signature
AddLine(NodeName1 As String, NodeName2 As String) As IGeometry
Description
Add a line to the geometry.
AddNode
Signature
Function AddNode(NodeName As String, X As Double, Y As Double,
Z As Double, XY As Double, XZ As Double, YZ As Double) As
IGeometry
Description
Add a node directly to this geometry. There is no connection with a component
for this node. The result is a new geometry object.
AddNodes
Signature
AddNodes(NodeNames() As String, X() As Double, Y() As Double,
Z() As Double, XY() As Double, XZ() As Double, YZ() As Double)
As IGeometry
Description
Add a list of nodes to this geometry. There is no connection with a component
for these nodes. The result is a new geometry object.
AddQuad
Signature
AddQuad(NodeName1 As String, NodeName2 As String, NodeName3 As
String, NodeName4 As String) As IGeometry
Description
Add a quad to this geometry. There is no connection with a component for this
quad. The result is a new geometry object.
AddTria
Signature
AddTria(NodeName1 As String, NodeName2 As String, NodeName3 As
String) As IGeometry
Description
Add a tria to this geometry. There is no connection with a component for this
tria. The result is a new geometry object.
ComponentLines
Signature
ComponentLines(ComponentName As String, NodeNamesA As
System.Array, NodeNamesB As System.Array)
Description
Function to get the lines from a component.
ComponentNodeValues
Signature
ComponentNodeValues(ComponentName As String, NodeName As
String, X As Double, Y As Double, Z As Double, XY As Double,
XZ As Double, YZ As Double, LocalCoordinates As Long = 1)
Description
This function retrieves the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a
specific node in a specific component. There is no return value.
ComponentNodesValues
Signature
ComponentNodesValues(ComponentName As String, NodeNames() As
String, X() As Double, Y() As Double, Z() As Double, XY() As
Double, XZ() As Double, YZ() As Double, LocalCoordinates As
Long = 1)
Description
This function retrieves the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a
list of nodes in a specific component. There is no return value.
ComponentQuads
Signature
ComponentQuads(ComponentName As String, NodeNamesA As
System.Array, NodeNamesB As System.Array, NodeNamesC As
System.Array, NodeNamesD As System.Array)
Description
This function retrieves the quads from a component.
ComponentsValues
Signature
ComponentsValues(ComponentName As System.Array, X As
System.Array, Y As System.Array, Z As System.Array, XY As
System.Array, XZ As System.Array, YZ As System.Array)
Description
This function retrieves the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a
specific component. There is no return value.
ComponentTrias
Signature
ComponentTrias(ComponentName As String, NodeNamesA As
System.Array, NodeNamesB As System.Array, NodeNamesC As
System.Array)
Description
This function returns the trias from a component.
ComponentValues
Signature
ComponentValues(ComponentName As String, X As Double, Y As
Double, Z As Double, XY As Double, XZ As Double, YZ As Double)
Description
This function retrieves the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a
specific component. There is no return value.
DeleteComponent
Signature
DeleteComponent(ComponentName As String) As IGeometry
Description
This function deletes a specific component. The result is a new geometry object.
DeleteComponentNode
Signature
DeleteComponentNode(ComponentName As String, NodeName As
String) As IGeometry
Description
This function deletes a node in a specific component. The result is a new
geometry object.
DeleteComponentNodes
Signature
DeleteComponentNodes(ComponentName As String, NodeNames() As
String) As IGeometry
Description
This function deletes a list of nodes in a specific component. The result is a new
geometry object.
DeleteNode
Signature
DeleteNode(NodeName As String) As IGeometry
Description
This function deletes a node that is not associated to any component. The result
is a new geometry object.
DeleteNodes
Signature
DeleteNodes(NodeNames() As String) As IGeometry
Description
This function deletes a list of nodes that are not associated to any component.
The result is a new geometry object.
EditComponent
Signature
EditComponent(ComponentName As String, X As Double, Y As
Double, Z As Double, XY As Double, XZ As Double, YZ As Double,
AxisType As CONST_EnumGeomAxisType = Cartesian) As IGeometry
Description
With this function, the axes coordinates and the axis type of a specific
component can be changed. The result is a new geometry object.
EditComponentNodeValues
Signature
EditComponentNodeValues(ComponentName As String, NodeName As
String, X As Double, Y As Double, Z As Double, XY As Double,
XZ As Double, YZ As Double, LocalCoordinates As Long = 1) As
IGeometry
Description
Modifies the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a node in a
specific component. The result is a new geometry object.
EditComponentNodesValues
Signature
EditComponentNodesValues(ComponentName As String, NodeName As
String, X As Double, Y As Double, Z As Double, XY As Double,
XZ As Double, YZ As Double, LocalCoordinates As Long = 1) As
IGeometry
Description
Modifies the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a list of nodes
in a specific component. The result is a new geometry object.
EditNodeValues
Signature
EditNodeValues(NodeNames As String, X As Double, Y As Double,
Z As Double, XY As Double, XZ As Double, YZ As Double) As
IGeometry
Description
Modifies the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a node that is
not associated to any component. The result is a new geometry object.
EditNodesValues
Signature
EditNodesValues(NodeNames() As String, X() As Double, Y() As
Double, Z() As Double, XY() As Double, XZ() As Double, YZ() As
Double) As IGeometry
Description
Modifies the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a list of nodes
that are not associated to any component. The result is a new geometry object.
Lines
Signature
Lines(NodeNamesA As System.Array, NodeNamesB As System.Array)
Description
Function that retrieves the lines.
NewGeometry
Signature
NewGeometry() As IGeometry
Description
This function returns a new Geometry.
NodeValues
Signature
NodeValues(NodeName As String, X As Double, Y As Double, Z As
Double, XY As Double, XZ As Double, YZ As Double)
Description
This function retrieves the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a
node that is not associated to any component. There is no return value.
NodesValues
Signature
NodesValues(NodeName() As String, X() As Double, Y() As Double,
Z() As Double, XY() As Double, XZ() As Double, YZ() As Double)
Description
This function retrieves the X,Y,Z coordinates and XY,XZ,YZ Euler angles for a
list of nodes that are not associated to any component. There is no return value.
Quads
Signature
Quads(NodeNamesA As System.Array, NodeNamesB As System.Array,
NodeNamesC As System.Array, NodeNamesD As System.Array)
Description
Function to retrieve the quads.
Trias
Signature
Trias(NodeNamesA As System.Array, NodeNamesB As System.Array,
NodeNamesC As System.Array)
Description
Function to retrieve the trias.
ComponentNames
Signature
ComponentNames As System.Array
Type
Read-only
Description
This property returns a list of all component names in the geometry.
ComponentNodeNames
Signature
ComponentNames(ComponentName As String) As System.Array
Type
Read-only
Description
This property returns a list of all node names belonging to a specific component.
NodeNames
Signature
NodeNames As System.Array
Type
Read-only
Description
This property returns a list of all node names not associated to a component.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Definition
Methods
CreateAttributeMap
CreateDataWatch
CreateObject
Database
FindDataWatch
ReplicateWatch
Properties
ActiveProjectName
cmd
Factory
UnitSystem
As explained in the definition of the Application object, the user can launch the
main executable that allows them to load an application description. These
descriptions are stored in workbooks and specify the list of modules necessary
to make up the whole application. The modularity of these components is such
that modules are not bound to one single context but they can be reused in
several combinations.
The ActiveX Module loader is an ActiveX control that allows loading and
running a single Test.Lab module. This virtually allows any Test.Lab module to
be loaded and run inside an application that can host ActiveX controls. The only
difference between an ActiveX control and a regular executable is that it needs
a host application to run in. So it runs in process with its host and displays its
GUI into the GUI of the host. Internet Explorer, Visual Basic 6.0, C++, .NET
development environments are only a couple of examples in which you can use
ActiveX controls.
Default
PictureManager
Picture
Explorer
There are a couple of properties you can specify to configure the behavior upon
loading a module. There are four properties, specific for the Test.Lab Control:.
These are:
ModuleName
OpenProject
ProjectName
SectionName
The module name indicates the type of the module. Supported types are:
Default
PictureManager
Picture
Explorer
CreateAttributeMap
Signature
CreateAttributeMap() as Attributemap
Description
This method creates an Attributemap object in Test.Lab and returns a reference
to it. Such an 'Attributemap' is a general implementation of a list or a map and is
used for passing lists of arguments to and from several Test.Lab automation
commands.
CreateDataWatch
Signature
CreateDataWatch (<General Port ID>as String, <DataType> as
String,<IsPersistent> as Long , MaxUpdateFrequency as Long =
1000 , Is Visible As Long = 1 ,IsAutoBuffered As Long = 1 )
General Port ID: ID of the port.
DataType: (TestLab) Type of data the port can hold.
IsPersistent: Boolean value to specify if the value on the port has be saved upon
saving the project.
MaxUpdateFrequency: the interval, specified in milliseconds, with which the
system will check the contents of the port and notify the client application if the
value on the port has changed since the previous check. Default is 1000.
IsAutoBuffered: a Boolean value to indicate that the value returned from the
datawatch needs to be returned as a buffered, normalized type.
IsVisible: a Boolean value to indicate whether the port should be visible in the
'online-data' of the Test.Lab GUI.
Description
Modules communicate by means of ports. All Test.Lab applications implicitly
define a of ports to allow their modules to communicate. Next to these
predefined ports, a user can create his own ports. Such externally created ports
can be used to store data to the active section, or to drag and drop into a
Test.Lab display.
When the user creates a port at runtime, it can be found in the 'Online-Data'
section in the navigator sheet. Once a port is created is treated no different from
any other predefined one and can be dragged and dropped in a display for
instance. Once it is dropped the display will get notified whenever the data on
de port changes. Independent whether the data comes from another Test.Lab
module or an external application.
CreateObject
Signature
CreateObject(DesiredType As String, Attributes As
AttributeMap) As IData
Description
This method allows a client application to create native Test.Lab objects such as
commands, weighting types, data blocks, calculations, etc. To do so it needs a
string to indicate the type of data to create, and an attribute list, a kind of
parameter list, as input for creation.
Database
Signature
Database(ProjectPathName as String) as IDataBase
Description
This method allows a client application to get hold of the automation object
called IDatabase for databases solely stored on disk. The database is not opened
in a workbook.
This IDatabase interface holds all the functionality for interacting with the
project database.
FindDataWatch
Signature
FindDataWatch(DataPathName as String, MaxUpdateFrequency As
Long = 1000 , IsAutoBuffered As Long = 1, ModuleScope As Long
= 1) As DataWatch
DataPathName: ID of the port. This can be a path, so the conventions
concerning path parsing must be taken into account.
MaxUpdateFrequency: the interval, specified in milliseconds, with which the
system will check the contents of the port and notify the client application if the
value on the port has changed since the previous check. Default is 1000
IsAutoBuffered: a Boolean value to indicate that the value returned from the
datawatch needs to be returned as a buffered,
ModuleScoop: this parameter indicates where internally the datawatch has to be
found. If the moduleScoop is ON, it is searched for on the module itself. If it is
OFF, it is searched for generally. Practically, use it like this: when there exists a
similar datawatch on the Application, it to 0, else if there exists a similar
datawatch on a ActiveBook, it to 1 (Default).
Description
The communication between different modules in a Test.Lab Application uses
datawatches. When an automation users wants to use this, he first has to find the
specific port.
The method will return a DataWatch object that encapsulates a connection to
one port and some additional information on the frequency with which to access
it and the data returned.
ReplicateWatch
Signature
ReplicateWatch(Source As Watch, Optional MaxUpdateFrequency
As Integer = 1000, IsAutoBuffered As Integer = 1, InitialFiring
As Integer = 1) As Watch
Description
Replicate a watch.
ActiveProjectName
Signature
Signature As String
Type
Read-only
Description
Returns the name of the currently active project.
cmd
Signature
cmd As ICmd
Type
Read-only
Description
This method returns a handle to the command interpreter used in the Icmd
interface.
Factory
Signature
Factory As Factory
Type
Read-only
Description
This function return a handle to the factory interface.
UnitSystem
Signature
UnitSystem() As IUnitSystem
Type
Read-only
Description
The UnitSystem property, returns a reference to an object in Test.Lab that is
responsible for handling unit system operations. Further interaction with this
unit- system-managing object can be done by means of the members defined on
the IUnitSystem interface.
In scenarios, in which the client application is run inside Test.Lab, this cross
process 'wrapping' of data is some unnecessary overhead. Connecting and using
Test.Lab automation functionality in an ActiveX control, running in one of the
Test.Lab user sheets, is one of those possible scenarios.
Next picture indicates the members of InProcApplication. Mark that these are
identical to the ones in the Application object. In most cases switching to the
better performing in-process object is usually merely a matter of specifying a
different class name.
Properties
Count
Item
InputBasket interfaces
Clear
Signature
Clear()
Description
Removes all elements available in input basket.
Count
Signature
Count As Integer
Type
Read-only
Description
This function return the number of items that are currently in the Input Basket.
Item
Signature
Item(Index As Integer, DataEndPointAsLink As Boolean = False) As Object
Type
Read-only
Description
This function returns the item from the Input Basket at a specific index.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Same as in documentation.
Definition
Methods
AddQuantityCase
Convert
CreateQuantity
Label
MKSToUserValue
MKSToUserValues
Power
Product
SetDefaultCase
UserToMKSValue
UserToMKSValues
Properties
Quantity…
IUnitSystem interfaces
AddQuantityCase
Signature
AddQuantityCase(QuantityName As String, CaseName As String, UnitLabel
As String, LogReference As Double = 10.0, IsPower As Integer = 0, Factor As
Double = 1.0, OffAs Double = 0.0, MakeThisDefaultCase As Integer = 0) As
IQuantity
Description
Function to add a case to a quantity.
Convert
Signature
Convert(Quantity As IQuantity) As IQuantity
Description
Function to convert a quantity.
CreateQuantity
Signature
CreateQuantity(QuantityName As String, CaseName As Object = Nothing) As
IQuantity
Description
Create a IQuantity.
Label
Signature
Label(Quantity As IQuantity) As String
Description
Function to return the label of a quantity.
MKSToUserValue
Signature
MKSToUserValue(Quantity, MKSValue)
Description
Returns a converted User Value for a given MKS Value in the represented
quantity in the current unit set.
MKSToUserValues
Signature
MKSToUserValues(Quantity, MKSValues)
Description
Returns the converted User Values for the given array of MKS Values in the
represented quantity in the current unit set.
Power
Signature
Power(Quantity, Power)
Description
Returns a quantity corresponding to Quantity ** Power, whereas Power is an
integer value.
Product
Signature
Product(Quantity1 , Quantity2)
Description
Returns a quantity that represents the product of Quantity1 and Quantity2.
SetDefaultCase
Signature
SetDefaultCase(Quantity As LMSTestLabAutomation.IQuantity)
Description
Sets the default quantity.
UserToMKSValue
Signature
UserToMKSValue (Quantity, UserValue)
Description
Returns a converted MKS Value for a given User Value in the represented
quantity in the current unit set.
UserToMKSValues
Signature
UserToMKSValues (Quantity, UserValues)
Description
Returns a converted MKS Value for a given User Value in the represented
quantity in the current unit set.
Quantity…
Description
Returns the quantity for 'Acceleration', 'Angle', 'Articulation Index', etc.
You can get all visible units of all quantities with the following Python code:
import win32com.client
tl = win32com.client.Dispatch("LMSTestLabAutomation.Application")
us = tl.UnitSystem
nq = us.QuantityCount
for q in range(nq):
qts = us.QuantityByIndex(q)
print qts
nu = us.UnitCount(qts)
for u in range(nu):
ul = us.UnitLabelByIndex(qts, u)
print ul
IWaterfall interfaces
Methods
AddBlock
DeleteBlock
DeleteZAxis
ReplaceBlock
ReplaceHeader
ReplaceUserAttributes
ReplaceZQuantity
ReplaceZValues
Properties
BlockCount
Header
Properties
UserAttributes
ZCount
Block
ZQuantity
ZValues
AddBlock
Signature
AddBlock(ac_nZValues As System.Array, ac_xBlock As IBlock) As IWaterfall
Description
Add a block to the Waterfall.
DeleteBlock
Signature
DeleteBlock(ac_nIndex As Integer) As IWaterfall
Description
Remove a block from the Waterfall.
DeleteZAxis
Signature
DeleteZAxis(ac_nIndex As Integer = 0) As IWaterfall
Description
Delete a z axis by index from the Waterfall.
ReplaceBlock
Signature
ReplaceBlock(ac_nIndex As Integer, ac_xBlock As IBlock) As IWaterfall
Description
Replace a block in the Waterfall.
ReplaceHeader
Signature
ReplaceHeader(ac_xHeader As IHeader) As IWaterfall
Description
Replace the header of the Waterfall.
ReplaceUserAttributes
Signature
ReplaceUserAttributes(ac_xAttributeMap As AttributeMap) As IWaterfall
Description
Replace the user attributes of the Waterfall.
ReplaceZQuantity
Signature
ReplaceZQuantity(ac_xZQuantity As IQuantity, ac_nIndex As Integer = 0) As
IWaterfall
Description
Replace the Z quantity of the Waterfall.
ReplaceZValues
Signature
ReplaceZValues(ac_xZValues As System.Array, ac_nIndex As Integer = 0) As
IWaterfall
Description
Replace the z values of the Watrfall.
BlockCount
Signature
BlockCount As Integer
Type
Read-only
Description
This property is the number of block contained in this Waterfall.
Header
Signature
Header As IAttributeMap
Type
Read-only
Description
This property is the header from this Watefall.
Properties
Signature
Properties As IAttributeMap
Type
Read-only
Description
This property is the properties of this Waterall.
UserAttributes
Signature
UserAttributes As IAttributeMap
Type
Read-only
Description
This property is the user attributes of the Waterfall.
ZCount
Signature
ZCount As Integer
Type
Read-only
Description
This property is the number of z values.
Block
Signature
Block(index As Integer) As IBlock2
Type
Read-only
Description
This property is the block at a specific index.
ZQuantity
Signature
ZQuantity(index As Integer) As IQuantity
Type
Read-only
Description
This property is the quantity of z values at a specific index.
ZValues
Signature
ZValues(index As Integer) As System.Array
Type
Read-only
Description
This property is the z values of the waterfall at a specific index.
Same as in documentation.
Definition
Methods
Search
Properties
Criterion
SearchBasket
StartPoint
State
An automation user can specify the type of data that is been looking for (a
block, a run, a section, a database, CADA-X Data). The startpoint from where
to search is indicated (a place on the file system, a specific file, the active
project, the current search basket). The StartPointFactory is used to define this.
Specifying extra criteria is not yet supported. Via the method "Search" on the
search engine, the search is launched.
A property of it is the state, returning a watch. On this, the automation user can
implement a value-changed callback, so that he knows when the search is done.
The results of the search are found in the SearchBasket. The object
"SearchEngine" is the drive for the complete search mechanism in automation.
SearchEngine interfaces
Search
Signature
Search(StartPoint As StartPoint, SearchType As CONST_EnumSearchTypes)
Description
This function launches the search. The StartPoint and the SearchType are
parameters to define this search.
Criterion
Signature
Criterion As IDomainSearchCriteria
Type
Read-only
Description
Get the search criteria.
SearchBasket
Signature
SearchBasket As SearchBasket
Type
Read-only
Description
This property returns the searchbasket. Here, the results of the search can be
found.
StartPoint
Signature
StartPoint As StartPointFactory
Type
Read-only
Description
This property returns the StartPointFactory.
State
Signature
State As Watch
Type
Read-only
Description
This property returns a watch to the state of the search. This way, a callback can
be implemented that is called when the state of the search changes (it is busy, it
is not busy anymore).
The parameter of the callback is a variant, presenting a Boolean. It is ‘TRUE’
when the search is running
Definition
Properties
ActiveProject
SearchBasket
Directory
File
StartPointFactory interfaces
ActiveProject
Signature
ActiveProject As StartPoint
Type
Read-only
Description
Property that returns the active project as startpoint.
SearchBasket
Signature
SearchBasket As StartPoint
Type
Read-only
Description
Property that returns the searchbasket as startpoint.
Directory
Signature
Directory(DirectoryPath As String) As StartPoint
Type
Read-only
Description
Property that returns the specified directory as StartPoint.
File
Signature
File(FilePath As String) As StartPoint
Type
Read-only
Description
Property that return the specified file as StartPoint.
Workspace interfaces
Methods
AddFolder
AddItem
AddProperties
Delete
GetBridgeElement
GetItem
GetProperties
Properties
ElementNames
ElementTypes
AddFolder
Signature
AddFolder(PathToTop As String, NewName As String,
ac_xPropertyContainer As Object = Nothing)
Description
Add a folder by specifying its name and parent folder.
AddItem
Signature
AddItem(PathToTop As String, NewName As String, ac_xData As
Object, ac_xPropertyContainer As Object = Nothing,
OverwriteIfExists As Integer = 0)
Description
Add an item to the workspace.
AddProperties
Signature
AddProperties(PathToTop As String, ac_xPropertyContainer As
Object, OverwriteIfExists As Integer = 1)
Description
Add properties to the workspace.
Delete
Signature
Delete(PathToTop As String)
Description
Delete objects or folders from the workspace.
GetBridgeElement
Signature
GetBridgeElement(PathToTop As String) As IData
Description
Function that returns a bridge element by specifying its path to top.
GetItem
Signature
GetItem(PathToTop As String) As IData
Description
Function that returns an element by specifying its path to top.
GetProperties
Signature
GetProperties(PathToTop As String) As AttributeMap
Description
Function that return a property by specifying its path to top.
AddToInputBasket
Signature
AddToInputBasket(ByVal PathToTop As String)
Description
Adds an element available in workspace to input basket. PathToTop is path to
element available in workspace.
ElementNames
Signature
ElementNames(PathToTop As String, ReturnAsPathToTop As Integer = 0) As
AttributeMap
Type
Read-only
Description
Property that returns the names of the elements contained in the specified parent
directory.
ElementType
Signature
ElementType(PathToTop As String) As String
Type
Read-only
Description
Property that returns the type of the element, specified by PathToTop
Block commands • 28 G
C General guidelines • 43
General: • 59
Changes in ISignatureAcquisitionCtr interface Getting started • 13
• 12 Gow to add a scalar to a block • 30
Changes to the Factory interface • 10
Changes to the IApplication and IModule H
interface • 8 How to access data via a Module Loader • 43
Changes to the IBlock2 interface • 7 How to access the PictureManager of a
Changes to the IBook interface • 8 Module Loader • 42
Changes to the ICmd interface • 7, 11 How to access the Test.Lab Type library in VB
Changes to the IDatabase interface • 10 • 43
Changes to the IDataBrowser interface • 10 How to access the Test.Lab Type library in
Changes to the IDisplay interface • 11 VB.NET • 45
Changes to the IGeometry interface • 7, 12 How to add a single x-cursor to the front of a
Changes to the InputBasket interface • 10 Front/back display • 34
Changes to the IQuantity interface • 11 How to add elements to Input Basket • 28
Changes to the IUnitSystem interface • 11 How to calculate the loudness of a block • 31
Changes to the SearchBasket interface • 10 How to change the run name and to be
Changes to the TdfSink interface • 8 informed if it is changed • 36
Changes to the Workspace interface • 10 How to change the X values of a block • 23
Connceting with the application • 19 How to change the Y values of a block • 23
Contect • 191 How to change the Y values of a block from
Content • 180, 187 MKS to user units • 26
Contents • 68, 82, 86, 92, 95, 99, 111, 124, How to create a random block • 29
127, 137, 146, 150, 154, 165, 171, 174, 184 How to create a scalar • 28
Controlling a measurement in Signature • 35 How to create a sine wave • 29
How to deal with Test.Lab objects • 54
D
How to define the Channel Setup parameters •
Default • 71 36
Definition • 68, 82, 86, 92, 95, 99, 112, 124, How to display a block in a running
128, 138, 146, 150, 156, 165, 174, 184, 187 application • 32
Display and plotting • 32 How to do a weighting on a block • 30
How to load a module (in VB.NET) • 39
E
How to load a module (in VB6.0) • 37
Enumerate • 92 How to make your own add-in in VB.6.0 • 49
Events • 91 How to make your own add-in in VB.NET • 51
Example 1: • 59 How to modify axis properties of any display •
Example 2: • 59 34
Example 3: • 59 How to multiply 2 blocks • 31
Example 4: • 60 How to print a block in a word document • 32
Example 5: • 60 How to read and change the header fields of a
Example 6: • 60 block • 24
Example 7: • 60 How to read and change the Y unit of a block •
Example 8: • 60