Anritsu MD1230A-06 User manual

Document No.: M-W2122AE-8.0
ANRITSU CORPORATION
Tcl Interface
Operation Manual
Eighth Edition
•This is an operation manual of MD1230A-06,
MD1230B-06, MD1231A-06, MD1231A1-06,
MX123001A-06.
•Read this manual before using the equipment.
•To ensure that the equipment is used safely, read
the “For Safety” in the Operation Manual for each
main unit first.
•Keep this manual with the equipment.

ii
Safety Symbols
To prevent the risk of personal injury or loss related to equipment malfunction, Anritsu Corporation uses the following
safety symbols to indicate safety-related information. Insure that you clearly understand the meanings of the sym-
bols BEFORE using the equipment. Some or all of the following five symbols may not be used on all Anritsu
equipment. In addition, there may be other labels attached to products which are not shown in the diagrams in this
manual.
Symbols used in manual
This indicates a very dangerous procedure that could result in serious injury or
death if not performed properly.
This indicates a hazardous procedure that could result in serious injury or death if
not performed properly.
This indicates a hazardous procedure or danger that could result in light-to-severe
injury, or loss related to equipment malfunction, if proper precautions are not taken.
Safety Symbols Used on Equipment and in Manual
The following safety symbols are used inside or on the equipment near operation locations to provide information
about safety items and operation precautions. Insure that you clearly understand the meanings of the symbols
and take the necessary precautions BEFORE using the equipment.
This indicates a prohibited operation. The prohibited operation is indicated sym-
bolically in or near the barred circle.
This indicates an obligatory safety precaution. The obligatory operation is indicat-
ed symbolically in or near the circle.
This indicates warning or caution. The contents are indicated symbolically in or
near the triangle.
This indicates a note. The contents are described in the box.
These indicate that the marked part should be recycled.
Tcl Interface
Operation Manual
1 February 2003 (First Edition)
25 November 2005 (Eighth Edition)
Copyright © 2003-2005, ANRITSU CORPORATION.
All rights reserved. No part of this manual may be reproduced without the prior written permission of the
publisher.
The contents of this manual may be changed without prior notice.
Printed in Japan
DANGER
WARNING
CAUTION

iii
Equipment Certificate
Anritsu guarantees that this equipment was inspected at shipment and
meets the published specifications.
Anritsu Warranty
•During the warranty period, Anritsu will repair or exchange this soft-
ware free-of-charge at the company’s own discretion if it proves defec-
tive when used as described in the operation manual.
•The warranty period is 1 year from the purchase date.
•The warranty period after repair or exchange will remain 1 year from
the original purchase date, or 30 days from the date of repair or ex-
change, depending on whichever is longer.
•This warranty does not cover damage to this software caused by Acts
of God, natural disasters, and misuse or mishandling by the customer.
In addition, this warranty is valid only for the original equipment pur-
chaser. It is not transferable if the equipment is resold.
Anritsu Corporation will not accept liability for equipment faults due to
unforeseen and unusual circumstances, nor for faults due to mishandling
by the customer.
Anritsu Corporation Contact
In the event that this equipment malfunctions, contact an Anritsu Service
and Sales office. Contact information can be found on the last page of
the printed version of this manual, and is available in a separate file on
the CD version.

iv
Notes On Export Management
This product and its manuals may require an Export License/Approval by
the Government of the product's country of origin for re-export from you
r
country.
Before re-exporting the product or manuals, please contact us to confirm
whether they are export-controlled items or not.
When you dispose of export-controlled items, the products/manuals are
needed to be broken/shredded so as not to be unlawfully used for military
purpose.

v
Software License Agreement
Please read this Software License Agreement before using the accom-
panying software program (hereafter this software).
You are authorized to use this software only if you agree to all the terms
of this License.
By opening the sealed package containing this software, you are agreeing
to be bound by the terms of this License.
If you do not agree to these terms, return the unopened software package
to Anritsu Corporation (hereafter Anritsu).
1. License
(1) This License gives you the right to use this software on one comput-
er system.
(2) To use this software on one computer system, this License allows
you to make one copy of this software on the storage device of your
computer system.
(3) You must obtain a site license to use this software on more than one
computer system even if such computer systems are not operating
simultaneously.
2. Copyright
(1) Although you are licensed to use this software, Anritsu retains the
copyright.
(2) Although you have purchased this software, rights other than those
specified in this License are not transferred to you.
(3) You may not print, copy, modify, create derivative works, incorpo-
rate in other software programs, decompile or disassemble this
software in whole or in part, without obtaining prior written per-
mission from Anritsu.
3. Copying
Notwithstanding item (3) of section 2 above, you may make one copy of
this software for backup purposes only. In this case, you may only use
either the original or the backup copy of this software.
4. Termination
(1) Anritsu will deem this License to be automatically terminated if you
fail to comply with any provision of this License. Upon termination,
you will lose all rights to this software.
(2) Either party (Anritsu or yourself) to this Software License Agree-
ment may terminate this Agreement by giving 1 months notice in
writing to the other party.
(3) Upon termination of this License for any reason, you must either
immediately destroy this software and related documentation, or re-
turn it to Anritsu.

vi
CE Conformity marking
Anritsu affixes the CE Conformity marking on the following product (s) in
accordance with the Council Directive 93/68/EEC to indicate that they
conform to the EMC and LVD directive of the European Union (EU).
CE marking
1. Product Model
Option: MD1230A-06 Tcl interface,
MD1230B-06 Tcl interface,
MD1231A-06 Tcl interface,
MD1231A1-06 Tcl interface
2. Applied Directive and Standards
When the above options are installed in the main frame shown below,
the applied directive and standards of these options are conformed to
those of the main frame.
Main frame: MD1230A/B Data Quality Analyzer,
MD1231A/A1 IP Network Analyzer
PS: About main frame
The kind of main frame (a measuring apparatus) will be to increase.
Please, contact us about the newest information of the main frame.

vii
C-tick Conformity marking
Anritsu affixes the C-tick marking on the following product (s) in accor-
dance with the regulation to indicate that they conform to the EMC
framework of Australia/New Zealand.
C-tick marking
1. Product Model
Option: MD1230A-06 Tcl interface,
MD1230B-06 Tcl interface,
MD1231A-06 Tcl interface,
MD1231A1-06 Tcl interface
2. Applied Directive and Standards
When the above options are installed in the main frame shown below,
the applied directive and standards of these options are conformed to
those of the main frame.
Main frame: MD1230A/B Data Quality Analyzer,
MD1231A/A1 IP Network Analyzer
PS: About main frame
The kind of main frame (a measuring apparatus) will be to increase.
Please, contact us about the newest information of the main frame.

viii

I
About This Manual
MD1230 family operation manual consists of the main unit, control soft-
ware, modules, remote control and options shown below.
Note:
MD1230 family is the generic name of MD1230A/B Data Quality
Analyzer, MD1231A/A1 IP Network Analyzer and MT7407A Multislot
Chassis.
Explains MD1230A/B basic operations.
MD1230 family
Operation Manual
configuration
Explains the usage of software that controls the
main frame of the MD1230 family.
MX123001A Data Quality Analyzer
Control Software Operation Manual
Explains basic operations for each SDH/SONET
module.
Explains basic operations for each Ethernet
module.
Ethernet Module
Operation Manual
Remote Control
Operation Manual
Explains the remote control via RS-232C, GPIB
and Ethernet Interfaces.
shows this document.
Explains basic operations for each SDH/SONET
module.
MU120119A OC-3/12 STM-1/4 Module (1310 nm)
MU120120A OC-3 STM-1 Module (1310 nm)
Operation Manual
MU120103A/B 2.5G (1.31) Module
MU120104A/B 2.5G (1.55) Module
MU120105A 10G (1.31) Module
MU120106A 10G (1.55) Module
Operation Manual
MD1230A/B Data Quality Analyzer
Operation Manual
Explains MD1231A/A1 basic operations.
MD1231A/
A
1 IP Network Analyzer
Operation Manual
Explains MT7407A basic operations.
MT7407A Multislot Chassis
Operation Manual

II
Tcl Interface
Operation Manual
Explains basic operation for Tcl Interface.
Expert Analysis Module
Operation Manual
Explains basic operation for the Expert Analysis
Module.
Decode Module
Operation Manual
Explains basic operations for Decode Module.
A
pplication Traffic Monitor
Operation Manual
Explains operation for the software that monitors
traffics on Ethernet.

III
This operation manual covers the following products:
Model Name Product Name
MD1230A-06
MD1230B-06
MD1231A-06
MD1231A1-06
MX123001A-06
Tcl Interface
Description in this manual shows the case of using the MD1230A-06.

IV
Table of Contents
About This Manual........................................ I
Section 1 Introducing the Tcl Interface ... 1-1
1.1 Introducing the Tcl Interface ......................................... 1-2
1.2 Concepts....................................................................... 1-3
1.3 Operations Guidelines .................................................. 1-5
Appendix A SCPI Commands by
Macro Category...................... A-1

V
Appendix
1

VI.

Section 1 Introducing the Tcl Interface
1-1
1
Introducing the Tcl Interface
If you do not agree to these terms, return the unopened software package
to Anritsu Corporation (hereafter Anritsu).
This section provides an overview of the Tcl Interface features and func-
tions. “Tcl” is the acronym for Tool Command Language and is pro-
nounced “tickle”.
For list of SCPI commands grouped by macro category, refer to the
Appendix “SCPI Commands by Macro Category”.
1.1 Introduction to the Tcl Interface ................................. 1-2
1.1.1 References ................................................... 1-3
1.2 Concepts.................................................................... 1-3
1.2.1 Where to Start .............................................. 1-3
1.3 Operations Guidelines ............................................... 1-5
1.3.1 MD1230A Tcl Server Startup ....................... 1-5
1.3.2 MD1230A Tcl and SCPI Command Syntax.. 1-5
1.3.2.1 Command Syntax......................... 1-6
1.3.2.2 An Example of a Connect and
Command Sequence ................... 1-9
1.3.2.3 Developers Guidelines ................. 1-14

Section 1 Introducing the Tcl Interface
1-2
This manual serves as an MD1230A Data Quality Analyzer Tcl Develop-
ers Guide and provides intermediate and advanced topics such as pro-
gram control using the Tcl scripting language in an extended environment.
This manual assumes you are familiar with operating the MD1230A us-
ing the remote control Standard Commands for Programmable Instru-
ments (SCPI) command and response interface. This manual also as-
sumes knowledge of basic programming constructs and techniques using
the Tcl interpretive scripting language. Code samples are denoted by
Courier type.
1.1 Introduction to the Tcl Interface
The Anritsu MD1230A Tcl interface is an optional user interface which
provides automation for the configuration and execution of MD1230A op-
erations. The Tcl API provides a generic socket-based interface to the
MD1230A SCPI remote commands. SCPI commands and queries can be
scripted in the Tcl programming environment to provide flexibility and
automation of recurring tasks. Figure 1.1-1 shows the Tcl/MD1230A inter-
face.
Client Side
Tcl Server Option
Server Side
L
A
N
MD1230A
Data Quality
Analyzer
PC
Client
PC
Client 1
Fig. 1.1-1 Tcl Interface Architecture for the MD1230A

1.2 Concepts
1-3
1
Introducing the Tcl Interface
1.1.1 References
Tool Command Language (Tcl) interpreter + SCRIPTING language was
crafted by John Ousterout in 1988 (U of C Berkley, Sun, Scriptic).
•http://www.tcl.tk/
•http://www.SCPIconsortium.org/
•http://www.activestate.com/
1.2 Concepts
1.2.1 Where to Start
Implementing an automated command sequence in a Tcl script still re-
quires all of the preliminary connection and configuration stages that are
necessary with the GUI and SCPI interfaces. The path to the targeted
test point follows a basic hierarchy:
•Unit - up to eight simultaneous MD1230A units connected
•Module - five available slots on the MD1230A
•Port -module dependent
As indicated by the SCPI command/response naming conventions, the op-
erations invoked by each command are static or single-event oriented.
Mastering the sequencing of this command structure for the MD1230A is
a first step towards successful command line remote control of the
MD1230A.

Section 1 Introducing the Tcl Interface
1-4
The MD1230A Tcl scripting interface strives to provide a platform for de-
veloping vertical and horizontal programming setup and control of these
single-event oriented instructions. Vertical programming consistency de-
fines program commands/requests within a functional class. An example
of vertical consistency is to use the same Tcl programmatic looping con-
structs to initialize common data parameters with a pre-defined data ma-
trix.
Horizontal consistency means using the same commands to program
similar functions across instrument classes. An example of horizontal
consistency is to apply the same Tcl programmatic looping constructs to
set up a Counter for packet measurement on multiple module types.
The client Tcl scripting complexity is open to the programmer’s experience
with Tcl capabilities. It is only necessary to identify a few common Tcl
commands which are used to directly invoke SCPI embedded syntax on a
Tcl socket:
•puts
•gets
•flush
These basic Tcl I/O commands along with some common Tcl string
parsing commands for evaluating responses are all that are required to
script meaningful, automated MD1230A operations.

1.3 Operations Guidelines
1-5
1
Introducing the Tcl Interface
1.3 Operations Guidelines
1.3.1 MD1230A Tcl Server Startup
•Selecting the Tcl Application button from the Selector Application on
the MD1230A launches the Tcl Server. Figure 1.3-1 shows the Selector
Application.
Fig. 1.3-1 Selector Application on the MD1230A
Once launched, the Tcl Server will not allow other local GUI and single
Remote Control interface users to connect to the MD1230A. The Tcl Server
will allow remote GUI users to connect to the MD1230A.
1.3.2 MD1230A Tcl and SCPI Command Syntax
It is beyond the scope of this document to cover the detail of the remote
command techniques and capabilities for the MD1230A. An example of
the style of syntax required for embedding the SCPI syntax within the Tcl
interface and at a command line interface is included in this section. The
details of MD1230A command sequencing can be found in the
Remote
Control Operation Manual
.

Section 1 Introducing the Tcl Interface
1-6
1.3.2.1 Command Syntax
There are three types of commands:
•SCPI Commands.
•Macro Commands.
•Special purpose commands.
SCPI Commands
The command syntax of SCPI commands is as per the SCPI standard.
Macro Commands
Macro commands are provided by Anritsu Company to provide more
user-friendly programming commands that are separate from the basic
SCPI commands. The macro commands are made on top of the basic SCPI
commands and each macro command may contain one or more than one
SCPI command. Macro commands may be used wherever SCPI com-
mands can be used.
The basic syntax of a command is as follows:
M_COMMANDNAME :< VariableName>=<VALUE>, <VariableName>=<VALUE>…
M_COMMANDNAME? :< VariableName>, <VariableName>=<VALUE>, <VariableName>
Macro commands can consist of a variable number of parameters. By
definition, these variable names are formed to give a user-friendly specific
name to the SCPI command. Variable names are formed by using the
SCPI command and then removing the “:” (colon). Three macro groups are
provided in this release; they are described below:
•M_PORTSETTING
•M_CAPTURE
•M_TXSTREAM
This manual suits for next models
4
Table of contents
Other Anritsu Recording Equipment manuals