programming handbook

Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
FCPM Series Integrated Frequency & Power Meters
Important Notice
This guide is owned by Mini-Circuits and is protected by copyright, trademark and other intellectual
property laws.
The information in this guide is provided by Mini-Circuits as an accommodation to our customers and
may be used only to promote and accompany the purchase of Mini-Circuits’ Parts. This guide may
not be reproduced, modified, distributed, published, stored in an electronic database, or transmitted
and the information contained herein may not be exploited in any form or by any means, electronic,
mechanical recording or otherwise, without prior written permission from Mini-Circuits.
This guide is subject to change, qualifications, variations, adjustments or modifications without
notice and may contain errors, omissions, inaccuracies, mistakes or deficiencies. Mini-Circuits
assumes no responsibility for, and will have no liability on account of, any of the foregoing.
Accordingly, this guide should be used as a guideline only.
Trademarks
Microsoft, Windows, Visual Basic, Visual C# and Visual C++ are registered trademarks of Microsoft
Corporation. LabVIEW and CVI are registered trademarks of National Instruments Corporation.
Delphi is a registered trademark of Delphi Technologies, Inc. MATLAB is a registered trademark of
The MathWorks, Inc. Agilent VEE is a registered trademark of Agilent Technologies, Inc. Linux is a
registered trademark of Linus Torvalds. Mac is a registered trademark of Apple Inc. Python is a
registered trademark of Python Software Foundation Corporation.
All other trademarks cited within this guide are the property of their respective owners. Neither
Mini-Circuits nor the Mini-Circuits PTE (portable test equipment) series are affiliated with or
endorsed or sponsored by the owners of the above referenced trademarks.
Mini-Circuits and the Mini-Circuits logo are registered trademarks of Scientific Components
Corporation.
Mini-Circuits
13 Neptune Avenue
Brooklyn, NY 11235, USA
Phone: +1-718-934-4500
Email: [email protected]
Web: www.minicircuits.com
1 - Overview ................................................................................................... 4
2 - Operating in a Windows Environment via USB .......................................... 5
2.1 - The DLL (Dynamic Link Library) Concept ................................................................. 5
2.1 (a) - ActiveX COM Object .......................................................................................................... 6
2.1 (b) - Microsoft.NET Class Library .............................................................................................. 8
2.2 - Referencing the DLL Library ................................................................................... 9
2.3 - Summary of DLL Properties/Functions ................................................................. 10
2.3 (a) - Common DLL Functions ................................................................................................... 10
2.3 (b) - DLL Properties & Functions for Power Measurement .................................................... 10
2.3 (c) - DLL Functions for Frequency Measurement ................................................................... 11
2.3 (d) - DLL Functions for Ethernet Configuration (RC Models Only).......................................... 11
2.4 - Common DLL Functions ....................................................................................... 12
2.4 (a) - Open USB Connection ..................................................................................................... 12
2.4 (b) - Close USB Connection ..................................................................................................... 13
2.4 (c) - Read Model Name ........................................................................................................... 14
2.4 (d) - Read Serial Number ........................................................................................................ 15
2.4 (e) - Get List of Connected Serial Numbers ............................................................................ 16
2.4 (f) - Get Status ......................................................................................................................... 17
2.4 (g) - Check Connection ............................................................................................................ 18
2.4 (h) - Get Internal Temperature ............................................................................................... 19
2.4 (i) - Get Firmware.................................................................................................................... 20
2.4 (j) - Get Firmware Version (Antiquated) ................................................................................. 21
2.4 (k) - Get USB Device Name ..................................................................................................... 22
2.4 (l) - Get USB Device Handle .................................................................................................... 23
2.4 (m) - Open Any Sensor (Antiquated) ...................................................................................... 24
2.4 (n) - Initialize Any Sensor (Antiquated)................................................................................... 25
2.4 (o) - Close Sensor Connection (Antiquated) ........................................................................... 26
2.5 - DLL Properties for Power Measurement .............................................................. 27
2.5 (a) - Set Compensation Frequency ......................................................................................... 27
2.5 (b) - Set Averaging Mode ........................................................................................................ 28
2.5 (c) - Set Average Count ........................................................................................................... 29
2.5 (d) - Set Power Format............................................................................................................ 30
2.5 (e) - Set Offset Value ............................................................................................................... 31
2.5 (f) - Enable Offset .................................................................................................................... 32
2.5 (g) - Set Measurement Mode ................................................................................................. 33
2.5 (h) - Set Power Range ............................................................................................................. 34
2.5 (i) - Read Power ...................................................................................................................... 35
2.5 (j) - Read Immediate Power .................................................................................................... 36
2.5 (k) - Read Voltage ................................................................................................................... 37
2.5 (l) - Get Offset Values.............................................................................................................. 38
2.5 (m) - Set Offset Values ............................................................................................................ 40
2.5 (n) - Set Compensation Frequency Mode ............................................................................... 42
2.5 (o) - Get Compensation Frequency Mode .............................................................................. 43
2.6 - DLL Functions for Frequency Measurement ......................................................... 44
2.6 (a) - Set Range ......................................................................................................................... 44
2.6 (b) - Get Range ........................................................................................................................ 45
2.6 (c) - Get Requested Range ...................................................................................................... 46
2.6 (d) - Set Sample Time .............................................................................................................. 47
2.6 (e) - Get Sample Time ............................................................................................................. 48
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 1
14-Jul-15 (A3)
2.6 (f) - Read Frequency................................................................................................................ 49
2.6 (g) - Get Reference Source ...................................................................................................... 50
2.7 - DLL Functions for Ethernet Configuration ............................................................. 51
2.7 (a) - Get Ethernet Configuration ............................................................................................. 51
2.7 (b) - Get IP Address ................................................................................................................. 53
2.7 (c) - Get MAC Address............................................................................................................. 55
2.7 (d) - Get Network Gateway ..................................................................................................... 57
2.7 (e) - Get Subnet Mask ............................................................................................................. 59
2.7 (f) - Get TCP/IP Port ................................................................................................................ 61
2.7 (g) - Get DHCP Status .............................................................................................................. 62
2.7 (h) - Get Password Status ....................................................................................................... 63
2.7 (i) - Get Password.................................................................................................................... 64
2.7 (j) - Save IP Address ................................................................................................................ 65
2.7 (k) - Save Network Gateway ................................................................................................... 66
2.7 (l) - Save Subnet Mask ............................................................................................................ 67
2.7 (m) - Save TCP/IP Port............................................................................................................. 68
2.7 (n) - Use DHCP......................................................................................................................... 69
2.7 (o) - Use Password .................................................................................................................. 70
2.7 (p) - Set Password ................................................................................................................... 71
3 - Operating in a Linux Environment via USB ................................................72
3.1 - Summary of USB Interrupt Functions ................................................................... 73
3.1 (a) - Common Functions ......................................................................................................... 73
3.1 (b) - Power Measurement Functions ...................................................................................... 73
3.1 (c) - Frequency Measurement Functions ................................................................................ 73
3.2 - Common Functions .............................................................................................. 74
3.2 (a) - Get Device Model Name ................................................................................................. 74
3.2 (b) - Get Device Serial Number ............................................................................................... 75
3.2 (c) - Get Internal Temperature ............................................................................................... 76
3.2 (d) - Get Firmware .................................................................................................................. 77
3.3 - Power Measurement Functions ........................................................................... 78
3.3 (a) - Set Measurement Mode ................................................................................................. 78
3.3 (c) - Set Compensation Frequency Mode ............................................................................... 79
3.3 (d) - Get Compensation Frequency Mode .............................................................................. 80
3.3 (e) - Read Power ..................................................................................................................... 81
3.4 - Frequency Measurement Functions ..................................................................... 83
3.4 (a) - Set Range ......................................................................................................................... 83
3.4 (b) - Get Range ........................................................................................................................ 84
3.4 (c) - Get Requested Range ...................................................................................................... 85
3.4 (d) - Set Sample Time .............................................................................................................. 86
3.4 (e) - Get Sample Time ............................................................................................................. 87
3.4 (f) - Get Reference Source ...................................................................................................... 88
3.4 (g) - Read Frequency ............................................................................................................... 89
4 - Ethernet Control over IP Networks ...........................................................90
4.1 (a) - Configuring Ethernet Settings via USB ............................................................................ 90
4.2 - Ethernet Communication Methodology ............................................................... 91
4.2 (a) - Setting Sensor Properties Using HTTP and SCPI .............................................................. 91
4.2 (b) - Querying Power Sensor Properties Using HTTP and SCPI ............................................... 92
4.2 (c) - Communication Using Telnet and SCPI ........................................................................... 93
4.3 - Device Discovery Using UDP ................................................................................ 94
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 2
14-Jul-15 (A3)
5 - SCPI Command Set for Ethernet Control ...................................................96
5.1 - Summary of SCPI Commands ............................................................................... 96
5.1 (a) - Common Commands ....................................................................................................... 96
5.1 (b) - Power Measurement Commands ................................................................................... 97
5.1 (c) - Frequency Measurement Commands ............................................................................. 97
5.2 - Common Commands ........................................................................................... 98
5.2 (a) - Get Model Name ............................................................................................................. 98
5.2 (b) - Get Serial Number ........................................................................................................... 99
5.2 (c) - Get Firmware ................................................................................................................. 100
5.2 (d) - Get Temperature Units ................................................................................................. 101
5.2 (e) - Set Temperature Units .................................................................................................. 102
5.2 (f) - Get Internal Temperature .............................................................................................. 103
5.3 - Power Measurement Commands ........................................................................104
5.3 (a) - Get Measurement Mode ............................................................................................... 104
5.3 (b) - Set Measurement Mode ............................................................................................... 105
5.3 (c) - Get Averaging Mode ...................................................................................................... 106
5.3 (d) - Set Averaging Mode ...................................................................................................... 107
5.3 (e) - Get Average Count ........................................................................................................ 108
5.3 (f) - Set Average Count.......................................................................................................... 109
5.3 (g) - Get Compensation Frequency ....................................................................................... 110
5.3 (h) - Set Compensation Frequency ....................................................................................... 111
5.3 (i) - Get Compensation Frequency Mode ............................................................................. 112
5.3 (j) - Set Compensation Frequency Mode .............................................................................. 113
5.3 (k) - Read Power ................................................................................................................... 114
5.3 (l) - Read Voltage .................................................................................................................. 115
5.4 - Frequency Measurement Commands ..................................................................116
5.4 (a) - Get Range ...................................................................................................................... 116
5.4 (b) - Get Requested Range .................................................................................................... 117
5.4 (c) - Set Range ....................................................................................................................... 118
5.4 (d) - Get Sample Time ........................................................................................................... 119
5.4 (e) - Set Sample Time ............................................................................................................ 120
5.4 (f) - Get Frequency ................................................................................................................ 121
5.4 (g) - Get Frequency & Power ................................................................................................ 122
5.4 (h) - Get Reference Mode ..................................................................................................... 123
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 3
14-Jul-15 (A3)
1 - Overview
This Programming Manual is intended for customers wishing to create their own interface for
Mini-Circuits' USB and Ethernet controlled, integrated frequency and power meters. For
instructions on using the supplied GUI program, or connecting the PTE hardware, please see
the User Guide at:
http://www.minicircuits.com/softwaredownload/AN-49-010_FCPM_User_guide.pdf
Mini-Circuits offers support over a variety of operating systems, programming environments
and third party applications.
Support for Windows® operating systems is provided through the Microsoft®.NET® and
ActiveX® frameworks to allow the user to develop customized control applications. Support
for Linux® operating systems is accomplished using the standard libhid and libusb libraries.
Mini-Circuits has experience with a wide variety of environments including (but not limited
to):








Visual Basic®, Visual C#®, Visual C++®
Delphi®
Borland C++®
CVI®
LabVIEW®
MATLAB®
Python®
Agilent VEE®
The integrated frequency and power meter software package includes a GUI program,
ActiveX and .NET DLL files, Linux support, project examples for third party software, and
detailed user manuals. The latest package is available for download at:
http://www.minicircuits.com/support/software_download.html
For details on individual models, application notes, GUI installation instructions and user
guides please see:
http://www.minicircuits.com/products/PortableTestEquipment.shtml
Files made available for download from the Mini-Circuits website are subject to Mini-Circuits’
terms of use which are available on the website.
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 4
14-Jul-15 (A3)
2 - Operating in a Windows Environment via USB
2.1 - The DLL (Dynamic Link Library) Concept
The Dynamic Link Library concept is Microsoft's implementation of the shared library
concept in the Windows environment.
DLLs provide a mechanism for shared code and data, intended to allow a developer to
distribute applications without requiring code to be re-linked or recompiled.
Mini-Circuits' CD package provides DLL Objects designed to allow your own software
application to interface with the functions of the Mini-Circuits integrated frequency and
power meter.
User’s Software Application
(3rd party software such as LabVIEW, Delphi, Visual C++,
Visual C#, Visual Basic, and Microsoft.Net)
DLL (Dynamic Link Libraries)
Mini-Circuits’
USB Portable Test Equipment
Fig 2.1-a: DLL Interface Concept
The software package provides two DLL files, the choice of which file to use is dictated by the
user’s operating system:
1. ActiveX com object
Designed to be used in any programming environment that supports third party
ActiveX COM (Component Object Model) compliant applications.
The ActiveX file should be registered using RegSvr32 (see following sections for
details).
2. Microsoft.NET Class Library
A logical unit of functionality that runs under the control of the Microsoft.NET
system.
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 5
14-Jul-15 (A3)
2.1 (a) - ActiveX COM Object
ActiveX COM object DLL files are designed to be used with both 32-bit and 64-bit Windows
operating systems. A 32-bit programming environment that is compatible with ActiveX is
required. To develop 64-bit applications, the Microsoft.NET Class library should be used
instead.
Supported Programming Environments
Mini-Circuits’ integrated frequency and power meters have been tested in the following
programming environments. This is not an exhaustive list and the DLL file is designed to
operate in most environments that support ActiveX functionality. Please contact MiniCircuits for support.
 Visual Studio® 6 (Visual C++ and Visual Basic)
 LabVIEW 8.0 or newer
 MATLAB 7 or newer
 Delphi
 Borland C++
 Agilent VEE
 Python
Installation
1. Copy the DLL file to the correct directory:
For 32-bit Windows operating systems this is C:\WINDOWS\System32
For 64-bit Windows operating systems this is C:\WINDOWS\SysWOW64
2. Open the Command Prompt:
a. For Windows XP® (see Fig 2.1-b):
i. Select “All Programs” and then “Accessories” from the Start Menu
ii. Click on “Command Prompt” to open
b. For later versions of the Windows operating system you will need to have
Administrator privileges in order to run the Command Prompt in “Elevated”
mode (see Fig 2.1-c for Windows 7 and Windows 8):
i. Open the Start Menu/Start Screen and type “Command Prompt”
ii. Right-click on the shortcut for the Command Prompt
iii. Select “Run as Administrator”
iv. You may be prompted to enter the log in details for an Administrator
account if the current user does not have Administrator privileges on the
local PC
3. Use regsvr32 to register the DLL:
For 32-bit Windows operating systems type (see Fig 2.1-d):
\WINDOWS\System32\Regsvr32 \WINDOWS\System32\mcl_pm.dll
For 64-bit Windows operating systems type (see Fig 2.1-e):
\WINDOWS\SysWOW64\Regsvr32 \WINDOWS\SysWOW64\mcl_pm.dll
4. Hit enter to confirm and a message box will appear to advise of successful registration.
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 6
14-Jul-15 (A3)
Fig 2.1-b: Opening the Command Prompt in Windows XP
Fig 2.1-c: Opening the Command Prompt in Windows 7 (left) and Windows 8 (right)
Fig 2.1-d: Registering the DLL in a 32-bit environment
Fig 2.1-e: Registering the DLL in a 64-bit environment
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 7
14-Jul-15 (A3)
2.1 (b) - Microsoft.NET Class Library
Microsoft.NET class libraries are designed to be used with both 32-bit and 64-bit Windows
operating systems. To develop 64-bit applications the user must have both a 64-bit
operating system and 64-bit programming environment. However, the Microsoft.NET class
library is also compatible with 32-bit programming environments.
Supported Programming Environments
Mini-Circuits’ integrated frequency and power meters have been tested in the following
programming environments. This is not an exhaustive list and the DLL file is designed to
operate in most environments that support Microsoft.NET functionality. Please contact
Mini-Circuits for support.
 National Instruments CVI
 Microsoft.NET (Visual C++, Visual Basic.NET, Visual C# 2003 or newer)
 LabVIEW 2009 or newer
 MATLAB 2008 or newer
 Delphi
 Borland C++
Installation
1. Copy the DLL file to the correct directory
a. For 32 bit Windows operating systems this is C:\WINDOWS\System32
b. For 64 bit Windows operating systems this is C:\WINDOWS\SysWOW64
2. No registration is required
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 8
14-Jul-15 (A3)
2.2 - Referencing the DLL Library
The DLL file should be installed in the host PC’s system folders using the steps outlined
above. Some programming environments will require the user to set a reference to the
relevant DLL file, usually through a built in GUI in the programming environment.
Once this is done, a new instance of the USB sensor class just needs to be created for each
physical sensor to control. The details of this vary greatly between programming
environments and languages but Mini-Circuits can provide detailed support on request. The
names "MyPTE1" and "MyPTE2" have been assigned to 2 connected sensors in the examples
below.
Example Declarations using the ActiveX DLL
Visual Basic
Public MyPTE1 As New mcl_pm.USB_PM
' Initialize new sensor object, assign to MyPTE1
Public MyPTE2 As New mcl_pm.USB_PM
' Initialize new sensor object, assign to MyPTE2
Visual C++
mcl_pm::USB_PM ^MyPTE1 = gcnew mcl_pm::USB_PM();
// Initialize new sensor instance, assign to MyPTE1
mcl_pm::USB_PM ^MyPTE2 = gcnew mcl_pm::USB_PM();
// Initialize new sensor instance, assign to MyPTE2
Visual C#
mcl_pm.USB_PM MyPTE1 = new mcl_pm.USB_PM();
// Initialize new sensor instance, assign to MyPTE1
mcl_pm.USB_PM MyPTE2 = new mcl_pm.USB_PM();
// Initialize new sensor instance, assign to MyPTE2
Matlab
MyPTE1 = actxserver('mcl_pm.USB_PM')
% Initialize new sensor instance, assign to MyPTE1
MyPTE2 = actxserver('mcl_pm.USB_PM')
% Initialize new sensor instance, assign to MyPTE2
Example Declarations using the .NET DLL
Visual Basic
Public MyPTE1 As New mcl_pm64.usb_pm
' Initialize new sensor object, assign to MyPTE1
Public MyPTE2 As New mcl_pm64.usb_pm
' Initialize new sensor object, assign to MyPTE2
Visual C++
mcl_pm64::usb_pm ^MyPTE1 = gcnew mcl_pm64::usb_pm();
// Initialize new sensor instance, assign to MyPTE1
mcl_pm64::usb_pm ^MyPTE2 = gcnew mcl_pm64::usb_pm();
// Initialize new sensor instance, assign to MyPTE2
Visual C#
mcl_pm64.usb_pm MyPTE1 = new mcl_pm64.usb_pm();
// Initialize new sensor instance, assign to MyPTE1
mcl_pm64.usb_pm MyPTE2 = new mcl_pm64.usb_pm();
// Initialize new sensor instance, assign to MyPTE2
Matlab
MyPTE1 = actxserver('mcl_pm64.usb_pm')
% Initialize new sensor instance, assign to MyPTE1
MyPTE2 = actxserver('mcl_pm64.usb_pm')
% Initialize new sensor instance, assign to MyPTE2
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 9
14-Jul-15 (A3)
2.3 - Summary of DLL Properties/Functions
The following functions and “global” properties are defined in both of the DLL files to allow
full control over the sensor. Please see the following sections for a description of their
usage.
2.3 (a) - Common DLL Functions
a) int Open_Sensor(Optional string SN_Request)
b)
c)
d)
e)
f)
g)
h)
i)
j)
k)
l)
m)
n)
o)
(ActiveX)
short Open_Sensor(Optional string SN_Request)
(.NET)
void Close_Sensor()
string GetSensorModelName()
string GetSensorSN()
short Get_Available_SN_List(ByRef string SN_List)
short GetStatus()
short Check_Connection()
float GetDeviceTemperature(Optional string
TemperatureFormat)
(ActiveX)
float GetDeviceTemperature(Optional ByRef string
TemperatureFormat)
(.NET)
short GetFirmwareInfo(ByRef short FirmwareID,
ByRef string FirmwareRev, ByRef short FirmwareNo)
short GetFirmwareVer(ByRef short FirmwareVer)
string GetUSBDeviceName()
string GetUSBDeviceHandle()
short Open_AnySensor()
void Init_PM()
void CloseConnection()
2.3 (b) - DLL Properties & Functions for Power Measurement
a)
b)
c)
d)
e)
f)
g)
h)
i)
j)
k)
l)
m)
n)
o)
double Freq
short AVG
short AvgCount
bool Format_mw
single OffsetValue
short OffsetValue_Enable
void SetFasterMode(short S_A)
(ActiveX)
void SetFasterMode(ByRef short S_A)
(.NET)
void SetRange(short Range)
float ReadPower()
float ReadImmediatePower()
float ReadVoltage()
short GetOffsetValues(ByRef int NoOfPoints,
ByRef double FreqArray(), ByRef single LossArray())
int SetOffsetValues(int NoOfPoints, double FreqArray(),
single LossArray())
(ActiveX)
int SetOffsetValues(int NoOfPoints, ByRef double FreqArray(),
ByRef single LossArray())
(.NET)
short FC_SetAutoFreq(short AutoFreq)
short FC_GetAutoFreq()
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 10
14-Jul-15 (A3)
2.3 (c) - DLL Functions for Frequency Measurement
a)
b)
c)
d)
e)
f)
g)
short FC_SetRange(short Range)
short FC_GetRange()
short FC_GetRequestedRange()
short FC_SetSampleTime(short SampleTime)
int FC_GetSampleTime()
Double FC_ReadFreq()
short FC_GetRef()
2.3 (d) - DLL Functions for Ethernet Configuration (RC Models Only)
a) int GetEthernet_CurrentConfig(ByRef int IP1, int IP2,
ByRef int IP3, ByRef int IP4, ByRef int Mask1,
ByRef int Mask2, ByRef int Mask3, ByRef int Mask4,
ByRef int Gateway1, ByRef int Gateway2,
ByRef int Gateway3, ByRef int Gateway4)
b) int GetEthernet_IPAddress(ByRef int b1, ByRef int b2,
ByRef int b3, int b4)
c) int GetEthernet_MACAddress(ByRef int MAC1 , ByRef int MAC2,
ByRef int MAC3, ByRef int MAC4,
ByRef int MAC5, ByRef int MAC6)
d) int GetEthernet_NetworkGateway(ByRef int b1, ByRef int b2,
ByRef int b3, ByRef int b4)
e) int GetEthernet_SubNetMask(ByRef int b1, ByRef int b2,
ByRef int b3, ByRef int b4)
f) int GetEthernet_TCPIPPort(ByRef int port)
g) int GetEthernet_UseDHCP()
h) int GetEthernet_UsePWD()
i) int GetEthernet_PWD(ByRef string Pwd)
j) int SaveEthernet_IPAddress(int b1, int b2, int b3, int b4)
k) int SaveEthernet_NetworkGateway(int b1, int b2, int b3, int b4)
l) int SaveEthernet_SubnetMask(int b1, int b2, int b3, int b4)
m) int SaveEthernet_TCPIPPort(int port)
n) int SaveEthernet_UseDHCP(int UseDHCP)
o) int SaveEthernet_UsePWD(int UsePwd)
p) int SaveEthernet_PWD(string Pwd)
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 11
14-Jul-15 (A3)
2.4 - Common DLL Functions
2.4 (a) - Open USB Connection
ActiveX Declaration (mcl_pm.dll)
short Open_Sensor(Optional string SN)
.NET Declaration (mcl_pm64.dll)
short Open_Sensor(Optional ByRef string SN)
Description
This function is called to initialize the connection to a USB sensor head. If multiple sensors
are connected to the same computer, then the serial number should be included, otherwise
this can be omitted. The connection process can take a few seconds so it is recommended
that the connection be made once at the beginning of the routine and left open until the
sensor is no longer needed. The sensor should be disconnected on completion of the
program using the Close_Sensor function.
Parameters
Data Type
string
Variable
SN
Description
Optional. A string containing the serial number of the sensor.
Can be omitted if only one sensor is connected but must be
included otherwise.
Value
0
1
2
3
Description
No connection was possible
Connection successfully established
Device already connected
Requested serial number is not available
Return Values
Data Type
short
Examples
Visual Basic
Status = MyPTE1.Open_Sensor(SN_Request)
Visual C++
Status = MyPTE1->Open_Sensor(SN_Request);
Visual C#
Status = MyPTE1.Open_Sensor(SN_Request);
Matlab
Status = MyPTE1.Open_Sensor("1130902001")
See Also
Close USB Connection
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 12
14-Jul-15 (A3)
2.4 (b) - Close USB Connection
Declaration
void Close_Sensor()
Description
This function is called to close the connection to the sensor head. It is strongly
recommended that this function is used prior to ending the program. Failure to do so may
result in a connection problem with the device. Should this occur, shut down the program
and unplug the sensor from the computer, then reconnect before attempting to start again.
Parameters
Data Type
None
Variable
Description
Value
Description
Return Values
Data Type
None
Examples
Visual Basic
MyPTE1.Close_Sensor()
Visual C++
MyPTE1->Close_Sensor();
Visual C#
MyPTE1.Close_Sensor();
Matlab
MyPTE1.Close_Sensor
See Also
Open USB Connection
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 13
14-Jul-15 (A3)
2.4 (c) - Read Model Name
Declaration
string GetSensorModelName()
Description
This function is called to determine the Mini-Circuits part number of the connected sensor.
Parameters
Data Type
None
Variable
Description
Value
Model
Description
Mini-Circuits model name of the connected sensor
Return Values
Data Type
string
Examples
Visual Basic
MsgBox ("The connected sensor is " & MyPTE1.GetSensorModelName)
Visual C++
MessageBox::Show ("The connected sensor is " + MyPTE1->GetSensorModelName());
Visual C#
MessageBox.Show ("The connected sensor is " + MyPTE1.GetSensorModelName());
Matlab
ModelName = MyPTE1.GetSensorModelName
msgbox('The connected sensor is ', ModelName)
See Also
Read Serial Number
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 14
14-Jul-15 (A3)
2.4 (d) - Read Serial Number
Declaration
string GetSensorSN()
Description
This function is called to determine the serial number of the connected sensor.
Parameters
Data Type
None
Variable
Description
Value
SN
Description
Serial number of the connected sensor
Return Values
Data Type
string
Examples
Visual Basic
MsgBox ("The connected sensor is " & MyPTE1.GetSensorSN)
Visual C++
MessageBox::Show ("The connected sensor is " + MyPTE1->GetSensorSN());
Visual C#
MessageBox.Show ("The connected sensor is " + MyPTE1.GetSensorSN());
Matlab
SN = MyPTE1.GetSensorSN
msgbox('The connected sensor is ', SN)
See Also
Read Model Name
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 15
14-Jul-15 (A3)
2.4 (e) - Get List of Connected Serial Numbers
Declaration
short Get_Available_SN_List(ByRef string SN_List)
Description
This function takes a user defined variable and updates it with a list of serial numbers for all
available (currently connected) integrated frequency & power sensors.
Parameters
Data Type
string
Variable
SN_List
Description
Required. string variable which the function will update with
a list of all available serial numbers, separated by a single
space character, for example “11110001 11110002
11110003”.
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
short
short
Examples
Visual Basic
If MyPTE1.Get_Available_SN_List(SN_List) > 0 Then
array_SN() = Split(SN_List, " ")
' Split the list into an array of serial numbers
For i As Integer = 0 To array_SN.Length - 1
' Loop through the array and use each serial number
Next
End If
Visual C++
if (MyPTE1 ->Get_Available_SN_List(SN_List) > 0)
{
// split the List into array of SN's
}
Visual C#
if (MyPTE1.Get_Available_SN_List(ref(SN_List)) > 0)
{
// split the List into array of SN's
}
Matlab
[status, SN_List]= MyPTE1.Get_Available_SN_List(SN_List)
If status > 0 then
{
% split the List into array of SN's
}
See Also
Open USB Connection
Read Serial Number
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 16
14-Jul-15 (A3)
2.4 (f) - Get Status
Declaration
short GetStatus()
Description
This function checks whether the USB connection to the sensor is still active.
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
No connection
USB connection to power sensor is active
Return Values
Data Type
short
short
Examples
Visual Basic
Status = MyPTE1.Get_Status
Visual C++
Status= MyPTE1->Get_Status();
Visual C#
Status= MyPTE1.Get_Status();
Matlab
Status= MyPTE1.Get_Status
See Also
Read Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 17
14-Jul-15 (A3)
2.4 (g) - Check Connection
Declaration
short Check_Connection()
Description
This function checks whether the USB connection to the power sensor is still active.
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
No connection
USB connection to power sensor is active
Return Values
Data Type
short
short
Examples
Visual Basic
Status = MyPTE1.Check_Connection
Visual C++
Status= MyPTE1->Check_Connection();
Visual C#
Status= MyPTE1.Check_Connection();
Matlab
Status= MyPTE1.Check_Connection
See Also
Read Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 18
14-Jul-15 (A3)
2.4 (h) - Get Internal Temperature
ActiveX Declaration (mcl_pm.dll)
float GetDeviceTemperature(Optional string TemperatureFormat)
.NET Declaration (mcl_pm64.dll)
float GetDeviceTemperature(Optional ByRef string TemperatureFormat)
Description
This function returns the internal temperature of the sensor in degrees Celsius (default) or
Fahrenheit.
Parameters
Data Type
string
Variable
Description
Temperature Optional. string (not case sensitive) to set the temperature
_Format
measurement units:
F - Set temperature units to Fahrenheit
C- Set temperature units to Celsius (default)
Return Values
Data Type
float
Value
Description
Temperature The device internal temperature in degrees Celsius
Examples
Visual Basic
MsgBox ("Temperature is " & MyPTE1.GetDeviceTemperature)
Visual C++
MessageBox::Show ("Temperature is " + MyPTE1->GetDeviceTemperature());
Visual C#
MessageBox.Show ("Temperature is " + MyPTE1.GetDeviceTemperature());
Matlab
MsgBox ("Temperature is " & MyPTE1.GetDeviceTemperature)
See Also
Read Power
Read Immediate Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 19
14-Jul-15 (A3)
2.4 (i) - Get Firmware
Declaration
short GetFirmwareInfo(ByRef short FirmwareID,
ByRef string FirmwareRev, ByRef short FirmwareNo)
Description
This function returns the internal firmware version of the sensor.
Parameters
Data Type
short
string
short
Variable
Description
FirmwareID
Required. User defined variable for factory use only.
FirmwareRev Required. User defined variable which will be updated with the
current firmware version, for example “B3”.
FirmwareNo Required. User defined variable for factory use only.
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Examples
Visual Basic
If MyPTE1.GetFirmwareInfo(fID, fRev, fNo) > 0 Then
MsgBox ("Firmware version is " & fRev)
End If
Visual C++
if (MyPTE1->GetFirmwareInfo(fID, fRev, fNo) > 0 )
{
MessageBox::Show("Firmware version is " + fRev);
}
Visual C#
if (MyPTE1.GetFirmwareInfo(ref(fID, fRev, fNo)) > 0 )
{
MessageBox.Show("Firmware version is " + fRev);
}
Matlab
[status, fID, fRev, fNo]=MyPTE1.GetFirmwareInfo(fID, fRev, fNo)
If status > 0 then
{
msgbox('Firmware version is ', fRev)
}
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 20
14-Jul-15 (A3)
2.4 (j) - Get Firmware Version (Antiquated)
Declaration
short GetFirmwareVer(ByRef short FirmwareVer)
Description
This function is antiquated, GetFirmwareInfo should be used instead. GetFirmwareVer
returns a numeric value which indicates the internal firmware version of the sensor.
Parameters
Data Type
short
Variable
Description
FirmwareVer Required. User defined variable which will be updated with the
firmware version number
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Examples
Visual Basic
status = MyPTE1.GetFirmwareVer(FirmwareVer)
Visual C++
status = MyPTE1->GetFirmwareVer(FirmwareVer);
Visual C#
status = MyPTE1.GetFirmwareVer(FirmwareVer);
Matlab
status = MyPTE1.GetFirmwareVer(FirmwareVer)
See Also
Get Firmware
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 21
14-Jul-15 (A3)
2.4 (k) - Get USB Device Name
Declaration
string GetUSBDeviceName()
Description
This function is for advanced users to identify the USB device name of the sensor for direct
communication.
Parameters
Data Type
None
Variable
Description
Return Values
Data Type
string
Value
Description
DeviceName Device name of the sensor head
Examples
Visual Basic
UsbName = MyPTE1.GetUSBDeviceName
Visual C++
UsbName = MyPTE1->GetUSBDeviceName();
Visual C#
UsbName = MyPTE1.GetUSBDeviceName();
Matlab
UsbName = MyPTE1.GetUSBDeviceName
See Also
Get USB Device Handle
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 22
14-Jul-15 (A3)
2.4 (l) - Get USB Device Handle
Declaration
string GetUSBDeviceHandle()
Description
This function is for advanced users to identify the handle to the USB sensor for direct
communication.
Parameters
Data Type
None
Variable
Description
Return Values
Data Type
string
Value
Description
HandleToUSB USB handle of the power sensor head
Examples
Visual Basic
UsbHandle = MyPTE1.GetUSBDeviceHandle
Visual C++
UsbHandle = MyPTE1->GetUSBDeviceHandle();
Visual C#
UsbHandle = MyPTE1.GetUSBDeviceHandle();
Matlab
UsbHandle = MyPTE1.GetUSBDeviceHandle
See Also
Get USB Device Name
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 23
14-Jul-15 (A3)
2.4 (m) - Open Any Sensor (Antiquated)
Declaration
short Open_AnySensor()
Description
This function is included for compatibility with early models, Open_Sensor is the
recommended method to connect to a sensor head.
This function initializes the connection to a USB sensor head. If multiple sensors are
connected to the same computer, it is not possible to determine which sensor will be
initialized. The connection process can take a few milliseconds so it is recommended that
the connection be made once at the beginning of the routine and left open until the sensor is
no longer needed. The sensor should be disconnected on completion of the program using
the Close_Sensor function.
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
No connection was possible
Connection successfully established
Return Values
Data Type
short
See Also
Open USB Connection
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 24
14-Jul-15 (A3)
2.4 (n) - Initialize Any Sensor (Antiquated)
Declaration
void Init_PM()
Description
This function is included for compatibility with early models, Open_Sensor is the
recommended method to connect to a sensor head.
This function initializes the connection to a USB sensor head. If multiple sensors are
connected to the same computer, it is not possible to determine which sensor will be
initialized. The connection process can take a few milliseconds so it is recommended that
the connection be made once at the beginning of the routine and left open until the sensor is
no longer needed. The sensor should be disconnected on completion of the program using
the Close_Sensor function.
Parameters
Data Type
None
Variable
Description
Value
Description
Return Values
Data Type
None
See Also
Open USB Connection
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 25
14-Jul-15 (A3)
2.4 (o) - Close Sensor Connection (Antiquated)
Declaration
void CloseConnection()
Description
This function is included for compatibility with early models, Close_Sensor is the
recommended method to disconnect from a USB sensor head.
Parameters
Data Type
None
Variable
Description
Value
Description
Return Values
Data Type
None
See Also
Close USB Connection
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 26
14-Jul-15 (A3)
2.5 - DLL Properties for Power Measurement
2.5 (a) - Set Compensation Frequency
Property
Double Freq
Description
This property sets the compensation frequency of the sensor head during operation in
manual compensation mode; this needs to be set in order to achieve the specified power
measurement accuracy. In automatic frequency compensation mode, the power reading is
automatically compensated based on the sensor's simultaneous frequency measurement.
Note: This property will not filter out unwanted signals.
Accepted Values
Data Type
Double
Value
Frequency
Description
A frequency within the power sensor’s specified range
Examples
Visual Basic
status = MyPTE1.FC_SetAutoFreq(0)
MyPTE1.Freq = 1000
Visual C++
status = MyPTE1->FC_SetAutoFreq(0);
MyPTE1->Freq = 1000;
Visual C#
status = MyPTE1.FC_SetAutoFreq(0);
MyPTE1.Freq = 1000;
Matlab
status = MyPTE1.FC_SetAutoFreq(0)
MyPTE1.Freq = 1000
See Also
Set Compensation Frequency Mode
Get Compensation Frequency Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 27
14-Jul-15 (A3)
2.5 (b) - Set Averaging Mode
Property
short AVG
Description
This property enables the “averaging” mode of the sensor so that power readings will be
averaged over a number of measurements (defined by the AvgCount property). The default
value is 0 (averaging disabled).
Accepted Values
Data Type
short
short
Value
0
1
Description
Disable averaging mode
Enable averaging mode
Examples
Visual Basic
MyPTE1.AVG = 1
Visual C++
MyPTE1->AVG = 1;
Visual C#
MyPTE1.AVG = 1;
Matlab
MyPTE1.AVG = 1
See Also
Set Average Count
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 28
14-Jul-15 (A3)
2.5 (c) - Set Average Count
Property
short AvgCount
Description
This property defines the number of power readings over which to average the
measurement when averaging mode is enabled (defined by the AVG property). The default
value is 1 (average the reading over 1 measurement).
Accepted Values
Data Type
short
Value
Count
Description
The number of power measurements to average (1 to 16)
Examples
Visual Basic
MyPTE1.AvgCount = 10
Visual C++
MyPTE1->AvgCount = 10;
Visual C#
MyPTE1.AvgCount = 10;
Matlab
MyPTE1.AvgCount = 10
See Also
Set Averaging Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 29
14-Jul-15 (A3)
2.5 (d) - Set Power Format
Property
bool Format_mw
Description
This property sets the power measurement units to either mW or dBm. The default is dBm.
Accepted Values
Data Type
bool
bool
Value
False
True
Description
Power reading in dBm
Power reading in mW
Examples
Visual Basic
MyPTE1.Format_mw = TRUE
Visual C++
MyPTE1->Format_mw = TRUE;
Visual C#
MyPTE1.Format_mw = TRUE;
Matlab
MyPTE1.Format_mw = TRUE
See Also
Read Power
Read Immediate Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 30
14-Jul-15 (A3)
2.5 (e) - Set Offset Value
Property
Double OffsetValue
Description
This property sets a single offset value to be used for power readings. The sensor's offset
type must be set to “1” in order to use this (see OffsetValue_Enable).
Accepted Values
Data Type
Double
Value
Offset
Description
The power offset in either dBm or mW (as specified by
Format_mw)
Examples
Visual Basic
MyPTE1.OffsetValue_enable = 1
MyPTE1.OffsetValue = 5.4
' Set a 5.4dB offset to the power readings
Visual C++
MyPTE1->OffsetValue_enable = 1;
MyPTE1->OffsetValue = 5.4;
// Set a 5.4dB offset to the power readings
Visual C#
MyPTE1.OffsetValue_enable = 1;
MyPTE1.OffsetValue = 5.4;
// Set a 5.4dB offset to the power readings
Matlab
MyPTE1.OffsetValue_enable = 1
MyPTE1.OffsetValue = 5.4
% Set a 5.4dB offset to the power readings
See Also
Enable Offset
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 31
14-Jul-15 (A3)
2.5 (f) - Enable Offset
Property
short OffsetValue_enable
Description
This property defines whether an offset is to be used for power readings. The sensor can use
either a single offset value (set using the Set Offset Value property) or an array of offset
values (set by the Set Offset Values function).
Accepted Values
Data Type
short
short
short
Value
0
1
2
Description
Offset disabled
Use single value offset (see Set Offset Value)
Use array of offset values (see Set Offset Values)
Examples
Visual Basic
MyPTE1.OffsetValue_enable = 1
MyPTE1.OffsetValue = 5.4
' Set a 5.4dB offset to the power readings
Visual C++
MyPTE1->OffsetValue_enable = 1;
MyPTE1->OffsetValue = 5.4;
// Set a 5.4dB offset to the power readings
Visual C#
MyPTE1.OffsetValue_enable = 1;
MyPTE1.OffsetValue = 5.4;
// Set a 5.4dB offset to the power readings
Matlab
MyPTE1.OffsetValue_enable = 1
MyPTE1.OffsetValue = 5.4
% Set a 5.4dB offset to the power readings
See Also
Set Offset Value
Get Offset Values
Set Offset Values
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 32
14-Jul-15 (A3)
2.5 (g) - Set Measurement Mode
ActiveX Declaration (mcl_pm.dll)
void SetFasterMode(short S_A)
.NET Declaration (mcl_pm64.dll)
void SetFasterMode(ByRef short S_A)
Description
This function sets the power measurement mode of the sensor between "low noise" and
"fast sampling" modes. The specifications for these modes are defined in the individual
model datasheets. The default is "low noise" mode.
Parameters
Data Type
short
Variable
S_A
Description
Reference to a user defined variable which determines the
noise/sampling modes. The options are:
0 = Low noise mode
1 = Fast sampling mode
Value
Description
Return Values
Data Type
None
Examples
Visual Basic
MyPTE1.SetFasterMode(S_A)
Visual C++
MyPTE1->SetFasterMode(S_A);
Visual C#
MyPTE1.SetFasterMode(S_A);
Matlab
MyPTE1.SetFasterMode(S_A)
See Also
Set Power Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 33
14-Jul-15 (A3)
2.5 (h) - Set Power Range
Declaration
void SetRange(short Range)
Description
This function optimizes the power measurement for the expected input power range. It is
recommended that the sensor be left in the default “Auto” mode.
Parameters
Data Type
short
Variable
Range
Description
Reference to a user defined variable which determines the
input power range. The options are:
0 = Auto
1 = Low power
2 = High power
Value
Description
Return Values
Data Type
None
Examples
Visual Basic
MyPTE1.SetRange(Range)
Visual C++
MyPTE1->SetRange(Range);
Visual C#
MyPTE1.SetRange(Range);
Matlab
MyPTE1.SetRange(Range)
See Also
Set Faster Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 34
14-Jul-15 (A3)
2.5 (i) - Read Power
Declaration
float ReadPower()
Description
This function returns the sensor power measurement. The default units are dBm but this can
be set to mW using the Format_mw property.
Parameters
Data Type
None
Variable
Description
Value
Power
Description
Numerical value containing the current power measurement at
the sensor head
The measured power level is too low (outside of the sensor’s
input dynamic range)
The measured power level is too high (outside of the sensor’s
input dynamic range)
Return Values
Data Type
float
-99
99
Examples
Visual Basic
Pwr = MyPTE1.ReadPower
Visual C++
Pwr = MyPTE1->ReadPower();
Visual C#
Pwr = MyPTE1.ReadPower();
Matlab
Pwr = MyPTE1.ReadPower
See Also
Set Power Format
Read Immediate Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 35
14-Jul-15 (A3)
2.5 (j) - Read Immediate Power
Declaration
float ReadImmediatePower()
Description
This function returns the power measurement with a faster response but reduced accuracy
compared to ReadPower. This function does not measure the temperature in the same
process so temperature compensation is based on the last recorded reading (taken when the
ReadPower or GetDeviceTemperature functions were last called). For greatest accuracy,
ReadPower should be used. The default units are dBm but this can be set to mW using the
Format_mw property.
Parameters
Data Type
None
Variable
Description
Value
Power
Description
Uncompensated power measurement
Return Values
Data Type
float
Examples
Visual Basic
Pwr = MyPTE1.ReadImmediatePower
Visual C++
Pwr = MyPTE1->ReadImmediatePower();
Visual C#
Pwr = MyPTE1.ReadImmediatePower();
Matlab
Pwr = MyPTE1.ReadImmediatePower
See Also
Set Power Format
Read Immediate Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 36
14-Jul-15 (A3)
2.5 (k) - Read Voltage
Declaration
float ReadVoltage()
Description
This function returns the raw voltage detected at the sensor head. There is no calibration for
temperature or frequency.
Parameters
Data Type
None
Variable
Description
Value
Voltage
Description
Voltage detected at the sensor head
Return Values
Data Type
float
Examples
Visual Basic
Voltage = MyPTE1.ReadVoltage
Visual C++
Voltage = MyPTE1->ReadVoltage();
Visual C#
Voltage = MyPTE1.ReadVoltage();
Matlab
Voltage = MyPTE1.ReadVoltage
See Also
Read Power
Read Immediate Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 37
14-Jul-15 (A3)
2.5 (l) - Get Offset Values
Declaration
short GetOffsetValues(ByRef int NoOfPoints, ByRef double FreqArray(),
ByRef single LossArray())
Description
This function returns the values used in the offset array when the sensor has been set to
operate in “array offset” mode (see Enable Offset).
Parameters
Data Type
int
Variable
NoOfPoints
Double
FreqArray
float
LossArray
Description
Required. User defined variable which will be updated with the
number of offset points specified in the array.
Required. User defined array variable which will be updated
with the list of frequency values (MHz) specified for the array
offset.
Required. User defined array variable which will be updated
with the list of loss values (dB) specified for the array offset.
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 38
14-Jul-15 (A3)
Examples
Visual Basic
MyPTE1.GetOffsetValues(pts, freq, loss)
For i=0 To pts - 1
MsgBox (i & ": " & freq(i) & "MHz, " & loss(i) & "dB")
Next
Visual C++
MyPTE1->GetOffsetValues(pts, freq, loss);
for (i = 0; i < pts; i++)
{
MessageBox::Show(i + ": " + freq[i] + "MHz, " + loss[i] + "dB");
}
Visual C#
MyPTE1.GetOffsetValues(ref(pts, freq, loss));
for (i = 0; i < pts; i++)
{
MessageBox.Show(i + ": " + freq[i] + "MHz, " + loss[i] + "dB");
}
Matlab
[status, pts, freq, loss]=MyPTE1.GetOffsetValues(pts, freq, loss)
maxi=pts-1
for i=0:maxi
msgbox([i,': ',freq(i),'MHz ',loss(i),'dB'])
end
See Also
Enable Offset
Set Offset Values
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 39
14-Jul-15 (A3)
2.5 (m) - Set Offset Values
ActiveX Declaration (mcl_pm.dll)
short SetOffsetValues(int NoOfPoints, double FreqArray(),
_ single LossArray())
.NET Declaration (mcl_pm64.dll)
short SetOffsetValues(int NoOfPoints, ByRef double FreqArray(),
ByRef single LossArray())
Description
This function sets the array of offset values to be used for power measurements. The sensor
must be set to operate in “array offset” mode (see Enable Offset).
Parameters
Data Type
int
Variable
NoOfPoints
Double
FreqArray
float
LossArray
Description
Required. The number of offset points to be defined in the
array.
Required. Array of size “NoOfPoints” containing the frequency
(MHz) values of the respective offset points.
Required. Array of size “NoOfPoints” containing the loss 9dB)
values of the respective offset points.
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 40
14-Jul-15 (A3)
Examples
Visual Basic
Dim pts As Integer = 4
Dim freq(1000, 2000, 3000, 4000) As Double
Dim loss(0, 0.5, 1, 1.5) As float
MyPTE1.SetOffsetValues(pts, freq, loss)
' Set 4 offset values:
' 0dB @ 1000MHz; 0.5dB @ 2000MHz; 1dB @ 3000MHz; 1.5dB @ 4000MHz
Visual C++
int pts = 4;
double freq [pts] = {1000, 2000, 3000, 4000};
float loss [pts] = {0, 0.5, 1, 1.5};
MyPTE1->SetOffsetValues(pts, freq, loss);
// Set 4 offset values:
// 0dB @ 1000MHz; 0.5dB @ 2000MHz; 1dB @ 3000MHz; 1.5dB @ 4000MHz
Visual C#
int pts = 4;
double[] freq = {1000, 2000, 3000, 4000};
float[] loss = {0, 0.5, 1, 1.5};
MyPTE1->SetOffsetValues(pts, freq, loss);
// Set 4 offset values:
// 0dB @ 1000MHz; 0.5dB @ 2000MHz; 1dB @ 3000MHz; 1.5dB @ 4000MHz
Matlab
pts=4
freq=[1000,2000,3000,4000]
loss=[0,0.5,1,1.5]
[status]=MyPTE1.SetOffsetValues(pts, freq, loss)
% Set 4 offset values:
% 0dB @ 1000MHz; 0.5dB @ 2000MHz; 1dB @ 3000MHz; 1.5dB @ 4000MHz
See Also
Enable Offset
Get Offset Values
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 41
14-Jul-15 (A3)
2.5 (n) - Set Compensation Frequency Mode
Declaration
short FC_SetAutoFreq(short AutoFreq)
Description
Sets whether the sensor is to use automatic or manual mode for compensating power
readings. In automatic mode, the sensor monitors the frequency and uses this to
compensate the power reading based on an internal look-up. In manual mode, the expected
frequency must be set manually.
Parameters
Data Type
short
Variable
AutoFreq
Description
The frequency compensation mode to use:
0 = Manual compensation (the sensor's input frequency
property must be set by the user)
1 = Automatic compensation (the sensor will automatically
compensate power measurements based on the
measured frequency)
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
short
short
Examples
Visual Basic
status = MyPTE1.FC_SetAutoFreq(1)
Visual C++
status = MyPTE1->FC_SetAutoFreq(1);
Visual C#
status = MyPTE1.FC_SetAutoFreq(1);
Matlab
status = MyPTE1.FC_SetAutoFreq(1)
See Also
Set Compensation Frequency
Get Compensation Frequency Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 42
14-Jul-15 (A3)
2.5 (o) - Get Compensation Frequency Mode
Declaration
short FC_GetAutoFreq()
Description
Indicates whether the sensor is using automatic or manual mode for compensating power
readings. In automatic mode, the sensor monitors the frequency and uses this to
compensate the power reading based on an internal look-up. In manual mode, the expected
frequency must be set manually.
Parameters
Data Type
None
Variable
Description
Data Type
short
Value
0
short
1
Description
Manual compensation (the sensor's input frequency property
must be set by the user)
Automatic compensation (the sensor will automatically
compensate power measurements based on the measured
frequency)
Return Values
Examples
Visual Basic
mode = MyPTE1.FC_GetAutoFreq()
Visual C++
mode = MyPTE1->FC_GetAutoFreq();
Visual C#
mode = MyPTE1.FC_GetAutoFreq();
Matlab
mode = MyPTE1.FC_GetAutoFreq()
See Also
Set Compensation Frequency
Set Compensation Frequency Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 43
14-Jul-15 (A3)
2.6 - DLL Functions for Frequency Measurement
2.6 (a) - Set Range
Declaration
short FC_SetRange(short Range)
Description
Sets the frequency measurement range of the combined sensor. By default the frequency
counter is in “Auto Range” mode and will automatically set the correct frequency range, this
process will take typically 50ms. If the frequency range of the input signal is known then the
user can eliminate this delay by specifying the appropriate range.
Parameters
Data Type
short
Value
0
1
2
3
4
Description
Set automatic measurement range mode
Set range 1 (for input frequencies 1 to 40 MHz)
Set range 2 (for input frequencies 40 to 190 MHz)
Set range 3 (for input frequencies 190 to 1400 MHz)
Set range 4 (for input frequencies 1400 to 6000 MHz)
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Examples
Visual Basic
status = MyPTE1.FC_SetRange(0)
Visual C++
status = MyPTE1->FC_SetRange(0);
Visual C#
status = MyPTE1.FC_SetRange(0);
Matlab
status = MyPTE1.FC_SetRange(0)
See Also
Get Range
Get Requested Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 44
14-Jul-15 (A3)
2.6 (b) - Get Range
Declaration
short FC_GetRange()
Description
Returns an ASCII character code indicating the frequency range of the sensor when operating
in automatic range mode.
Parameters
Data Type
None
Variable
Description
Return Values
Data Type
short
Value
49
50
51
52
Description
ASCII code for range 1 (input frequency in range 1 to 40 MHz)
ASCII code for range 2 (input frequency in range 40 to 190
MHz)
ASCII code for range 3 (input frequency in range 190 to 1400
MHz)
ASCII code for range 4 (input frequency in range 1400 to 6000
MHz). This is the default range if no input signal is detected.
Examples
Visual Basic
range = MyPTE1.FC_GetRange()
Visual C++
range = MyPTE1->FC_GetRange();
Visual C#
range = MyPTE1.FC_GetRange();
Matlab
range = MyPTE1.FC_GetRange()
See Also
Set Range
Get Requested Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 45
14-Jul-15 (A3)
2.6 (c) - Get Requested Range
Declaration
short FC_GetRequestedRange()
Description
Returns the measurement range of the sensor. By default the frequency counter is in “Auto
Range” mode and will automatically adjust for the input frequency measurement, this
process will take typically 50ms. The user can choose to override this if the frequency range
of the input signal is known.
Parameters
Data Type
None
Variable
Description
Return Values
Data Type
short
Value
0
1
2
3
4
Description
Counter is in automatic range mode
Range 1 (input frequency in range 1 to 40 MHz)
Rrange 2 (input frequency in range 40 to 190 MHz)
Range 3 (input frequency in range 190 to 1400 MHz)
Range 4 (input frequency in range 1400 to 6000 MHz)
Examples
Visual Basic
range = MyPTE1.FC_GetRequestedRange()
Visual C++
range = MyPTE1->FC_GetRequestedRange();
Visual C#
range = MyPTE1.FC_GetRequestedRange();
Matlab
range = MyPTE1.FC_GetRequestedRange()
See Also
Set Range
Get Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 46
14-Jul-15 (A3)
2.6 (d) - Set Sample Time
Declaration
short FC_SetSampleTime(short SampleTime)
Description
Sets the sample time to be used for frequency measurements, from 100 to 3000 ms, in 100
ms steps. The default sample time is 1000 ms (1 second).
Parameters
Data Type
short
Variable
Description
SampleTime The sample time in ms
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Examples
Visual Basic
status = MyPTE1.FC_SetSampleTime(1000)
Visual C++
status = MyPTE1->FC_SetSampleTime(1000);
Visual C#
status = MyPTE1.FC_SetSampleTime(1000);
Matlab
status = MyPTE1.FC_SetSampleTime(1000)
See Also
Get Sample Time
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 47
14-Jul-15 (A3)
2.6 (e) - Get Sample Time
Declaration
int FC_GetSampleTime()
Description
Returns the time in milliseconds over which the input frequency will be sampled.
Parameters
Data Type
None
Variable
Description
Variable
STime
Description
The sample time in milliseconds
Return Values
Data Type
int
Examples
Visual Basic
time = MyPTE1.FC_GetSampleTime()
Visual C++
time = MyPTE1->FC_GetSampleTime();
Visual C#
time = MyPTE1.FC_GetSampleTime();
Matlab
time = MyPTE1.FC_GetSampleTime()
See Also
Set Sample Time
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 48
14-Jul-15 (A3)
2.6 (f) - Read Frequency
Declaration
Double FC_ReadFreq()
Description
Returns the frequency in MHz of the input signal.
Parameters
Data Type
None
Variable
Description
Variable
Frequency
Description
The measured frequency in MHz
Return Values
Data Type
Double
Examples
Visual Basic
freq = MyPTE1.FC_ReadFreq()
Visual C++
freq = MyPTE1->FC_ReadFreq();
Visual C#
freq = MyPTE1.FC_ReadFreq();
Matlab
freq = MyPTE1.FC_ReadFreq()
See Also
Read Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 49
14-Jul-15 (A3)
2.6 (g) - Get Reference Source
Declaration
short FC_GetRef()
Description
Indicates whether the sensor is using the internal reference for frequency measurements or
an external source. The reference source will automatically switch to external if a suitable
signal is detected at the Ref In port.
Parameters
Data Type
None
Variable
Description
Variable
Source
Description
The reference source currently in use for frequency
measurements:
0 = Internal reference in use
1 = External reference in use
Return Values
Data Type
short
Examples
Visual Basic
source = MyPTE1.FC_GetRef()
Visual C++
source = MyPTE1->FC_GetRef();
Visual C#
source = MyPTE1.FC_GetRef();
Matlab
source = MyPTE1.FC_GetRef()
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 50
14-Jul-15 (A3)
2.7 - DLL Functions for Ethernet Configuration
These functions provide a means for identifying or configuring the Ethernet settings such as
IP address, TCP/IP port and network gateway. They can only be called while the device is
connected via the USB interface.
2.7 (a) - Get Ethernet Configuration
Declaration
int GetEthernet_CurrentConfig(ByRef int IP1, ByRef int IP2,
ByRef int IP3, ByRef int IP4,
ByRef int Mask1, ByRef int Mask2,
ByRef int Mask3, ByRef int Mask4,
ByRef int Gateway1, ByRef int Gateway2,
ByRef int Gateway3, ByRef int Gateway4)
Description
This function returns the current IP configuration of the sensor in a series of user defined
variables. The settings checked are IP address, subnet mask and network gateway.
Parameters
Data Type
int
Variable
IP1
int
IP2
int
IP2
int
IP4
int
Mask1
int
Mask2
int
Mask3
int
Mask4
int
Gateway1
int
Gateway2
int
Gateway3
int
Gateway4
Description
Required. Integer variable which will be updated with the
first (highest order) octet of the IP address.
Required. Integer variable which will be updated with the
second octet of the IP address.
Required. Integer variable which will be updated with the
third octet of the IP address.
Required. Integer variable which will be updated with the
last (lowest order) octet of the IP address.
Required. Integer variable which will be updated with the
first (highest order) octet of the subnet mask.
Required. Integer variable which will be updated with the
second octet of the subnet mask.
Required. Integer variable which will be updated with the
third octet of the subnet mask.
Required. Integer variable which will be updated with the
last (lowest order) octet of the subnet mask.
Required. Integer variable which will be updated with the
first (highest order) octet of the subnet mask.
Required. Integer variable which will be updated with the
second octet of the network gateway.
Required. Integer variable which will be updated with the
third octet of the network gateway.
Required. Integer variable which will be updated with the
last (lowest order) octet of the network gateway.
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 51
14-Jul-15 (A3)
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Example
Visual Basic
If MyPTE1.GetEthernet_CurrentConfig(IP1, IP2, IP3, IP4, M1, M2, M3, M4,
_ GW1, GW2, GW3, GW4) > 0 Then
MsgBox ("IP address: " & IP1 & "." & IP2 & "." & IP3 & "." & IP4)
MsgBox ("Subnet Mask: " & M1 & "." & M2 & "." & M3 & "." & M4)
MsgBox ("Gateway: " & GW1 & "." & GW2 & "." & GW3 & "." & GW4)
End If
Visual C++
if (MyPTE1->GetEthernet_CurrentConfig(IP1, IP2, IP3, IP4, M1, M2, M3, M4,
_ GW1, GW2, GW3, GW4) > 0)
{
MessageBox::Show("IP address: " + IP1 + "." + IP2 + "." + IP3 + "."
_ + IP4);
MessageBox::Show("Subnet Mask: " + M1 + "." + M2 + "." + M3+ "." +
_ M4);
MessageBox::Show("Gateway: " + GW1 + "." + GW2 + "." + GW3 + "." +
_ GW4);
}
Visual C#
if (MyPTE1.GetEthernet_CurrentConfig(IP1, IP2, IP3, IP4, M1, M2, M3, M4,
_ GW1, GW2, GW3, GW4) > 0)
{
MessageBox.Show("IP address: " + IP1 + "." + IP2 + "." + IP3 + "."
_ + IP4);
MessageBox.Show("Subnet Mask: " + M1 + "." + M2 + "." + M3+ "." +
_ M4);
MessageBox.Show("Gateway: " + GW1 + "." + GW2 + "." + GW3 + "." +
_ GW4);
}
Matlab
[status, IP1, IP2, IP3, IP4, M1, M2, M3, M4, GW1, GW2, GW3, GW4] =
MyPTE1.GetEthernet_CurrentConfig(IP1, IP2, IP3, IP4, M1, M2, M3, M4, GW1,
GW2, GW3, GW4)
If status > 0 then
{
MsgBox ("IP address: ", IP1, ".", IP2, ".", IP3, ".", IP4)
MsgBox ("Subnet Mask: ", M1, "." & M2, "." & M3, ".", M4)
MsgBox ("Gateway: ", GW1, ".", GW2, ".", GW3, ".", GW4)
}
See Also
Get MAC Address
Get TCP/IP Port
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 52
14-Jul-15 (A3)
2.7 (b) - Get IP Address
Declaration
int GetEthernet_IPAddress(ByRef int b1, ByRef int b2, ByRef int b3,
ByRef int b4)
Description
This function returns the current IP address of the sensor in a series of user defined variables
(one per octet).
Parameters
Data Type
int
Variable
IP1
int
IP2
int
IP2
int
IP4
Description
Required. Integer variable which will be updated with the
first (highest order) octet of the IP address (for example “192”
for the IP address “192.168.1.0”).
Required. Integer variable which will be updated with the
second octet of the IP address (for example “168” for the IP
address “192.168.1.0”).
Required. Integer variable which will be updated with the
third octet of the IP address (for example “1” for the IP
address “192.168.1.0”).
Required. Integer variable which will be updated with the last
(lowest order) octet of the IP address (for example “0” for the
IP address “192.168.1.0”).
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Example
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 53
14-Jul-15 (A3)
Visual Basic
If MyPTE1.GetEthernet_CurrentConfig(IP1, IP2, IP3, IP4) > 0 Then
MsgBox ("IP address: " & IP1 & "." & IP2 & "." & IP3 & "." & IP4)
End If
Visual C++
if (MyPTE1->GetEthernet_CurrentConfig(IP1, IP2, IP3, IP4) > 0)
{
MessageBox::Show("IP address: " + IP1 + "." + IP2 + "." + IP3 + "."
_ + IP4);
}
Visual C#
if (MyPTE1.GetEthernet_CurrentConfig(IP1, IP2, IP3, IP4) > 0)
{
MessageBox.Show("IP address: " + IP1 + "." + IP2 + "." + IP3 + "."
_ + IP4);
}
Matlab
[status, IP1, IP2, IP3, IP4] = MyPTE1.GetEthernet_CurrentConfig(IP1, IP2,
IP3, IP4)
If status > 0 then
{
MsgBox ("IP address: ", IP1, ".", IP2, ".", IP3, ".", IP4)
}
See Also
Get Ethernet Configuration
Get TCP/IP Port
Save IP Address
Save TCP/IP Port
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 54
14-Jul-15 (A3)
2.7 (c) - Get MAC Address
Declaration
int GetEthernet_MACAddress(ByRef int MAC1, ByRef int MAC2,
ByRef int MAC3, ByRef int MAC4, ByRef int MAC5, ByRef int MAC6)
Description
This function returns the MAC (media access control) address, the physical address, of the
sensor as a series of decimal values (one for each of the 6 numeric groups).
Parameters
Data Type
int
Variable
MAC1
int
MAC2
int
MAC3
int
MAC4
int
MAC5
int
MAC6
Description
Required. Integer variable which will be updated with the
decimal value of the first numeric group of the MAC address.
For example:
MAC address =11:47:165:103:137:171
MAC1=11
Required. Integer variable which will be updated with the
decimal value of the second numeric group of the MAC
address.
For example:
MAC address =11:47:165:103:137:171
MAC2=47
Required. Integer variable which will be updated with the
decimal value of the third numeric group of the MAC address.
For example:
MAC address =11:47:165:103:137:171
MAC3=165
Required. Integer variable which will be updated with the
decimal value of the fourth numeric group of the MAC
address.
For example:
MAC address =11:47:165:103:137:171
MAC4=103
Required. Integer variable which will be updated with the
decimal value of the fifth numeric group of the MAC address.
For example:
MAC address =11:47:165:103:137:171
MAC5=137
Required. Integer variable which will be updated with the
decimal value of the last numeric group of the MAC address.
For example:
MAC address =11:47:165:103:137:171
MAC6=171
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 55
14-Jul-15 (A3)
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Example
Visual Basic
If MyPTE1.GetEthernet_MACAddess(M1, M2, M3, M4, M5, M6) > 0 Then
MsgBox ("MAC address: " & M1 & ":" & M2 & ":" & M3 & ":" & M4 & ":"
_ & M5 & ":" & M6)
End If
Visual C++
if (MyPTE1->GetEthernet_MACAddess(M1, M2, M3, M4, M5, M6) > 0)
{
MessageBox::Show("MAC address: " + M1 + "." + M2 + "." + M3 + "."
_ + M4 + "." + M5 + "." + M6);
}
Visual C#
if (MyPTE1.GetEthernet_MACAddess(M1, M2, M3, M4, M5, M6) > 0)
{
MessageBox.Show("MAC address: " + M1 + "." + M2 + "." + M3 + "."
_ + M4 + "." + M5 + "." + M6);
}
Matlab
[status, M1, M2, M3, M4, M5, M6] = MyPTE1.GetEthernet_MACAddess(M1, M2, M3,
M4, M5, M6)
If status > 0 then
{
MsgBox ("MAC address: ", M1, ".", M2, ".", M3, ".", M4, ".", M5, ".",
M6)
}
See Also
Get Ethernet Configuration
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 56
14-Jul-15 (A3)
2.7 (d) - Get Network Gateway
Declaration
int GetEthernet_NetworkGateway(ByRef int b1, ByRef int b2,
ByRef int b3, ByRef int b4)
Description
This function returns the IP address of the network gateway to which the sensor is currently
connected. A series of user defined variables are passed to the function to be updated with
the IP address (one per octet).
Parameters
Data Type
int
Variable
IP1
int
IP2
int
IP2
int
IP4
Description
Required. Integer variable which will be updated with the
first (highest order) octet of the IP address (for example “192”
for the IP address “192.168.1.0”).
Required. Integer variable which will be updated with the
second octet of the IP address (for example “168” for the IP
address “192.168.1.0”).
Required. Integer variable which will be updated with the
third octet of the IP address (for example “1” for the IP
address “192.168.1.0”).
Required. Integer variable which will be updated with the last
(lowest order) octet of the IP address (for example “0” for the
IP address “192.168.1.0”).
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 57
14-Jul-15 (A3)
Example
Visual Basic
If MyPTE1.GetEthernet_NetworkGateway(IP1, IP2, IP3, IP4) > 0 Then
MsgBox ("Gateway: " & IP1 & "." & IP2 & "." & IP3 & "." & IP4)
End If
Visual C++
if (MyPTE1->GetEthernet_NetworkGateway(IP1, IP2, IP3, IP4) > 0)
{
MessageBox::Show("Gateway: " + IP1 + "." + IP2 + "." + IP3 + "."
_ + IP4);
}
Visual C#
if (MyPTE1.GetEthernet_NetworkGateway(IP1, IP2, IP3, IP4) > 0)
{
MessageBox.Show("Gateway: " + IP1 + "." + IP2 + "." + IP3 + "."
_ + IP4);
}
Matlab
[status, IP1, IP2, IP3, IP4] = MyPTE1.GetEthernet_NetworkGateway(IP1, IP2,
IP3, IP4)
If status > 0 then
{
MsgBox ("Gateway: ", IP1, ".", IP2, ".", IP3, ".", IP4)
}
See Also
Get Ethernet Configuration
Save Network Gateway
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 58
14-Jul-15 (A3)
2.7 (e) - Get Subnet Mask
Declaration
int GetEthernet_SubNetMask(ByRef int b1, ByRef int b2, ByRef int b3,
ByRef int b4)
Description
This function returns the subnet mask used by the network gateway to which the sensor is
currently connected. A series of user defined variables are passed to the function to be
updated with the subnet mask (one per octet).
Parameters
Data Type
int
Variable
b1
int
b2
int
b2
int
b4
Description
Required. Integer variable which will be updated with the
first (highest order) octet of the subnet mask (for example
“255” for the subnet mask “255.255.255.0”).
Required. Integer variable which will be updated with the
second octet of the subnet mask (for example “255” for the
subnet mask “255.255.255.0”).
Required. Integer variable which will be updated with the
third octet of the subnet mask (for example “255” for the
subnet mask “255.255.255.0”).
Required. Integer variable which will be updated with the last
(lowest order) octet of the subnet mask (for example “0” for
the subnet mask “255.255.255.0”).
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 59
14-Jul-15 (A3)
Example
Visual Basic
If MyPTE1.GetEthernet_SubNetMask(b1, b2, b3, b4) > 0 Then
MsgBox ("Subnet mask: " & b1 & "." & b2 & "." & b3 & "." & b4)
End If
Visual C++
if (MyPTE1->GetEthernet_SubNetMask(b1, b2, b3, b4) > 0)
{
MessageBox::Show("Subnet mask: " + b1 + "." + b2 + "." + b3 + "."
_ + b4);
}
Visual C#
if (MyPTE1.GetEthernet_SubNetMask(b1, b2, b3, b4) > 0)
{
MessageBox.Show("Subnet mask: " + b1 + "." + b2 + "." + b3 + "."
_ + b4);
}
Matlab
[status, b1, b2, b3, b4] = MyPTE1.GetEthernet_SubNetMask(b1, b2, b3, b4)
If status > 0 then
{
MsgBox ("Subnet mask: ", b1, ".", b2, ".", b3, ".", b4)
}
See Also
Get Ethernet Configuration
Save Subnet Mask
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 60
14-Jul-15 (A3)
2.7 (f) - Get TCP/IP Port
Declaration
int GetEthernet_TCPIPPort(ByRef int port)
Description
This function returns the TCP/IP port used by the sensor for HTTP communication. The
default is port 80.
Note: Port 23 is reserved for Telnet communication and cannot be set as the HTTP port.
Parameters
Data Type
int
Variable
port
Description
Required. Integer variable which will be updated with the
TCP/IP port.
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
short
short
Example
Visual Basic
If MyPTE1.GetEthernet_SubNetMask(port) > 0 Then
MsgBox ("Port: " & port)
End If
Visual C++
if (MyPTE1->GetEthernet_SubNetMask(port) > 0)
{
MessageBox::Show("Port: " + port);
}
Visual C#
if (MyPTE1.GetEthernet_SubNetMask(port) > 0)
{
MessageBox.Show("Port: " + port);
}
Matlab
[status, port] = MyPTE1.GetEthernet_SubNetMask(port)
If status > 0 then
{
MsgBox ("Port: ", port)
}
See Also
Get Ethernet Configuration
Save TCP/IP Port
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 61
14-Jul-15 (A3)
2.7 (g) - Get DHCP Status
Declaration
short GetEthernet_UseDHCP()
Description
This function indicates whether the sensor is using DHCP (dynamic host control protocol), in
which case the IP configuration is derived from a network server; or user defined “static” IP
settings.
Parameters
Data Type
None
Variable
Description
Data Type
short
Value
0
short
1
Description
DHCP not in use (IP settings are static and manually
configured)
DHCP in use (IP settings are assigned automatically by the
network)
Return Values
Example
Visual Basic
DHCPstatus = MyPTE1.GetEthernet_UseDHCP()
Visual C++
DHCPstatus = MyPTE1->GetEthernet_UseDHCP();
Visual C#
DHCPstatus = MyPTE1.GetEthernet_UseDHCP();
Matlab
[DHCPstatus] = MyPTE1.GetEthernet_UseDHCP
See Also
Get Ethernet Configuration
Use DHCP
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 62
14-Jul-15 (A3)
2.7 (h) - Get Password Status
Declaration
short GetEthernet_UsePWD()
Description
This function indicates whether the sensor is currently configured to require a password for
HTTP/Telnet communication.
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
Password not required
Password required
Return Values
Data Type
short
short
Example
Visual Basic
PWDstatus = MyPTE1.GetEthernet_UsePWD()
Visual C++
PWDstatus = MyPTE1->GetEthernet_UsePWD();
Visual C#
PWDstatus = MyPTE1.GetEthernet_UsePWD();
Matlab
[PWDstatus] = MyPTE1.GetEthernet_UsePWD
See Also
Get Password
Use Password
Set Password
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 63
14-Jul-15 (A3)
2.7 (i) - Get Password
Declaration
int GetEthernet_PWD(ByRef string Pwd)
Description
This function returns the current password used by the sensor for HTTP/Telnet
communication. The password will be returned even if the device is not currently configured
to require a password.
Parameters
Data Type
string
Variable
Pwd
Description
Required. string variable which will be updated with the
password.
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
short
short
Example
Visual Basic
If MyPTE1.GetEthernet_PWD(pwd) > 0 Then
MsgBox ("Password: " & pwd)
End If
Visual C++
if (MyPTE1->GetEthernet_PWD(pwd) > 0)
{
MessageBox::Show("Password: " + pwd);
}
Visual C#
if (MyPTE1.GetEthernet_PWD(pwd) > 0)
{
MessageBox.Show("Password: " + pwd);
}
Matlab
[status, pwd] = MyPTE1.GetEthernet_PWD(pwd)
If status > 0 then
{
MsgBox ("Password: ", pwd)
}
See Also
Get Password Status
Use Password
Set Password
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 64
14-Jul-15 (A3)
2.7 (j) - Save IP Address
Declaration
short SaveEthernet_IPAddress(int b1, int b2, int b3, int b4)
Description
This function sets a static IP address to be used by the connected sensor.
Note: this could subsequently be overwritten automatically if DHCP is enabled (see Use
DHCP).
Parameters
Data Type
int
Variable
IP1
int
IP2
int
IP2
int
IP4
Description
Required. First (highest order) octet of the IP address to set
(for example “192” for the IP address “192.168.1.0”).
Required. Second octet of the IP address to set (for example
“168” for the IP address “192.168.1.0”).
Required. Third octet of the IP address to set (for example
“1” for the IP address “192.168.1.0”).
Required. Last (lowest order) octet of the IP address to set
(for example “0” for the IP address “192.168.1.0”).
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Example
Visual Basic
status = MyPTE1.SaveEthernet_IPAddress(192, 168, 1, 0)
Visual C++
status = MyPTE1->SaveEthernet_IPAddress(192, 168, 1, 0);
Visual C#
status = MyPTE1.SaveEthernet_IPAddress(192, 168, 1, 0);
Matlab
[status] = MyPTE1.SaveEthernet_IPAddress(192, 168, 1, 0)
See Also
Get Ethernet Configuration
Get IP Address
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 65
14-Jul-15 (A3)
2.7 (k) - Save Network Gateway
Declaration
short SaveEthernet_NetworkGateway(int b1, int b2, int b3, int b4)
Description
This function sets the IP address of the network gateway to which the sensor should connect.
Note: this could subsequently be overwritten automatically if DHCP is enabled (see Use
DHCP).
Parameters
Data Type
int
Variable
IP1
int
IP2
int
IP2
int
IP4
Description
Required. First (highest order) octet of the network gateway
IP address (for example “192” for the IP address
“192.168.1.0”).
Required. Second octet of the network gateway IP address
(for example “168” for the IP address “192.168.1.0”).
Required. Third octet of the network gateway IP address (for
example “1” for the IP address “192.168.1.0”).
Required. Last (lowest order) octet of the network gateway
IP address (for example “0” for the IP address “192.168.1.0”).
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Example
Visual Basic
status = MyPTE1.SaveEthernet_NetworkGateway(192, 168, 1, 0)
Visual C++
status = MyPTE1->SaveEthernet_NetworkGateway(192, 168, 1, 0);
Visual C#
status = MyPTE1.SaveEthernet_NetworkGateway(192, 168, 1, 0);
Matlab
[status] = MyPTE1.SaveEthernet_NetworkGateway(192, 168, 1, 0)
See Also
Get Ethernet Configuration
Get Network Gateway
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 66
14-Jul-15 (A3)
2.7 (l) - Save Subnet Mask
Declaration
short SaveEthernet_SubnetMask(int b1, int b2, int b3, int b4)
Description
This function sets the subnet mask of the network to which the sensor should connect.
Note: this could subsequently be overwritten automatically if DHCP is enabled (see Use
DHCP).
Parameters
Data Type
int
Variable
IP1
int
IP2
int
IP2
int
IP4
Description
Required. First (highest order) octet of the subnet mask (for
example “255” for the subnet mask “255.255.255.0”).
Required. Second octet of the subnet mask (for example
“255” for the subnet mask “255.255.255.0”).
Required. Third octet of the subnet mask (for example “255”
for the subnet mask “255.255.255.0”).
Required. Last (lowest order) octet of the subnet mask (for
example “0” for the subnet mask “255.255.255.0”).
Return Values
Data Type
short
short
Value
0
1
Description
Command failed
Command completed successfully
Example
Visual Basic
status = MyPTE1.SaveEthernet_SubnetMask(255, 255, 255, 0)
Visual C++
status = MyPTE1->SaveEthernet_SubnetMask(255, 255, 255, 0);
Visual C#
status = MyPTE1.SaveEthernet_SubnetMask(255, 255, 255, 0);
Matlab
[status] = MyPTE1.SaveEthernet_SubnetMask(255, 255, 255, 0)
See Also
Get Ethernet Configuration
Get Subnet Mask
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 67
14-Jul-15 (A3)
2.7 (m) - Save TCP/IP Port
Declaration
short SaveEthernet_TCPIPPort(int port)
Description
This function sets the TCP/IP port used by the sensor for HTTP communication. The default is
port 80.
Note: Port 23 is reserved for Telnet communication and cannot be set as the HTTP port.
Parameters
Data Type
int
Variable
port
Description
Required. Numeric value of the TCP/IP port.
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
short
short
Example
Visual Basic
status = MyPTE1.SaveEthernet_TCPIPPort(70)
Visual C++
status = MyPTE1->SaveEthernet_TCPIPPort(70);
Visual C#
status = MyPTE1.SaveEthernet_TCPIPPort(70);
Matlab
[status] = MyPTE1.SaveEthernet_TCPIPPort(70)
See Also
Get TCP/IP Port
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 68
14-Jul-15 (A3)
2.7 (n) - Use DHCP
Declaration
short SaveEthernet_UseDHCP(int UseDHCP)
Description
This function enables or disables DHCP (dynamic host control protocol). When enabled the
IP configuration of the sensor is assigned automatically by the network server; when disabled
the user defined “static” IP settings apply.
Parameters
Data Type
int
Variable
UseDHCP
Description
Required. Integer value to set the DHCP mode:
0 - DHCP disabled (static IP settings used)
1 - DHCP enabled (IP setting assigned by network)
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
short
short
Example
Visual Basic
status = MyPTE1.SaveEthernet_UseDHCP(1)
Visual C++
status = MyPTE1->SaveEthernet_UseDHCP(1);
Visual C#
status = MyPTE1.SaveEthernet_UseDHCP(1);
Matlab
[status] = MyPTE1.SaveEthernet_UseDHCP(1)
See Also
Get DHCP Status
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 69
14-Jul-15 (A3)
2.7 (o) - Use Password
Declaration
short SaveEthernet_UsePWD(int UsePwd)
Description
This function enables or disables the password requirement for HTTP/Telnet communication
with the sensor.
Parameters
Data Type
int
Variable
UseDHCP
Description
Required. Integer value to set the password mode:
0 – Password not required
1 – Password required
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
short
short
Example
Visual Basic
status = MyPTE1.SaveEthernet_UsePWD(1)
Visual C++
status = MyPTE1->SaveEthernet_UsePWD(1);
Visual C#
status = MyPTE1.SaveEthernet_UsePWD(1);
Matlab
[status] = MyPTE1.SaveEthernet_UsePWD(1)
See Also
Get Password Status
Get Password
Set Password
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 70
14-Jul-15 (A3)
2.7 (p) - Set Password
Declaration
short SaveEthernet_PWD(string Pwd)
Description
This function sets the password used by the power sensor for HTTP/Telnet communication.
The password will not affect sensor operation unless Use Password is also enabled.
Parameters
Data Type
string
Variable
Pwd
Description
Required. The password to set (20 characters maximum).
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
short
short
Example
Visual Basic
status = MyPTE1.SaveEthernet_PWD("123")
Visual C++
status = MyPTE1->SaveEthernet_PWD("123");
Visual C#
status = MyPTE1.SaveEthernet_PWD("123");
Matlab
[status] = MyPTE1.SaveEthernet_PWD("123")
See Also
Get Password Status
Get Password
Use Password
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 71
14-Jul-15 (A3)
3 - Operating in a Linux Environment via USB
To open a connection to the integrated frequency & power meter, the Vendor ID and
Product ID are required:
 Mini-Circuits Vendor ID: 0x20CE
 Power Sensor Product ID: 0x11
Communication with the sensor is carried out by way of USB Interrupt. The transmitted and
received buffer sizes are 64 Bytes each:
 Transmit Array = [Byte 0][Byte1][Byte2]…[Byte 63]
 Returned Array = [Byte 0][Byte1][Byte2]…[Byte 63]
In most cases, the full 64 byte buffer size is not needed so any unused bytes become “don’t
care” bytes; they can take on any value without affecting the operation of the sensor.
Following a successful operation, byte 0 of the returned array will repeat byte 0 of the
transmit array.
A worked example is included in Appendix C of this document. The example uses the libhid
and libusb libraries to interface with the power sensor as a USB HID (Human Interface
Device).
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 72
14-Jul-15 (A3)
3.1 - Summary of USB Interrupt Functions
3.1 (a) - Common Functions
#
Description
Command Code (Byte 0)
a
Get Device Model Name
104
b
Get Device Serial Number
105
c
Get Internal Temperature
103
d
Get Firmware
99
3.1 (b) - Power Measurement Functions
#
Description
Command Code (Byte 0)
a
Set Measurement Mode
b
Set Compensation Frequency Mode
116
c
Get Compensation Frequency Mode
113
d
Read Power
102
15
3.1 (c) - Frequency Measurement Functions
#
Description
a
Set Range
115
b
Get Range
111
c
Get Requested Range
135
d
Set Sample Time
117
e
Get Sample Time
134
f
Get Reference Source
112
g
Read Frequency
110
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Command Code (Byte 0)
Page 73
14-Jul-15 (A3)
3.2 - Common Functions
3.2 (a) - Get Device Model Name
Description
Returns the full Mini-Circuits part number of the connected sensor.
Transmit Array
Byte
0
1- 63
Data
104
Not significant
Description
Interrupt code for Get Device Model Name
“Don’t care” bytes, can be any value
Data
104
Model Name
Description
Interrupt code for Get Device Model Name
Series of bytes containing the ASCII code for each character
in the model name
Zero value byte to indicate the end of the model name
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1 to
(n-1)
n
(n+1)
to 63
0
Not significant
Example
The following array would be returned for Mini-Circuits’ FCPM-6000RC integrated frequency
& power meter. See Appendix A for conversions between decimal, binary and ASCII
characters.
Byte 0
Code
Byte 1
Char 1
Byte 2
Char 2
Byte 3
Char 3
Byte 4
Char 4
Byte 5
Char 5
Value
104
70
67
80
77
45
Byte 6
Char 6
54
ASCII Character
N/A
F
C
P
M
-
6
Byte 7
Byte 8
Byte 9
Byte 10
Byte 11
Char 7
Char 8
Char 9
48
0
48
0
48
0
Byte 12
End
Marker
0
N/A
Byte
Description
Byte
Description
Value
ASCII Character
Char 10 Char 11
82
R
67
C
See Also
Get Device Serial Number
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 74
14-Jul-15 (A3)
3.2 (b) - Get Device Serial Number
Description
Returns the serial number of the connected sensor.
Transmit Array
Byte
0
1- 63
Data
105
Not significant
Description
Interrupt code for Get Device Serial Number
“Don’t care” bytes, can be any value
Data
105
Serial Number
Description
Interrupt code for Get Device Serial Number
Series of bytes containing the ASCII code for each character
in the serial number
Zero value byte to indicate the end of the serial number
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1 to
(n-1)
n
(n+1)
to 63
0
Not significant
Example
The following example indicates that the current power sensor has serial number
1100040023. See Appendix A for conversions between decimal, binary and ASCII characters.
Byte
Description
Value
ASCII Character
Byte 0
Code
105
N/A
Byte 1
Char 1
49
1
Byte 2
Char 2
49
1
Byte 3
Char 3
48
0
Byte 4
Char 4
48
0
Byte 5
Char 5
48
0
Byte
Byte 6
Byte 7
Byte 8
Byte 9
Byte 10
Char 6
Char 7
Char 8
Char 9
Char 10
52
4
48
0
48
0
50
2
51
3
Byte 11
End
Marker
0
N/A
Description
Value
ASCII Character
See Also
Get Device Model Name
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 75
14-Jul-15 (A3)
3.2 (c) - Get Internal Temperature
Description
This function returns the internal temperature of the sensor in degrees Celsius, to two
decimal places.
Transmit Array
Byte
0
1-63
Data
103
Not significant
Description
Interrupt code for Get Internal Temperature
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1
Data
103
Temp_1
2
Temp_2
3
Temp_3
4
Temp_4
5
Temp_5
6
Temp_6
7-63
Not significant
Description
Interrupt code for Get Internal Temperature
ASCII character code for the first character of the
temperature reading
ASCII character code for the second character of the
temperature reading
ASCII character code for the third character of the
temperature reading
ASCII character code for the fourth character of the
temperature reading
ASCII character code for the fifth character of the
temperature reading
ASCII character code for the sixth character of the
temperature reading
“Don’t care” bytes, can be any value
Example
The below returned array would indicate a temperature of +28.43°C:
Byte
0
1
2
3
4
5
6
7 to 63
Data
103
43
50
56
46
52
51
Not significant
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Description
Interrupt code for Get Internal Temperature
ASCII character code for "+"
ASCII character code for "2"
ASCII character code for "8"
ASCII character code for "."
ASCII character code for "4"
ASCII character code for "3"
“Don’t care” bytes, can be any value
Page 76
14-Jul-15 (A3)
3.2 (d) - Get Firmware
Description
Returns the internal firmware version of the sensor.
Transmit Array
Byte
0
1- 63
Data
99
Not significant
Description
Interrupt code for Get Firmware
“Don’t care” bytes, can be any value
Data
99
Reserved
Reserved
Reserved
Reserved
Firmware
Letter
Firmware
Number
Not significant
Description
Interrupt code for Get Firmware
Internal code for factory use only
Internal code for factory use only
Internal code for factory use only
Internal code for factory use only
ASCII code for the first character in the firmware revision
identifier
ASCII code for the second character in the firmware revision
identifier
“Don’t care” bytes, could be any value
Returned Array
Byte
0
1
2
3
4
5
6
7-63
Example
The following returned array indicates that the power sensor has firmware version C3:
Byte
0
1
2
3
4
5
6
7-63
Data
99
55
52
83
87
67
51
Not significant
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Description
Interrupt code for Get Firmware
Internal code for factory use only
Internal code for factory use only
Internal code for factory use only
Internal code for factory use only
ASCII code for the letter “C”
ASCII code for the number 3
“Don’t care” bytes, could be any value
Page 77
14-Jul-15 (A3)
3.3 - Power Measurement Functions
3.3 (a) - Set Measurement Mode
Description
Sets the power measurement mode of the sensor between "low noise" and "fast sampling"
modes; the default is "low noise" mode. See the individual model datasheets for
specifications.
Transmit Array
Byte
0
1
Data
15
Mode
2- 63
Not significant
Description
Interrupt code for Set Measurement Mode
Integer value to set the required mode:
0 = Low noise mode
1 = Fast sampling mode
“Don’t care” bytes, can be any value
Byte
0
1 to 63
Data
15
Not significant
Description
Interrupt code for Set Measurement Mode
“Don’t care” bytes, can be any value
Byte
0
1
2- 63
Data
15
1
Not significant
Description
Interrupt code for Set Measurement Mode
Set power sensor to "fast sampling" mode
“Don’t care” bytes, can be any value
Returned Array
Example
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 78
14-Jul-15 (A3)
3.3 (c) - Set Compensation Frequency Mode
Description
Sets whether the frequency and power meter is to use automatic or manual mode for
compensating power readings. In automatic mode, the sensor monitors the frequency and
uses this to compensate the power reading based on an internal look-up. In manual mode,
the expected frequency must be set manually.
Transmit Array
Byte
0
1
Data
116
Mode
2- 63
Not significant
Description
Interrupt code for Set Compensation Frequency Mode
Integer value to set the compensation frequency mode:
0 = Manual (user must specify frequency when reading
power)
1 = Automatic (power reading will be compensated based
on measured frequency)
“Don’t care” bytes, can be any value
Data
116
Not significant
Description
Interrupt code for Set Compensation Frequency Mode
“Don’t care” bytes, could be any value
Returned Array
Byte
0
1 to 63
Example
The following transmit array sets the sensor to automatic frequency compensation mode:
Byte
0
1
2- 63
Data
116
1
Not significant
Description
Interrupt code for Set Compensation Frequency Mode
Set power sensor to "automatic" mode
“Don’t care” bytes, can be any value
See Also
Read Power
Get Compensation Frequency Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 79
14-Jul-15 (A3)
3.3 (d) - Get Compensation Frequency Mode
Description
Indicates whether the frequency and power meter is using automatic or manual mode for
compensating power readings. In automatic mode, the sensor monitors the frequency and
uses this to compensate the power reading based on an internal look-up. In manual mode,
the expected frequency must be set manually.
Transmit Array
Byte
0
1- 63
Data
113
Not significant
Description
Interrupt code for Get Compensation Frequency Mode
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1
Data
113
Mode
2 to 63
Not significant
Description
Interrupt code for Get Compensation Frequency Mode
Integer value indicating the compensation frequency mode:
0 = Manual (user must specify frequency when reading
power)
1 = Automatic (power reading will be compensated based
on measured frequency)
“Don’t care” bytes, could be any value
Example
The following returned array indicates that the sensor is using manual frequency
compensation mode so the user must specify frequency when reading the power:
Byte
0
1
2- 63
Data
113
0
Not significant
Description
Interrupt code for Get Compensation Frequency Mode
Power sensor operating in "manual" mode
“Don’t care” bytes, could be any value
See Also
Read Power
Set Compensation Frequency Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 80
14-Jul-15 (A3)
3.3 (e) - Read Power
Description
Returns the power measurement at the sensor head, compensated for frequency and
temperature. In manual frequency compensation mode, the user must enter the
compensation frequency in order to achieve the specified power accuracy. In automatic
frequency compensation mode, the frequency & power meter uses the simultaneous
frequency measurement for compensating the power reading.
Transmit Array
Byte
0
1
Data
102
Frequency_1
2
Frequency_2
3
Freq_Units
4- 63
Not significant
Description
Interrupt code for Read Power
In automatic frequency compensation mode this is a "don't
care" byte and can be given any value. In manual frequency
compensation mode this is the first byte of the
compensation frequency for the power reading:
Frequency_1 = INT (FREQUENCY / 256)
In automatic frequency compensation mode this is a "don't
care" byte and can be given any value. In manual frequency
compensation mode this is the second byte of the
compensation frequency for the power reading:
Frequency_2 = FREQUENCY - (Frequency_1 * 256)
In automatic frequency compensation mode this is a "don't
care" byte and can be given any value. In manual frequency
compensation mode this is the ASCII character code
representing the units for the compensation frequency:
75 = ASCII code for "K" (frequency units are KHz)
77 = ASCII code for "M" (frequency units are MHz)
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1
Data
102
Power_1
2
Power_2
3
Power_3
4
Power_4
5
Power_5
6
Power_6
7 to 63
Not significant
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Description
Interrupt code for Read Power
ASCII character code for the first character of the power
reading
ASCII character code for the second character of the power
reading
ASCII character code for the third character of the power
reading
ASCII character code for the fourth character of the power
reading
ASCII character code for the fifth character of the power
reading
ASCII character code for the sixth character of the power
reading
“Don’t care” bytes, can be any value
Page 81
14-Jul-15 (A3)
Example
The following transmit array would be sent to read the power for an expected signal at 1250
MHz when operating in manual frequency compensation mode:
Byte
0
1
2
3
4 - 63
Data
102
4
226
77
Not significant
Description
Interrupt code for Read Power
Frequency_1 = INT (1250 / 256)
Frequency_2 = 1250 - (4 * 256)
ASCII code for "M" (frequency units are MHz)
“Don’t care” bytes, can be any value
The following transmit array would be sent to read the power when operating in automatic
frequency compensation mode:
Byte
0
1 - 63
Data
102
Not significant
Description
Interrupt code for Read Power
“Don’t care” bytes, can be any value
The following array would be returned in either case to indicate a power reading of 10.65dBm:
Byte
0
1
2
3
4
5
6
7 to 63
Data
102
45
49
48
46
54
53
Not significant
Description
Interrupt code for Read Power
ASCII character code for "-"
ASCII character code for "1"
ASCII character code for "0"
ASCII character code for "."
ASCII character code for "6"
ASCII character code for "5"
“Don’t care” bytes, can be any value
See Also
Read Frequency
Set Compensation Frequency Mode
Get Compensation Frequency Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 82
14-Jul-15 (A3)
3.4 - Frequency Measurement Functions
3.4 (a) - Set Range
Description
Sets the frequency measurement range of the sensor. By default the frequency counter is in
“Auto Range” mode and will automatically set the correct frequency range, this process will
take typically 50ms. If the frequency range of the input signal is known then the user can
eliminate this delay by specifying the appropriate range.
Transmit Array
Byte
0
1
Data
115
Range
2- 63
Not significant
Description
Interrupt code for Set Range
Integer value corresponding to the input frequency range:
0 = Automatic (1 to 6000 MHz)
1 = 1 to 40 MHz
2 = 40 to 190 MHz
3 = 190 to 1400 MHz
4 = 1400 to 6000 MHz
“Don’t care” bytes, can be any value
Data
115
Not significant
Description
Interrupt code for Set Range
“Don’t care” bytes, could be any value
Returned Array
Byte
0
1 to 63
Example
The following transmit array sets the sensor to range 3 (expecting an input signal between
190 MHz and 1400 MHz):
Byte
0
1
2- 63
Data
115
3
Not significant
Description
Interrupt code for Set Range
Range 3 (190 to 1400 MHz)
“Don’t care” bytes, can be any value
See Also
Get Range
Get Requested Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 83
14-Jul-15 (A3)
3.4 (b) - Get Range
Description
Returns the actual frequency measurement range of the sensor when in automatic range
mode.
Transmit Array
Byte
0
1 - 63
Data
111
Not significant
Description
Interrupt code for Get Range
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1
Data
111
Range
2 to 63
Not significant
Description
Interrupt code for Get Range
Integer value corresponding to the input frequency range:
1 = 1 to 40 MHz
2 = 40 to 190 MHz
3 = 190 to 1400 MHz
4 = 1400 to 6000 MHz
“Don’t care” bytes, could be any value
Example
The following transmit array indicates that the sensor is detecting an input signal in range 2
(between 40 MHz and 190 MHz):
Byte
0
1
2 to 63
Data
111
2
Not significant
Description
Interrupt code for Get Range
Range 2 (40 to 190 MHz)
“Don’t care” bytes, could be any value
See Also
Set Range
Get Requested Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 84
14-Jul-15 (A3)
3.4 (c) - Get Requested Range
Description
Returns the user requested frequency measurement range of the sensor.
Transmit Array
Byte
0
1 - 63
Data
135
Not significant
Description
Interrupt code for Get Requested Range
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1
Data
135
Range
2 to 63
Not significant
Description
Interrupt code for Get Requested Range
Integer value corresponding to the input frequency range:
0 = Automatic (1 to 6000 MHz)
1 = 1 to 40 MHz
2 = 40 to 190 MHz
3 = 190 to 1400 MHz
4 = 1400 to 6000 MHz
“Don’t care” bytes, could be any value
Example
The following transmit array indicates that the sensor is automatically setting the input
range:
Byte
0
1
2 to 63
Data
135
0
Not significant
Description
Interrupt code for Get Requested Range
Automatic range mode
“Don’t care” bytes, could be any value
See Also
Set Range
Get Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 85
14-Jul-15 (A3)
3.4 (d) - Set Sample Time
Description
Sets the sample time to be used for frequency measurements, from 100 to 3000 ms, in 100
ms steps. The default sample time is 1000 ms (1 second).
Transmit Array
Byte
0
1 to
(n-1)
n
(n+1)
to 63
Data
117
Sample_Time
0
Not significant
Description
Interrupt code for Set Sample Time
The sample time in ms as a string of characters represented
by ASCII character codes, 1 code per byte
Zero value byte to indicate the end of the sample time string
“Don’t care” bytes, can be any value
Data
117
Not significant
Description
Interrupt code for Set Sample Time
“Don’t care” bytes, could be any value
Returned Array
Byte
0
1 to 63
Example
The following transmit array sets the frequency sample time to 1500 ms:
Byte
0
1
2
3
4
5
6 to 63
Data
117
49
53
48
48
0
Not significant
Description
Interrupt code for Set Sample Time
ASCII character code for "1"
ASCII character code for "5"
ASCII character code for "0"
ASCII character code for "0"
Zero value byte to indicate the end of the sample time string
“Don’t care” bytes, can be any value
See Also
Get Sample Time
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 86
14-Jul-15 (A3)
3.4 (e) - Get Sample Time
Description
Returns the time in milliseconds over which the input frequency will be sampled.
Transmit Array
Byte
0
1 to 63
Data
134
Not significant
Description
Interrupt code for Get Sample Time
“Don’t care” bytes, can be any value
Data
134
Sample_Time
Description
Interrupt code for Get Sample Time
The sample time in ms as a string of characters represented
by ASCII character codes, 1 code per byte
Zero value byte to indicate the end of the sample time string
“Don’t care” bytes, could be any value
Returned Array
Byte
0
1 to
(n-1)
n
(n+1)
to 63
0
Not significant
Example
The following returned array indicates that the frequency sample time is currently set to 300
ms:
Byte
0
1
2
3
4
5 to 63
Data
134
51
48
48
0
Not significant
Description
Interrupt code for Get Sample Time
ASCII character code for "3"
ASCII character code for "0"
ASCII character code for "0"
Zero value byte to indicate the end of the sample time string
“Don’t care” bytes, could be any value
See Also
Set Sample Time
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 87
14-Jul-15 (A3)
3.4 (f) - Get Reference Source
Description
Indicates whether the sensor is using the internal reference for frequency measurements or
an external source. The reference source will automatically switch to external if a suitable
signal is detected at the Ref In port.
Transmit Array
Byte
0
1 to 63
Data
112
Not significant
Description
Interrupt code for Get Reference Source
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1 to
(n-1)
Data
112
Ref_Source
n
(n+1)
to 63
0
Not significant
Description
Interrupt code for Get Reference Source
The reference source as a string of characters represented
by ASCII character codes, 1 code per byte. The string
representation will be either of:
 "ExtRef" for external reference
 "IntRef" for internal reference
Zero value byte to indicate the end of the string
“Don’t care” bytes, could be any value
Example
The following returned array indicates that the sensor is using the internal reference source:
Byte
0
1
2
3
4
5
6
7
8 to 63
Data
112
73
110
116
82
101
102
0
Not significant
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Description
Interrupt code for Get Reference Source
ASCII character code for "I"
ASCII character code for "n"
ASCII character code for "t"
ASCII character code for "R"
ASCII character code for "e"
ASCII character code for "f"
Zero value byte to indicate the end of the sample time string
“Don’t care” bytes, could be any value
Page 88
14-Jul-15 (A3)
3.4 (g) - Read Frequency
Description
Returns the measured input frequency in MHz.
Transmit Array
Byte
0
1 to 63
Data
110
Not significant
Description
Interrupt code for Read Frequency
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1 to
(n-1)
n
(n+1)
to 63
Data
110
Frequency
0
Not significant
Description
Interrupt code for Read Frequency
The frequency in MHz as a string of characters represented
by ASCII character codes, 1 code per byte
Zero value byte to indicate the end of the frequency string
“Don’t care” bytes, could be any value
Example
The following returned array indicates that the measured frequency is 3101.25 MHz:
Byte
0
1
2
3
4
5
6
7
8
9 to 63
Data
110
51
49
48
49
46
50
53
0
Not significant
Description
Interrupt code for Read Frequency
ASCII character code for "3"
ASCII character code for "1"
ASCII character code for "0"
ASCII character code for "1"
ASCII character code for "."
ASCII character code for "2"
ASCII character code for "5"
Zero value byte to indicate the end of the frequency string
“Don’t care” bytes, could be any value
See Also
Read Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 89
14-Jul-15 (A3)
4 - Ethernet Control over IP Networks
Mini-Circuits' integrated frequency and power meter models have an RJ45 connector for
remote control over Ethernet TCP/IP networks. HTTP (Get/Post commands) and Telnet
communication are supported. UDP transmission is also supported for discovering available
sensors on the network.
The device can be configured manually with a static IP address or automatically by the
network using DHCP (Dynamic Host Control Protocol):


Dynamic IP (factory default setting)
o Subnet Mask, Network Gateway and local IP Address are assigned by the
network server on each connection
o The only user controllable parameters are:
 TCP/IP Port for HTTP communication (the default is port 80)
 Password (up to 20 characters; default is no password)
Static IP
o All parameters must be specified by the user:
 IP Address (must be a legal and unique address on the local network)
 Subnet Mask (subnet mask of the local network)
 Network gateway (the IP address of the network gateway/router)
 TCP/IP Port for HTTP communication (the default is port 80)
 Password (up to 20 characters; default is no password)
Notes:
1. The TCP/IP port must be included in every HTTP command to the sensor unless the
default port 80 is used
2. The password must be included in every HTTP command to the sensor if password
security is enabled
3. Port 23 is reserved for Telnet communication
4. The device draws DC power through the USB type B connector; this can be
connected to a computer or the AC mains adapter
4.1 (a) - Configuring Ethernet Settings via USB
The sensor must be connected via the USB interface in order to configure the Ethernet
settings. Following initial configuration, the device can be controlled via the Ethernet
interface with no further need for a USB connection. The API DLL provides the functionality
for configuring the Ethernet settings over a USB connection (see DLL Functions for Ethernet
Configuration for full details).
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 90
14-Jul-15 (A3)
4.2 - Ethernet Communication Methodology
Communication over Ethernet is accomplished by sending SCPI commands using either HTTP
(Get/Post commands) or Telnet communication. The HTTP and Telnet protocols are both
commonly supported and simple to implement in most programming languages. Any Internet
browser can be used as a console/tester for HTTP control by typing the commands/queries
directly into the address bar. The SCPI commands that can be sent to integrated frequency
and power meter series are detailed in the SCPI Command Set for Ethernet Control section.
4.2 (a) - Setting Sensor Properties Using HTTP and SCPI
The basic format of the HTTP command to set the sensor is:
http://ADDRESS:PORT/PWD;COMMAND
Where
 http:// is required
 ADDRESS = IP address (required)
 PORT = TCP/IP port (can be omitted if port 80 is used)
 PWD = Password (can be omitted if password security is not enabled)
 COMMAND = Command to send to the power sensor
Example 1:
http://192.168.100.100:800/PWD=123;:FREQ:1000
Explanation:
 The sensor has IP address 192.168.100.100 and uses port 800
 Password security is enabled and set to “123”
 The command is to set the compensation frequency to 1000MHz (see below for
the full explanation of all commands/queries)
Example 2:
http://10.10.10.10/:TEMP:FORMAT:F
Explanation:
 The sensor has IP address 10.10.10.10 and uses the default port 80
 Password security is disabled
 The command is to set the temperature format to Fahrenheit (see below for the
full explanation of all commands/queries)
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 91
14-Jul-15 (A3)
4.2 (b) - Querying Power Sensor Properties Using HTTP and SCPI
The basic format of the HTTP command to query the sensor is:
http://ADDRESS:PORT/PWD;QUERY?
Where
 http:// is required
 ADDRESS = IP address (required)
 PORT = TCP/IP port (can be omitted if port 80 is used)
 PWD = Password (can be omitted if password is security is not enabled)
 QUERY? = Query to send to the sensor
Example 1:
http://192.168.100.100:800/PWD=123;:MN?
Explanation:
 The sensor has IP address 192.168.100.100 and uses port 800
 Password security is enabled and set to “123”
 The query is to return the model name of the sensor (see below for the full
explanation of all commands/queries)
Example 2:
http://10.10.10.10/:POWER?
Explanation:
 The sensor has IP address 10.10.10.10 and uses the default port 80
 Password security is disabled
 The query is to return the current power reading (see below for the full
explanation of all commands/queries)
The device will return the result of the query as a string of ASCII characters.
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 92
14-Jul-15 (A3)
4.2 (c) - Communication Using Telnet and SCPI
Communication with the device is started by creating a Telnet connection to the sensor's IP
address. On successful connection the “line feed” character will be returned. If the sensor
has a password enabled then this must be sent as the first command after connection.
The full list of all SCPI commands and queries is detailed in the following sections. A basic
example of the Telnet communication structure using the Windows Telnet Client is
summarized below:
1) Set up Telnet connection to a sensor with IP address 192.168.9.73
2) The “line feed” character is returned indicating the connection was successful:
3) The password (if enabled) must be sent as the first command; a return value of 1 indicates
success:
4) Any number of commands and queries can be sent as needed:
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 93
14-Jul-15 (A3)
4.3 - Device Discovery Using UDP
In addition to HTTP and Telnet, the integrated frequency and power sensors also provide
limited support of the UDP protocol for the purpose of “device discovery.” This allows a user
to request the IP address and configuration of all Mini-Circuits sensors connected on the
network; full control of those units is then accomplished using HTTP or Telnet, as detailed
previously.
Alternatively, the IP configuration can be identified or changed by connecting the sensor with
the USB interface (see Configuring Ethernet Settings).
Note: UDP is a simple transmission protocol that provides no method for error correction or
guarantee of receipt.
UDP Ports
Mini-Circuits’ sensors are configured to listen on UDP port 4950 and answer on UDP port 4951.
Communication on these ports must be allowed through the computer’s firewall in order to
use UDP for device discovery. If the sensor’s IP address is already known it is not necessary to
use UDP.
Transmission
The command MCL_POWERSENSOR? should be broadcast to the local network using UDP
protocol on port 4950.
Receipt
All Mini-Circuits sensors that receive the request will respond with the following information
(each field separated by CrLf) on port 4951:






Model Name
Serial Number
IP Address/Port
Subnet Mask
Network Gateway
MAC Address
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 94
14-Jul-15 (A3)
Example
Sent Data:
MCL_POWERSENSOR?
Received Data:
Model Name: FCPM-6000RC
Serial Number: 11402120001
IP Address=192.168.9.101 Port: 80
Subnet Mask=255.255.0.0
Network Gateway=192.168.9.0
Mac Address=D0-73-7F-82-D8-01
Model Name: FCPM-6000RC
Serial Number: 11402120002
IP Address=192.168.9.102 Port: 80
Subnet Mask=255.255.0.0
Network Gateway=192.168.9.0
Mac Address=D0-73-7F-82-D8-02
Model Name: FCPM-6000RC
Serial Number: 11402120003
IP Address=192.168.9.103 Port: 80
Subnet Mask=255.255.0.0
Network Gateway=192.168.9.0
Mac Address=D0-73-7F-82-D8-03
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 95
14-Jul-15 (A3)
5 - SCPI Command Set for Ethernet Control
This section details the control functions applicable to Mini-Circuits’ integrated frequency
and power meters, using SCPI communication. SCPI (Standard Commands for Programmable
Instruments) is a common method for controlling instrumentation products.
The SCPI commands are sent as an ASCII text string (up to 63 characters) in the below
format:
:COMMAND:[value]:[suffix]
Where:
COMMAND
[value]
[suffix]
= the command/query to send
= the value (if applicable) to set
= the units (if applicable) that apply to the value
Commands can be sent in upper or lower case and the return value will be an ASCII text
string. If an unrecognized command/query is received the sensor will return:
-99 Unrecognized Command. Model=[ModelName] SN=[SerialNumber]
These functions can be called using HTTP get/post commands or Telnet over a TCP/IP
network when the device is connected via the Ethernet RJ45 port (see Ethernet Control over
IP Networks).
5.1 - Summary of SCPI Commands
5.1 (a) - Common Commands
Description
Command/Query
a
Get Model Name
:MN?
b
Get Serial Number
:SN?
c
Get Firmware
:FIRMWARE?
d
Get Temperature Units
:TEMP:FORMAT?
e
Set Temperature Units
:TEMP:FORMAT:[units]
f
Get Internal Temperature
:TEMP?
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 96
14-Jul-15 (A3)
5.1 (b) - Power Measurement Commands
Description
Command/Query
a
Get Measurement Mode
:MODE?
b
Set Measurement Mode
:MODE:[speed]
c
Get Averaging Mode
:AVG:STATE?
d
Set Averaging Mode
:AVG:STATE:[mode]
e
Get Average Count
:AVG:COUNT?
f
Set Average Count
:AVG:COUNT:[count]
g
Get Compensation Frequency
:FREQ?
h
Set Compensation Frequency
:FREQ:[freq]
i
Get Compensation Frequency Mode
:FC:AUTOFREQ?
j
Set Compensation Frequency Mode
:FC:AUTOFREQ:[mode]
k
Read Power
:POWER?
l
Read Voltage
:VOLTAGE?
5.1 (c) - Frequency Measurement Commands
Description
Command/Query
a
Get Range
:FC:RANGE?
b
Get Requested Range
:FC:RRANGE?
c
Set Range
:FC:RANGE:[range]
d
Get Sample Time
:FC:SAMPLETIME?
e
Set Sample Time
:FC:SAMPLETIME:[time]
f
Get Frequency
:FC:FREQ?
g
Get Reference Mode
:FC:REF?
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 97
14-Jul-15 (A3)
5.2 - Common Commands
5.2 (a) - Get Model Name
Description
Returns the full Mini-Circuits part number of the sensor.
Command Syntax
:MN?
Return string
MN=[model]
Variable
[model]
Description
Full model name of the sensor (for example, “FCPM6000RC”)
Examples
string to Send
string Returned
:MN?
MN=FCPM-6000RC
HTTP Implementation:
http://10.10.10.10/:MN?
See Also
Get Serial Number
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 98
14-Jul-15 (A3)
5.2 (b) - Get Serial Number
Description
Returns the serial number of the sensor.
Command Syntax
:SN?
Return string
SN=[serial]
Variable
[serial]
Description
Serial number of the sensor (for example,
“11401010001”)
Examples
string to Send
string Returned
:SN?
SN=11401010001
HTTP Implementation:
http://10.10.10.10/:SN?
See Also
Get Model Name
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 99
14-Jul-15 (A3)
5.2 (c) - Get Firmware
Description
Returns the firmware version of the sensor.
Command Syntax
:FIRMWARE?
Return string
FIRMWARE=[firmware]
Variable
[firmware]
Description
Firmware version name (for example, “A1”)
Examples
string to Send
string Returned
:FIRMWARE?
FIRMWARE=A1
HTTP Implementation:
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
http://10.10.10.10/:FIRMWARE?
Page 100
14-Jul-15 (A3)
5.2 (d) - Get Temperature Units
Description
Returns the units to be used by the sensor’s internal temperature sensor, either degrees
Celsius or Fahrenheit.
Command Syntax
:TEMP:FORMAT?
Return string
[units]
Variable
[units]
Value
F
C
Description
Temperature measurements in degrees Fahrenheit
Temperature measurements in degrees Celsius
Examples
string to Send
string Returned
:TEMP:FORMAT?
C
HTTP Implementation:
http://10.10.10.10/:TEMP:FORMAT?
See Also
Set Temperature Units
Get Internal Temperature
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 101
14-Jul-15 (A3)
5.2 (e) - Set Temperature Units
Description
Sets the units to be used by the sensor’s internal temperature sensor, either degrees Celsius
or Fahrenheit.
Command Syntax
:TEMP:FORMAT:[units]
Variable
[units]
Value
F
C
Description
Set temperature measurements to degrees Fahrenheit
Set temperature measurements to degrees Celsius
Value
0
1
Description
Command failed
Command completed successfully
Return string
[status]
Variable
[status]
Examples
string to Send
string Returned
:TEMP:FORMAT:F
:TEMP:FORMAT:C
1
1
HTTP Implementation:
http://10.10.10.10/:TEMP:FORMAT?:C
See Also
Get Temperature Units
Get Internal Temperature
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 102
14-Jul-15 (A3)
5.2 (f) - Get Internal Temperature
Description
Returns the internal temperature of the sensor in degrees Celsius or Fahrenheit, as defined
by the user.
Command Syntax
:TEMP?
Return string
[temperature]
Variable
[temperature]
Description
The temperature returned from the specified sensor
Examples
string to Send
string Returned
:TEMP?
+25.50
HTTP Implementation:
http://10.10.10.10/:TEMP?
See Also
Get Temperature Units
Set Temperature Units
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 103
14-Jul-15 (A3)
5.3 - Power Measurement Commands
5.3 (a) - Get Measurement Mode
Description
Returns an integer indicating the power measurement mode of the sensor; "low noise"or
"fast sampling". The specifications for these modes are defined in the individual model
datasheets. The default is "low noise" mode.
Command Syntax
:MODE?
Return string
[speed]
Variable
[speed]
Value
0
1
Description
Low noise mode
Fast sampling mode
Examples
string to Send
string Returned
:MODE?
1
HTTP Implementation:
http://10.10.10.10/:MODE?
See Also
Set Measurement Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 104
14-Jul-15 (A3)
5.3 (b) - Set Measurement Mode
Description
Sets the measurement mode of the sensor between "low noise" and "fast sampling" modes.
The specifications for these modes are defined in the individual model datasheets. The
default is "low noise" mode.
Command Syntax
:MODE:[speed]
Variable
Value
0
1
Description
Low noise mode
Fast sampling mode
Variable
Value
[status]
0
1
Description
Command failed
Command completed successfully
[speed]
Return string
[status]
Examples
string to Send
string Returned
:MODE:0
:MODE:1
:MODE:2
1
1
1
HTTP Implementation:
http://10.10.10.10/:MODE:1
See Also
Get Measurement Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 105
14-Jul-15 (A3)
5.3 (c) - Get Averaging Mode
Description
Indicates whether “averaging” mode is currently enable for the sensor. The default is
averaging disabled.
Command Syntax
:AVG:STATE?
Return string
[mode]
Variable
[mode]
Value
0
1
Description
Averaging mode disabled
Averaging mode enabled
Examples
string to Send
string Returned
:AVG:STATE?
1
HTTP Implementation:
http://10.10.10.10/:AVG:STATE?
See Also
Set Averaging Mode
Get Average Count
Set Average Count
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 106
14-Jul-15 (A3)
5.3 (d) - Set Averaging Mode
Description
Enables or disables the sensor “averaging” mode.
Command Syntax
:AVG:STATE:[mode]
Variable
Value
0
1
Description
Averaging mode disabled
Averaging mode enabled
Variable
Value
[status]
0
1
Description
Command failed
Command completed successfully
[mode]
Return string
[status]
Examples
string to Send
string Returned
:AVG:STATE:1
1
HTTP Implementation:
http://10.10.10.10/:AVG:STATE:1
See Also
Get Averaging Mode
Get Average Count
Set Average Count
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 107
14-Jul-15 (A3)
5.3 (e) - Get Average Count
Description
Returns the number of power readings over which the measurement will be averaged when
averaging mode is enabled. The default value is 1 (average the reading over 1
measurement).
Command Syntax
:AVG:COUNT?
Return string
[count]
Variable
[count]
Description
The number of power readings over which to average
the measurement
Examples
string to Send
string Returned
:AVG:COUNT?
3
HTTP Implementation:
http://10.10.10.10/:AVG:COUNT?
See Also
Get Averaging Mode
Set Averaging Mode
Set Average Count
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 108
14-Jul-15 (A3)
5.3 (f) - Set Average Count
Description
Sets the number of power readings over which to average the measurement when averaging
mode is enabled. The default value is 1 (average the reading over 1 measurement).
Command Syntax
:AVG:COUNT:[count]
Variable
Description
The number of readings over which to average the
power reading
[count]
Return string
[status]
Variable
Value
[status]
0
1
Description
Command failed
Command completed successfully
Examples
string to Send
string Returned
:AVG:COUNT:10
1
HTTP Implementation:
http://10.10.10.10/:AVG:COUNT:10
See Also
Get Averaging Mode
Set Averaging Mode
Get Average Count
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 109
14-Jul-15 (A3)
5.3 (g) - Get Compensation Frequency
Description
Returns the frequency currently in use for calibrating the input power measurements.
Command Syntax
:FREQ?
Return string
[freq]
Variable
[freq]
Description
The current compensation frequency in MHz
Examples
string to Send
string Returned
:FREQ?
2500.000000 MHz
HTTP Implementation:
http://10.10.10.10/:FREQ?
See Also
Set Compensation Frequency
Read Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 110
14-Jul-15 (A3)
5.3 (h) - Set Compensation Frequency
Description
Sets the compensation frequency of the sensor head during operation in manual
compensation mode; this needs to be set in order to achieve the specified power
measurement accuracy. In automatic frequency compensation mode, the power reading is
automatically compensated based on the sensor's simultaneous frequency measurement.
Note: This property will not filter out unwanted signals.
Command Syntax
:FREQ:[freq]
Variable
Description
The current compensation frequency in MHz
[freq]
Return string
[status]
Variable
Value
[status]
0
1
Description
Command failed
Command completed successfully
Examples
string to Send
string Returned
:FREQ:2500
1
HTTP Implementation:
http://10.10.10.10/:FREQ:2500
See Also
Get Compensation Frequency
Read Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 111
14-Jul-15 (A3)
5.3 (i) - Get Compensation Frequency Mode
Description
Indicates whether the power sensor/frequency counter is using automatic or manual mode
for compensating power readings. In automatic mode, the sensor monitors the frequency
and uses this to compensate the power reading based on an internal look-up. In manual
mode, the expected frequency must be set manually.
Applies To
Model Name
FCPM-6000RC
Serial Number
All serial numbers
Command Syntax
:FC:AUTOFREQ?
Return string
[mode]
Variable
Value
[mode]
0
Description
Manual compensation mode (expected input
frequency must be specified by user)
Automatic compensation mode (the power reading
compensation is set based on the measured input
frequency)
1
Examples
string to Send
string Returned
:FC:AUTOFREQ?
1
HTTP Implementation:
http://10.10.10.10/:FC:AUTOFREQ?
See Also
Get Compensation Frequency
Set Compensation Frequency
Set Compensation Frequency Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 112
14-Jul-15 (A3)
5.3 (j) - Set Compensation Frequency Mode
Description
Sets whether the power sensor/frequency counter is to use automatic or manual mode for
compensating power readings. In automatic mode, the sensor monitors the frequency and
uses this to compensate the power reading based on an internal look-up. In manual mode,
the expected frequency must be set manually.
Applies To
Model Name
FCPM-6000RC
Serial Number
All serial numbers
Command Syntax
:FC:AUTOFREQ:[mode]
Variable
Value
[mode]
0
1
Description
Set manual compensation mode (expected input
frequency must be specified by user)
Set Automatic compensation mode (the power
reading compensation is set based on the measured
input frequency)
Return string
[status]
Variable
Value
[status]
0
1
Description
Command failed
Command completed successfully
Examples
string to Send
string Returned
:FC:AUTOFREQ:1
1
HTTP Implementation:
http://10.10.10.10/:FC:AUTOFREQ:1
See Also
Get Compensation Frequency
Set Compensation Frequency
Get Compensation Frequency Mode
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 113
14-Jul-15 (A3)
5.3 (k) - Read Power
Description
Returns the input power measurement in dBm.
Command Syntax
:POWER?
Return string
[power]
Variable
[power]
Description
Input power measurement in dBm
Examples
string to Send
string Returned
:POWER?
-22.05 dBm
HTTP Implementation:
http://10.10.10.10/:POWER?
See Also
Set Compensation Frequency
Read Voltage
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 114
14-Jul-15 (A3)
5.3 (l) - Read Voltage
Description
Returns the raw voltage detected at the sensor head. There is no calibration for temperature
or frequency.
Command Syntax
:VOLTAGE?
Return string
[volts]
Variable
[volts]
Description
Input voltage reading in mV.
Examples
string to Send
string Returned
:VOLTAGE?
0.000105 Volt
HTTP Implementation:
http://10.10.10.10/:VOLTAGE?
See Also
Read Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 115
14-Jul-15 (A3)
5.4 - Frequency Measurement Commands
5.4 (a) - Get Range
Description
Returns the actual frequency measurement range of the sensor when in automatic range
mode.
Command Syntax
:FC:RANGE?
Return string
RANGE:[range]
Variable
[range]
Value
0
1
2
3
4
Description
No input signal detected
Mode 1; for input frequencies from 1 to 40 MHz
Mode 2; for input frequencies from 40 to 190 MHz
Mode 3; for input frequencies from 190 to 1400 MHz
Mode 4; for input frequencies from 1400 to 6000
MHz.
Examples
string to Send
string Returned
:FC:RANGE?
RANGE:1
HTTP Implementation:
http://10.10.10.10/:FC:RANGE?
See Also
Get Requested Range
Set Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 116
14-Jul-15 (A3)
5.4 (b) - Get Requested Range
Description
Returns the user requested frequency measurement range.
Command Syntax
:FC:RRANGE?
Return string
RANGE:[range]
Variable
[range]
Value
AUTO
1
2
3
4
Description
Automatic mode; the counter will select the
appropriate measurement range
Mode 1; for input frequencies from 1 to 40 MHz
Mode 2; for input frequencies from 40 to 190 MHz
Mode 3; for input frequencies from 190 to 1400 MHz
Mode 4; for input frequencies from 1400 to 6000 MHz
Examples
string to Send
string Returned
:FC:RRANGE?
RANGE: 3
HTTP Implementation:
http://10.10.10.10/:FC:RRANGE?
See Also
Get Range
Set Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 117
14-Jul-15 (A3)
5.4 (c) - Set Range
Description
Sets the frequency measurement range of the sensor. By default the frequency counter is in
“Auto Range” mode and will automatically set the correct frequency range, this process will
take typically 50ms. If the frequency range of the input signal is known then the user can
eliminate this delay by specifying the appropriate range.
Command Syntax
:FC:RANGE:[range]
Variable
[range]
Value
AUTO
1
2
3
4
Description
Automatic mode; the counter will select the
appropriate measurement range
Mode 1; for input frequencies from 1 to 40 MHz
Mode 2; for input frequencies from 40 to 190 MHz
Mode 3; for input frequencies from 190 to 1400 MHz
Mode 4; for input frequencies from 1400 to 6000 MHz
Return string
[status]
Variable
Value
[status]
0
1
Description
Command failed
Command completed successfully
Examples
string to Send
string Returned
:FC:RANGE:AUTO
:FC:RANGE:3
1
1
HTTP Implementation:
http://10.10.10.10/:FC:RANGE:AUTO
See Also
Get Range
Get Requested Range
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 118
14-Jul-15 (A3)
5.4 (d) - Get Sample Time
Description
Returns the time in milliseconds over which the input frequency will be sampled.
Command Syntax
:FC:SAMPLETIME?
Return string
[time]
Variable
[time]
Description
The frequency sample time in milliseconds
Examples
string to Send
string Returned
:FC:SAMPLETIME?
1000
HTTP Implementation:
http://10.10.10.10/:FC:SAMPLETIME?
See Also
Set Sample Time
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 119
14-Jul-15 (A3)
5.4 (e) - Set Sample Time
Description
Sets the sample time to be used for frequency measurements, from 100 to 3000 ms, in 100
ms steps. The default sample time is 1000 ms (1 second).
Command Syntax
:FC:SAMPLETIME:[time]
Return string
[status]
Variable
Value
[status]
0
1
Description
Command failed
Command completed successfully
Examples
string to Send
string Returned
:FC:SAMPLETIME:300
1
HTTP Implementation:
http://10.10.10.10/:FC:SAMPLETIME:300
See Also
Get Sample Time
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 120
14-Jul-15 (A3)
5.4 (f) - Get Frequency
Description
Returns the measured input frequency in MHz.
Command Syntax
:FC:FREQ?
Return string
[freq]
Variable
Description
The measured frequency in MHz or "Unknown" if no
measureable input signal is detected
[freq]
Examples
string to Send
string Returned
:FC:FREQ?
:FC:FREQ?
Unknown
1000.0000 MHz
HTTP Implementation:
http://10.10.10.10/:FC:FREQ?
See Also
Read Power
Set Compensation Frequency Mode
Get Frequency & Power
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 121
14-Jul-15 (A3)
5.4 (g) - Get Frequency & Power
Description
Measures the frequency (MHz) and power level (dBm) of the input signal.
Command Syntax
:FC:FREQ?POWER?
Return string
[freq] AND [freq]
Variable
[freq]
[power]
Description
The measured frequency in MHz
The measured power level in dBm
Examples
string to Send
string Returned
:FC:FREQ?POWER?
1000 MHz AND 10.5 dBm
HTTP Implementation:
http://10.10.10.10/:FC:FREQ?POWER?
See Also
Read Power
Get Frequency
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
Page 122
14-Jul-15 (A3)
5.4 (h) - Get Reference Mode
Description
Indicates whether the sensor is using the internal reference for frequency measurements or
an external source. The reference source will automatically switch to external if a suitable
signal is detected at the Ref In port.
Command Syntax
:FC:REF?
Return string
[ref]
Variable
[ref]
Value
IntRef
ExtRef
Description
Internal reference in use
External reference detected and in use
Examples
string to Send
string Returned
:FC:REF?
ExtRef
HTTP Implementation:
Portable Test Equipment Programming Manual
Integrated Frequency & Power Meters
http://10.10.10.10/:FC:REF?
Page 123
14-Jul-15 (A3)