beautypg.com

Control command language, Tcl interface, Examples – Teledyne LeCroy Automation API for IBTrainer Software Ver.2.0 User Manual

Page 19

background image

Control Command Language

Programming the IBTrainer

CATC IBTrainer InfiniBand Exerciser API Reference

1-9

Control Command Language

The basis for the control language is the C++ interface.

TCL Interface

The entire functionality of the InfiniBand Generator can also be
accessed via a TCL interface. A part of the software installation is a
subnet management agent (SMA) programmed as a TCL script. The
SMA handles all incoming MAD packets and registers the generator
correctly within the InfiniBand network.

Examples

When you create and use a new class object in TCL it you have to follow
the syntax scheme as described in the following table. It is your
responsibility to write a catch handler to handle any errors that may
occur when a TCL script runs. Failure to do this causes the TCL
interpreter to generate an exception.

Table 1 Programming Scheme using TCL

What you intend

What the SW does

Tcl Syntax

Create a new class object in
TCL.

Assigns an object of type

classname

to the variable

var

.

set var [ new_ ?parameter? ]

Use a class method.

Assumes that

var

contains an

object of type

classname

.

_ $var ?parameters?

Delete an object of type

classname

. Equivalent of

calling the destructor.

Assumes that

var

contains an

object of type classname.

delete_ $var

Set a property to a specific
value. Properties are defined
in the context of the class in
which they are used.

All classes that contain properties
are derived from

IGCObject

which implements the

Set()

and

Get()

functions.

IGCObject_Set $var

$_