Planar R54 Owner's manual

PLANAR R54 Vector Reflectometer
Using the pair of devices
Programming Manual COM/DCOM
First Edition
2013

PLANAR R54x2 COM/DCOM Programming manual
2
TABLE OF CONTENTS
Introduction.................................................................................................................................................6
1
COM Technology Overview..............................................................................................................7
2
Automation Server.............................................................................................................................7
3
Automation Controllers .....................................................................................................................7
4
Local and Remote Server...................................................................................................................8
5
Structure of COM Objects ...............................................................................................................10
6
Accessing the Application Object....................................................................................................11
7
Object Methods................................................................................................................................13
8
Object Properties..............................................................................................................................13
9
Error Handling.................................................................................................................................14
10
COM Automation Data Types.........................................................................................................16
11
Measurement Data Arrays ...............................................................................................................17
12
COM Server Commands..................................................................................................................18
NAME....................................................................................................................................................18
Ready(Pt)................................................................................................................................................19
SCPI.ABORt ..........................................................................................................................................20
SCPI.CALCulate(Ch).FSIMulator.SENDed.DEEMbed.PORT(Pt). USER.FILename..........................21
SCPI.CALCulate(Ch).FSIMulator.SENDed.DEEMbed.PORT(Pt).STATe..........................................23
SCPI.CALCulate(Ch).FSIMulator.SENDed.PMCircuit.PORT(Pt). USER.FILename..........................24
SCPI.CALCulate(Ch).FSIMulator.SENDed.PMCircuit.PORT(Pt).STATe...........................................25
SCPI.CALCulate(Ch).FSIMulator.SENDed. ZCONversion.PORT(Pt).Z0.R .......................................26
SCPI.CALCulate(Ch).FSIMulator.SENDed.ZCONversion.STATe......................................................27
SCPI.CALCulate(Ch).PARameter.COUNt............................................................................................28
SCPI.CALCulate(Ch).PARameter(Tr).DEFine......................................................................................30
SCPI.CALCulate(Ch).PARameter(Tr).SELect ......................................................................................31
SCPI.CALCulate(Ch).SELected.CONVersion.FUNCtion.....................................................................32
SCPI.CALCulate(Ch).SELected.CONVersion.STATe..........................................................................33
SCPI.CALCulate(Ch).SELected.CORRection.EDELay.TIME .............................................................34
SCPI.CALCulate(Ch).SELected.CORRection.OFFSet.PHASe.............................................................35
SCPI.CALCulate(Ch).SELected.DATA.FDATa ...................................................................................36
SCPI.CALCulate(Ch).SELected.DATA.FMEMory ..............................................................................37
SCPI.CALCulate(Ch).SELected.DATA.SDATa ...................................................................................38
SCPI.CALCulate(Ch).SELected.DATA.SMEMory ..............................................................................39
SCPI.CALCulate(Ch).SELected.FILTer.GATE.TIME.CENTer ...........................................................40
SCPI.CALCulate(Ch).SELected.FILTer.GATE.TIME.SHAPe.............................................................41
SCPI.CALCulate(Ch).SELected.FILTer.GATE.TIME.SPAN...............................................................42
SCPI.CALCulate(Ch).SELected.FILTer.GATE.TIME.STARt .............................................................43
SCPI.CALCulate(Ch).SELected.FILTer.GATE.TIME.STATe.............................................................44
SCPI.CALCulate(Ch).SELected.FILTer.GATE.TIME.STOP...............................................................45
SCPI.CALCulate(Ch).SELected.FILTer.GATE.TIME.TYPE...............................................................46
SCPI.CALCulate(Ch).SELected.FORMat .............................................................................................47
SCPI.CALCulate(Ch).SELected.FUNCtion.DATA...............................................................................48
SCPI.CALCulate(Ch).SELected.FUNCtion.DOMain.COUPle.............................................................49
SCPI.CALCulate(Ch).SELected.FUNCtion.DOMain.STARt ...............................................................50
SCPI.CALCulate(Ch).SELected.FUNCtion.DOMain.STATe...............................................................51
SCPI.CALCulate(Ch).SELected.FUNCtion.DOMain.STOP.................................................................52
SCPI.CALCulate(Ch).SELected.FUNCtion.EXECute ..........................................................................53
SCPI.CALCulate(Ch).SELected.FUNCtion.PEXCursion......................................................................54
SCPI.CALCulate(Ch).SELected.FUNCtion.POINts..............................................................................55
SCPI.CALCulate(Ch).SELected.FUNCtion.PPOLarity.........................................................................56
SCPI.CALCulate(Ch).SELected.FUNCtion.TARGet............................................................................57
SCPI.CALCulate(Ch).SELected.FUNCtion.TTRansition......................................................................58
SCPI.CALCulate(Ch).SELected.FUNCtion.TYPE................................................................................59
SCPI.CALCulate(Ch).SELected.LIMit.DATA......................................................................................60
SCPI.CALCulate(Ch).SELected.LIMit.DISPlay.STATe.......................................................................61
SCPI.CALCulate(Ch).SELected.LIMit.FAIL........................................................................................62
SCPI.CALCulate(Ch).SELected.LIMit.OFFSet.AMPLitude.................................................................63
SCPI.CALCulate(Ch).SELected.LIMit.OFFSet.STIMulus....................................................................64

PLANAR R54x2 COM/DCOM Programming manual
3
SCPI.CALCulate(Ch).SELected.LIMit.REPort.ALL.............................................................................65
SCPI.CALCulate(Ch).SELected.LIMit.REPort.DATA .........................................................................66
SCPI.CALCulate(Ch).SELected.LIMit.REPort.POINts ........................................................................67
SCPI.CALCulate(Ch).SELected.LIMit.STATe .....................................................................................68
SCPI.CALCulate(Ch).SELected.MARKer(Mk).ACTivate....................................................................69
SCPI.CALCulate(Ch).SELected.MARKer(Mk).BWIDth.DATA..........................................................70
SCPI.CALCulate(Ch).SELected.MARKer.BWIDth.REFerence...........................................................71
SCPI.CALCulate(Ch).SELected.MARKer.BWIDth.STATe.................................................................72
SCPI.CALCulate(Ch).SELected.MARKer.BWIDth.THReshold...........................................................73
SCPI.CALCulate(Ch).SELected.MARKer.BWIDth.TYPE...................................................................74
SCPI.CALCulate(Ch).SELected.MARKer.COUPle..............................................................................75
SCPI.CALCulate(Ch).SELected.MARKer.FUNCtion.DOMain.STARt ...............................................76
SCPI.CALCulate(Ch).SELected.MARKer.FUNCtion.DOMain.STATe...............................................77
SCPI.CALCulate(Ch).SELected.MARKer.FUNCtion.DOMain.STOP.................................................78
SCPI.CALCulate(Ch).SELected.MARKer(Mk).FUNCtion.EXECute...................................................79
SCPI.CALCulate(Ch).SELected.MARKer(Mk).FUNCtion.PEXCursion..............................................80
SCPI.CALCulate(Ch).SELected.MARKer(Mk).FUNCtion.PPOLarity.................................................81
SCPI.CALCulate(Ch).SELected.MARKer(Mk).FUNCtion.TARGet ....................................................82
SCPI.CALCulate(Ch).SELected.MARKer(Mk).FUNCtion.TRACking ................................................83
SCPI.CALCulate(Ch).SELected.MARKer(Mk).FUNCtion.TTRansition..............................................84
SCPI.CALCulate(Ch).SELected.MARKer(Mk).FUNCtion.TYPE........................................................85
SCPI.CALCulate(Ch).SELected.MARKer.REFerence.STATe.............................................................86
SCPI.CALCulate(Ch).SELected.MARKer(Mk).STATe........................................................................87
SCPI.CALCulate(Ch).SELected.MARKer(Mk).X.................................................................................88
SCPI.CALCulate(Ch).SELected.MARKer(Mk).Y.................................................................................89
SCPI.CALCulate(Ch).SELected.MARKer.COUNt...............................................................................90
SCPI.CALCulate(Ch).SELected.MATH.FUNCtion..............................................................................91
SCPI.CALCulate(Ch).SELected.MATH.MEMorize .............................................................................92
SCPI.CALCulate(Ch).SELected.MSTatistics.DATA............................................................................93
SCPI.CALCulate(Ch).SELected.MSTatistics.DOMain.MARKer.STARt.............................................94
SCPI.CALCulate(Ch).SELected.MSTatistics.DOMain.MARKer.STOP ..............................................95
SCPI.CALCulate(Ch).SELected.MSTatistics.DOMain.STATe ............................................................96
SCPI.CALCulate(Ch).SELected.MSTatistics.STATe............................................................................97
SCPI.CALCulate(Ch).SELected. RLIMit.DATA ..................................................................................98
SCPI.CALCulate(Ch).SELected.RLIMit.DISPlay.LINE.......................................................................99
SCPI.CALCulate(Ch).SELected.RLIMit.FAIL....................................................................................100
SCPI.CALCulate(Ch).SELected.RLIMit.REPort.DATA.....................................................................101
SCPI.CALCulate(Ch).SELected.RLIMit.STATe.................................................................................102
SCPI.CALCulate(Ch).SELected.SMOothing.APERture .....................................................................103
SCPI.CALCulate(Ch).SELected.SMOothing.STATe..........................................................................104
SCPI.CALCulate(Ch).SELected.TRANsform.DISTance.CENTer......................................................105
SCPI.CALCulate(Ch).SELected.TRANsform.KWINdow...................................................................106
SCPI.CALCulate(Ch).SELected.TRANsform.DISTance.SPAN.........................................................107
SCPI.CALCulate(Ch).SELected.TRANsform. DISTance.MINimum .................................................108
SCPI.CALCulate(Ch).SELected.TRANsform.DISTance.MAXimum.................................................109
SCPI.CALCulate(Ch).TRACe(Tr).DATA.FDATa..............................................................................110
SCPI.CALCulate(Ch).TRACe(Tr).DATA.FMEMory.........................................................................111
SCPI.CALCulate(Ch). TRACe(Tr).DATA.SDATa.............................................................................112
SCPI.CALCulate(Ch). TRACe(Tr).DATA.SMEMory........................................................................113
SCPI.DISPlay.COLor.BACK...............................................................................................................114
SCPI.DISPlay.COLor.GRATicule .......................................................................................................115
SCPI.DISPlay.COLor.RESet................................................................................................................116
SCPI.DISPlay.COLor.TRACe(Tr).DATA...........................................................................................117
SCPI.DISPlay.COLor.TRACe(Tr).MEMory .......................................................................................118
SCPI.DISPlay.FSIGn ...........................................................................................................................119
SCPI.DISPlay.IMAGe..........................................................................................................................120
SCPI.DISPlay.SPLit.............................................................................................................................121
SCPI.DISPlay.UPDate_.IMMediate.....................................................................................................122
SCPI.DISPlay.WINDow(Ch).ACTivate ..............................................................................................122
SCPI.DISPlay.WINDow(Ch).ANNotation.MARKer.ALIGn.TYPE...................................................123

PLANAR R54x2 COM/DCOM Programming manual
4
SCPI.DISPlay.WINDow(Ch).ANNotation.MARKer.SINGle.STATe.................................................124
SCPI.DISPlay.WINDow(Ch).TITLe.DATA........................................................................................125
SCPI.DISPlay.WINDow(Ch).TITLe.STATe.......................................................................................126
SCPI.DISPlay.WINDow(Ch).TRACe(Tr).ANNotation.MARKer. POSition.X ..................................127
SCPI.DISPlay.WINDow(Ch).TRACe(Tr).ANNotation.MARKer. POSition.Y ..................................128
SCPI.DISPlay.WINDow(Ch).TRACe(Tr).Y.SCALe.AUTO...............................................................129
SCPI.DISPlay.WINDow(Ch).TRACe(Tr).Y.SCALe.PDIVision.........................................................130
SCPI.DISPlay.WINDow(Ch).TRACe(Tr).Y.SCALe.RLEVel ............................................................131
SCPI.DISPlay.WINDow(Ch).TRACe(Tr).Y.SCALe.RPOSition ........................................................132
SCPI.DISPlay.WINDow(Ch).Y.SCALe.DIVisions.............................................................................133
SCPI.HCOPy.DATE.STAMp ..............................................................................................................134
SCPI.HCOPy.IMAGe...........................................................................................................................135
SCPI.HCOPy.IMMediate.....................................................................................................................136
SCPI.HCOPy.PAINt.............................................................................................................................137
SCPI.IEEE4882.IDN............................................................................................................................138
SCPI.IEEE4882.RST............................................................................................................................139
SCPI.IEEE4882.TRG...........................................................................................................................139
SCPI.IEEE4882.WAI...........................................................................................................................140
SCPI.INITiate(Ch).CONTinuous.........................................................................................................141
SCPI.INITiate(Ch).IMMediate.............................................................................................................142
SCPI.MMEMory.COPY(Src, Dst).......................................................................................................143
SCPI.MMEMory.DELete(File)............................................................................................................143
SCPI.MMEMory.LOAD.CKIT(Ck).....................................................................................................144
SCPI.MMEMory.LOAD.LIMit............................................................................................................145
SCPI.MMEMory.LOAD.RLIMit.........................................................................................................146
SCPI.MMEMory.LOAD.SEGMent .....................................................................................................147
SCPI.MMEMory.LOAD.STATe .........................................................................................................148
SCPI.MMEMory.MDIRectory.............................................................................................................149
SCPI.MMEMory.STORe.CKIT(Ck)....................................................................................................150
SCPI.MMEMory.STORe.FDATa........................................................................................................151
SCPI.MMEMory.STORe.IMAGe........................................................................................................152
SCPI.MMEMory.STORe.LIMit...........................................................................................................153
SCPI.MMEMory.STORe.RLIMit........................................................................................................154
SCPI.MMEMory.STORe.SEGMent ....................................................................................................155
SCPI.MMEMory.STORe.SNP.DATA.................................................................................................156
SCPI.MMEMory.STORe.SNP.FORMat..............................................................................................157
SCPI.MMEMory.STORe.STATe.........................................................................................................158
SCPI.MMEMory.STORe.STYPe.........................................................................................................159
SCPI.SENSe(Ch).AVERage.CLEar.....................................................................................................160
SCPI.SENSe(Ch).AVERage.COUNt...................................................................................................161
SCPI.SENSe(Ch).AVERage.STATe....................................................................................................162
SCPI.SENSe(Ch).BANDwidth.RESolution.........................................................................................163
SCPI.SENSe(Ch).CORRection.CLEar.................................................................................................164
SCPI.SENSe(Ch).CORRection.COEFficient.DATA(Str, Pt_r, Pt_s)..................................................165
SCPI.SENSe(Ch).CORRection.COLLect.ACQuire.LOAD.................................................................166
SCPI.SENSe(Ch).CORRection.COLLect.ACQuire.OPEN .................................................................167
SCPI.SENSe(Ch).CORRection.COLLect.ACQuire.SHORt................................................................168
SCPI.SENSe(Ch).CORRection.COLLect.ACQuire.THRU.................................................................169
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.LABel......................................................................170
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.RESet.......................................................................171
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.SELect .....................................................................171
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).C0 .........................................................173
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).C1 .........................................................174
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).C2 .........................................................175
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).C3 .........................................................176
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).DELay ..................................................177
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).L0 .........................................................178
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).L1 .........................................................179
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).L2 .........................................................180
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).L3 .........................................................181

PLANAR R54x2 COM/DCOM Programming manual
5
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).LABel...................................................182
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).LOSS....................................................183
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).TYPE....................................................184
SCPI.SENSe(Ch).CORRection.COLLect.CKIT.STAN(Std).Z0 .........................................................185
SCPI.SENSe(Ch).CORRection.COLLect.CLEar.................................................................................186
SCPI.SENSe(Ch).CORRection.COLLect.METHod.RESPonse.OPEN...............................................187
SCPI.SENSe(Ch).CORRection.COLLect.METHod.RESPonse.SHORt..............................................188
SCPI.SENSe(Ch).CORRection.COLLect.METHod.SOLT1...............................................................189
SCPI.SENSe(Ch).CORRection.COLLect.METHod.RESPonse.THRU ..............................................190
SCPI.SENSe(Ch).CORRection.COLLect.METHod.DUAL................................................................191
SCPI.SENSe(Ch).CORRection.COLLect.METHod.TYPE.................................................................192
SCPI.SENSe(Ch).CORRection.COLLect.SAVE.................................................................................193
SCPI.SENSe.CORRection.IMPedance.INPut.MAGNitude.................................................................194
SCPI.SENSe(Ch).CORRection.STATe................................................................................................195
SCPI.SENSe(Ch).CORRection.TYPE(Tr)...........................................................................................196
SCPI.SENSe(Ch).FREQuency.CENTer...............................................................................................197
SCPI.SENSe(Ch).FREQuency.DATA.................................................................................................198
SCPI.SENSe(Ch).FREQuency.SPAN..................................................................................................199
SCPI.SENSe(Ch).FREQuency.STARt.................................................................................................200
SCPI.SENSe(Ch).FREQuency.STOP ..................................................................................................201
SCPI.SENSe(Ch).SEGMent.DATA.....................................................................................................202
SCPI.SENSe(Ch).SWEep.POINt.TIME...............................................................................................203
SCPI.SENSe(Ch).SWEep.POINts........................................................................................................204
SCPI.SENSe(Ch).SWEep.TYPE..........................................................................................................205
SCPI.SERVice.CHANnel.ACTive.......................................................................................................206
SCPI.SERVice.CHANnel.COUNt .......................................................................................................206
SCPI.SERVice.CHANnel(Ch).TRACe.ACTive..................................................................................207
SCPI.SERVice.CHANnel.TRACe.COUNt..........................................................................................207
SCPI.SERVice.PORT.COUNt.............................................................................................................208
SCPI.SERVice.SWEep.FREQency.MAXimum ..................................................................................208
SCPI.SERVice.SWEep.FREQency.MINimum....................................................................................209
SCPI.SERVice.SWEep.POINts............................................................................................................209
SCPI.SOURce(Ch).POWer.LEVel.STATe..........................................................................................210
SCPI.SYSTem.CORRection.STATe....................................................................................................211
SCPI.SYSTem.DATE ..........................................................................................................................212
SCPI.SYSTem.DTFUnit ......................................................................................................................213
SCPI.SYSTem.PRESet.........................................................................................................................213
SCPI.SYSTem.TIME...........................................................................................................................214
SCPI.SYSTem.LOCal..........................................................................................................................215
SCPI.SYSTem.RWLock ......................................................................................................................215
SCPI.SYSTem.HIDe............................................................................................................................216
SCPI.SYSTem.SHOw..........................................................................................................................216
SCPI.TRIGger.SEQuence.IMMediate..................................................................................................217
SCPI.TRIGger.SEQuence.SINGle .......................................................................................................218
SCPI.TRIGger.SEQuence.SOURce .....................................................................................................219
Appendix 1. Error Codes ..................................................................................................................220
Appendix 2. Programming Examples............................................................................................221

PLANAR R54x2 COM/DCOM Programming manual
6
Introduction
This Programming Manual contains information on remote control over pair of
PLANAR R54 Vector Reflectometer and its data communication by means of user
programs written with COM/DCOM technology.
COM technology is used when a user program runs together with an external
measurement instrument program on one PC. DCOM technology is used when a user
program runs on a PC connected with the measurement instrument by LAN.
Methods and techniques for writing of user programs are same for the both
technologies. The only difference between the technologies is that the DCOM
technology requires additional LAN setting performed by the LAN administrator.
Before reading this Manual, familiarize yourself with PLANAR R54 Operating Manual.

PLANAR R54x2 COM/DCOM Programming manual
7
1COM Technology Overview
COM stands for Component Object Model. This programming technology was
developed by Microsoft for two purposes:
the model provides the specification for interaction of binary
modules created in different programming languages;
the model defines the interfacing between a client application and a
server application running either on the same PC or on two different
PCs. In the latter case, the technology has DCOM abbreviation –
Distributed COM.
2Automation Server
The PlanarR54x2.exe application contains a built-in COM server that enables other
programs to access its functionality. The PlanarR54x2.exe application COM server was
developed in conformity with the COM automation specification. COM automation is a
technology allowing control over the COM server by the programs written in both
traditional compiling programming languages and interpreting programming languages,
such as VBScript. This enables the server applications to make their functionality
accessible to many more clients.
To register the COM-server of PlanarR54x2.exe application in the system registry, start
the PlanarR54x2.exe application with /regserver key in command line during
installation. You can also register the COM-server in the similar manner manually.
To delete the COM-server registration from the system registry, start the
PlanarR54x2.exe application with /unregserver key in command line.
3Automation Controllers
Automation controllers are client programs, which use internal functionality of COM
servers. Automation controller programs are developed by users for writing their own
add-ons for the system.
User programs can be written in different languages:
programming languages with built-in COM support, such as Visual
Basic®, Delphi, Java;
universal programming languages, such as C, C++;
Microsoft Excel and Word office applications as they include built-in
programming language Visual Basic for Applications®;
program generators, such as National Instruments LabView®, or
HP–VEE.

PLANAR R54x2 COM/DCOM Programming manual
8
Examples represented in this Manual are written in Visual Basic (VB). Appendix 3
contains examples written in VB, and C++ languages.
Examples\COM\VBA folder contains source codes for examples written in Visual Basic
for Applications® (Microsoft Excel files).
Examples\COM\CPP folder contains source codes for the C++ language examples.
4Local and Remote Server
PlanarR54x2.exe application can function either as a local server or as a remote server
of COM automation.
Local server runs on the same PC with the automation controller and each of the
programs is executed as an individual application in a separate window. COM
technology is used in this case (Figure 1).
Remote server and the automation controller run on different PCs connected by LAN.
DCOM (Distributed COM) technology is used in this case (Figure 2). When using
DCOM it is necessary to configure the local network by means of DCOM Windows
tools.
COM technology is normally used to control pair of PLANAR R54.
The same automation controller is used for the both COM and DCOM technology.
Some changes to the user program may be required in operators, which establish
connection with the server. Moreover, DCOM technology requires additional settings of
the LAN performed by the LAN administrator.

PLANAR R54x2 COM/DCOM Programming manual
9
Figure 1. COM technology
Figure 2. DCOM technology
COM
USB
User
Program
Planar
R54X2
.exe
DCOM
Planar
R54X2
.exe
User Program
LAN
USB
Planar R54
Planar R54
Planar R54
Planar R54

PLANAR R54x2 COM/DCOM Programming manual
10
5Structure of COM Objects
COM server contains several objects, which provide different functionality of the
server. The COM objects of the PlanarR54x2.exe application are organized in a
hierarchical structure. Figure 3 shows the main COM objects, which comprise the first
three levels of the hierarchical structure of the PlanarR54x2.exe application COM
objects. COM objects provide various methods and properties, which allow access to
the server functions; besides, they allow access to the objects of the lower levels, which
are not shown in Figure 3.
Figure 3. The structure of COM objects
The Object Application of the PlanarR54x2.exe application is in the top of the
hierarchy. Access to the lower level objects is implemented via higher level objects.
Application
CALCulate DISPlay INITiateIEEE4882
SENSe
SYSTem
SOURceMMEMory
SCPI
TRIGer
OUTPutHCOPySERVice

PLANAR R54x2 COM/DCOM Programming manual
11
Note The hierarchy of COM objects is organized in accordance with
the standard and syntax of the SCPI programming language.
Operators in SCPI have hierarchical chain structure, for
example:
SCPI:CALCulate:SELected:FORMat SWR
The same COM command written in VB programming
language is as follows:
app.SCPI.CALCulate.SELected.FORMat = "SWR"
6Accessing the Application Object
To establish connection with the COM server application, create an object reference in
the client program. In COM programming the object reference needs to be acquired
preliminarily, to be used later to access the object functionality. To define an object in
Visual Basic perform the following:
1) Declare a variable as an object.
2) Assign the object to this variable.
To declare a variable, use Dim operator or other declaration statement (Public, Private
or Static). The variables used for references should of the types Variant, Object, or a
type of a specific object. For example, the following three operators declare app
variable:
Dim app
Dim app as Object
Dim app as R54x2.Application
Use Set operator and CreateObject (ObjectName, HostName) function to assign a
specific object to a variable.
ObjectName Automation object name is always equal to “R54x2.Applcation”
HostName Network name of the PC hosting the PlanarR54x2 COM server. This
parameter is not specified in case of a local server.

PLANAR R54x2 COM/DCOM Programming manual
12
For example, the following operators create Application object and assign it to app
variable:
Set app = CreateObject("R54x2.Applcation")
Set app = CreateObject("R54x2.Applcation", "Network_Name")
Note The first form of the operator is used to create the reference to
the local COM server, the second one is used to create the
reference to the remote DCOM server.
To allow access to the objects of a lower level of the hierarchy, these objects are
specified after the reference to the higher level object and separated from it by a dot. For
example:
Dim SystObj
Set SystObj = app.SCPI.SYSTem
COM objects can have indices. For example, CALCulate, INITiate, SENSe, SOURce
objects represent various aspects of the 4 measurement channels of the Analyzer.
Therefore, it is necessary to write the channel index from 1 to 4 to acquire the data of
these objects. For example:
Set SensObj1 = app.SCPI.SENSe(1)
Set SensObj2 = app.SCPI.SENSe(2)
Visual Basic allows omitting of such indices; in this case the indices are considered as
equal to 1. For example, the following VB operators are equivalent:
Set SensObj = app.SCPI.SENSe(1)
Set SensObj = app.SCPI.SENSe

PLANAR R54x2 COM/DCOM Programming manual
13
7Object Methods
Objects have methods. Methods are actions that can be applied to objects. The object
methods are specified after the object name and separated from it by a dot.
The following example shows the PRESet method of SYSTem object. This method
performs setting of the Analyzer to the preset condition:
app.SCPI.SYSTem.PRESet
8Object Properties
Along with methods, objects have properties. Properties are object characteristics that
can be set or read out. The object properties are specified after the object name and
separated from it by a dot.
To modify an object characteristic, write the value of the corresponding property. To
define an object characteristic, read out the value of its property. The following example
show the setting of the POINts property of SWEep object, i.e. the number of sweep
points:
app.SCPI.SENSe.SWEp.POINts = 201
Note Some object properties cannot be written, and some object
properties cannot be read. In such cases, the properties are
indicated as “read only” or “write only”.

PLANAR R54x2 COM/DCOM Programming manual
14
9Error Handling
You can use different approaches to error handling in VB program:
check the value of Err.Number variable after execution of VB
operator, which contains the call to R54x2 object;
use On Error goto VB operator.
These approaches are represented in the examples below. The following operator causes
an error in VB program as "S13" value of the DEFine property is incorrect.
app.SCPI.PARameter.DEFine = "S13"
In the first example, the value of the Err.Number variable is checked after execution of
the VB operator, which contains the call to R54x2 object. On Error Resume Next
directive instructs VB not to interrupt the program execution when the error is detected
but to pass control to the next operator in natural order.
Dim app
Public Sub HandleError1()
Set app = CreateObject("R54x2.Application")
On Error Resume Next
app.SCPI.PARameter.DEFine = "S13"
If Err.Number <> 0 Then
Msg = "Error # " & Str(Err.Number) & " was generated by " &_
Err.Source & Chr(13) & Err.Description
MsgBox Msg,,"Error"
End If
...
End Sub

PLANAR R54x2 COM/DCOM Programming manual
15
In the second example, On Error GoTo ErrHandler directive instructs VB to interrupt
the program execution when the error is detected and to pass control to ErrHandler
label.
Dim app
Public Sub HandleError2()
Set app = CreateObject("R54x2.Applcation")
On Error GoTo ErrHandler
app.SCPI.PARameter.DEFine = "S13"
...
Exit Sub
ErrHandler:
Msg = "Error # " & Str(Err.Number) & " was generated by " &_
Err.Source & Chr(13) & Err.Description
MsgBox Msg,,"Error"
End Sub

PLANAR R54x2 COM/DCOM Programming manual
16
10 COM Automation Data Types
In COM automation, there are the following data types, which can be used for client-to-
server communication:
Long
32-bit signed integer, value range from –2147483648 to 2147483647
Double
64-bit double-
precision floating point, value range from
–1.79769313486232E308 to –4.94065645841247E–324 for negative
values, and from 4.94065645841247E–324 to 1.79769313486232E308
for positive values
Boolean
16-bit integer, two values 0 – False, 1 – True
String
Variable-length string
Variant
Can be either a value of arbitrary type or an array of values of arbitrary
type. In this case, the term “arbitrary type” means any allowed type of
COM automation. A variable contains information about its type and
array size (if it is an array). It is used for communication of data arrays
between a client and a server.

PLANAR R54x2 COM/DCOM Programming manual
17
11 Measurement Data Arrays
Measurement data can be either complex values or real values. This depends on the
format selected by the user. For example, the data is real in logarithmic magnitude
format and the data is complex in polar format.
The measurement data is transferred in a Variant type variable, which represents an
array of Double type. To transfer one complex measurement, two adjacent array cells
are used. To transfer one real measurement two adjacent array cells are used as well but
the second cell is always equal to 0. Thus, measurement data array size is a double
number of the measurement points.
Measurement 1 Measurement 2 Measurement N
Real Imag Real Imag … Real Imag
Figure 4. Array of complex measurements
Measurement 1 Measurement 2 Measurement N
Value 0 Value 0 … Value 0
Figure 5. Array of real measurements

PLANAR R54x2 COM/DCOM Programming manual
18
12 COM Server Commands
NAME
Object Type
Property (read only)
Data Type
String
Description
Instrument information string. String format: manufacturer, model, serial
number, number of firmware version and number of software version.
Range
up to 40 characters
Syntax
Dim ID As String
ID = app.NAME
Equivalent Softkeys
None

PLANAR R54x2 COM/DCOM Programming manual
19
Ready(Pt)
Object Type
Property (read only)
Data Type
Boolean
Target
Port Pt: port number 1-2 (see Table 2 on page 22)
Description
Ready state of the instruments. Reads out the True value after successful
completion of the boot process (about 10 sec). The pair of PLANAR R54
must be connected to PC by a USB cable.
Syntax
Dim State as Boolean
State = app.Ready(2)
Equivalent Softkeys
None

PLANAR R54x2 COM/DCOM Programming manual
20
SCPI.ABORt
Object Type
Method
Description
Aborts the sweep. Switches trigger mode from Single to Hold, or from
Continuous to waiting for a trigger. If the trigger source is set to Internal,
starts a new sweep.
Syntax
app.SCPI.ABORt
Equivalent Softkeys
None
Table of contents
Other Planar Measuring Instrument manuals
Popular Measuring Instrument manuals by other brands

Hach
Hach POLYMETRON 8810 Basic user manual

Emerson
Emerson PENBERTHY H Series Installation, operation and maintenance instructions

Commtest Instruments
Commtest Instruments vbBalancer Instrument Reference Guide

Heyuan Intelligence
Heyuan Intelligence DZ81-METZ5C user manual

Matfer
Matfer 250152 Use and maintenance

J.ASSY
J.ASSY VISUM Monitor Operator's manual