RF Switch Matrices
Portable Test Equipment Programming Manual
RF Switch Matrices
USB Series RF Switch Matrices
RC Series RF Switch Matrices
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: sales@minicircuits.com
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 Functions ................................................................................... 10
2.3 (a) - DLL Functions for USB Control ........................................................................................ 10
2.3 (b) - DLL Functions for Ethernet Configuration (RC Models Only).......................................... 11
2.4 - DLL Functions for USB Control.............................................................................. 12
2.4 (a) - Connect to Switch Matrix ................................................................................................ 12
2.4 (b) - Connect to Switch Matrix by Address ............................................................................. 13
2.4 (c) - Disconnect from Switch Matrix ....................................................................................... 14
2.4 (d) - Read Model Name of Switch Matrix ............................................................................... 15
2.4 (e) - Read Serial Number of Switch Matrix ............................................................................. 16
2.4 (f) - Set Individual SPDT Switch ............................................................................................... 17
2.4 (g) - Set All SPDT Switches ...................................................................................................... 19
2.4 (h) - Set Single SP4T Switch..................................................................................................... 21
2.4 (i) - Set Dual SP4T Switch – Both Switches ............................................................................. 23
2.4 (j) - Set Dual SP4T – Switch A .................................................................................................. 25
2.4 (k) - Set Dual SP4T – Switch B ................................................................................................. 27
2.4 (l) - Set SP6T Switch ................................................................................................................ 29
2.4 (m) - Set Dual SP6T – Switch A ................................................................................................ 31
2.4 (n) - Set Dual SP6T – Switch B ................................................................................................. 33
2.4 (o) - Get Switch States ............................................................................................................ 35
2.4 (p) - Get SP4T Switch State ..................................................................................................... 39
2.4 (q) - Get SP6T Switch State ..................................................................................................... 41
2.4 (r) - Set Address of Switch Matrix ........................................................................................... 43
2.4 (s) - Get Address of Switch Matrix .......................................................................................... 44
2.4 (t) - Get List of Connected Serial Numbers ............................................................................. 45
2.4 (u) - Get List of Available Addresses ....................................................................................... 46
2.4 (v) - Get Switch Counter ......................................................................................................... 47
2.4 (w) - Get All Switch Counters .................................................................................................. 49
2.4 (x) - Get Temperature of Switch Matrix.................................................................................. 51
2.4 (y) - Get Heat Alarm ................................................................................................................ 52
2.4 (z) - Get 24V DC Supply Status (Antiquated) .......................................................................... 53
2.4 (aa) - Get Fan Status ............................................................................................................... 55
2.4 (bb) - Get Software Connection Status ................................................................................... 57
2.4 (cc) - Get USB Connection Status............................................................................................ 58
2.4 (dd) - Check Connection (Antiquated) .................................................................................... 59
2.4 (ee) - Get USB Device Name ................................................................................................... 60
2.4 (ff) - Get Firmware .................................................................................................................. 61
2.4 (gg) - Get Firmware Version (Antiquated) .............................................................................. 62
2.5 - DLL Functions for Ethernet Configuration ............................................................. 63
2.5 (a) - Get Ethernet Configuration ............................................................................................. 63
2.5 (b) - Get IP Address ................................................................................................................. 65
2.5 (c) - Get MAC Address............................................................................................................. 67
2.5 (d) - Get Network Gateway ..................................................................................................... 69
2.5 (e) - Get Subnet Mask ............................................................................................................. 71
2.5 (f) - Get TCP/IP Port ................................................................................................................ 73
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 1
4-Dec-15 (A4)
2.5 (g) - Get DHCP Status .............................................................................................................. 74
2.5 (h) - Get Password Status ....................................................................................................... 75
2.5 (i) - Get Password.................................................................................................................... 76
2.5 (j) - Save IP Address ................................................................................................................ 77
2.5 (k) - Save Network Gateway ................................................................................................... 78
2.5 (l) - Save Subnet Mask ............................................................................................................ 79
2.5 (m) - Save TCP/IP Port............................................................................................................. 80
2.5 (n) - Use DHCP......................................................................................................................... 81
2.5 (o) - Use Password .................................................................................................................. 82
2.5 (p) - Set Password ................................................................................................................... 83
3 - Operating in a Linux Environment via USB ................................................84
3.1 - Summary of USB Interrupt Functions ................................................................... 85
3.2 - Description of USB Interrupt Functions ................................................................ 86
3.2 (a) - Get Device Model Name ................................................................................................. 86
3.2 (b) - Get Device Serial Number ............................................................................................... 87
3.2 (c) - Set Single SPDT Switch..................................................................................................... 88
3.2 (d) - Set All SPDT Switches ...................................................................................................... 90
3.2 (e) - Set All SP4T Switches ....................................................................................................... 92
3.2 (f) - Set SP6T Switch ................................................................................................................ 95
3.2 (g) - Get All SPDT Switch States .............................................................................................. 97
3.2 (h) - Get All SP4T Switch States............................................................................................... 99
3.2 (i) - Get SP6T Switch State .................................................................................................... 101
3.2 (j) - Get Firmware.................................................................................................................. 103
3.2 (k) - Get Internal Temperature ............................................................................................. 104
3.2 (l) - Get 24V DC Power Status ............................................................................................... 106
3.2 (m) - Get Heat Alarm............................................................................................................. 108
3.2 (n) - Get Fan Status ............................................................................................................... 109
3.2 (o) - Get Switch Counter ....................................................................................................... 110
3.2 (p) - Get All Switch Counters................................................................................................. 112
4 - Ethernet Control over IP Networks ......................................................... 116
4.1 - Configuring Ethernet Settings via USB .................................................................116
4.2 - Ethernet Communication Methodology ..............................................................117
4.2 (a) - Setting Switch States Using HTTP .................................................................................. 117
4.2 (b) - Querying Switch Properties Using HTTP ....................................................................... 118
4.2 (c) - Communication Using Telnet ........................................................................................ 119
4.3 - Device Discovery Using UDP ...............................................................................120
4.4 - Summary of Ethernet Commands/Queries ..........................................................122
4.5 - Description of Ethernet Commands/Queries .......................................................123
4.5 (a) - Set Single SPDT Switch .................................................................................................. 123
4.5 (b) - Set All SPDT Switches .................................................................................................... 124
4.5 (c) - Set Single SP4T Switch ................................................................................................... 126
4.5 (d) - Set All SP4T Switches..................................................................................................... 127
4.5 (e) - Set SP6T Switch ............................................................................................................. 129
4.5 (f) - Get All SPDT Switch States ............................................................................................. 130
4.5 (g) - Get Single SP4T Switch State ......................................................................................... 131
4.5 (h) - Get All SP4T Switch States............................................................................................. 132
4.5 (i) - Get SP6T Switch State .................................................................................................... 134
4.5 (j) - Get Model Name ............................................................................................................ 135
4.5 (k) - Get Serial Number ......................................................................................................... 136
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 2
4-Dec-15 (A4)
4.5 (l) - Get Internal Temperature .............................................................................................. 137
4.5 (m) - Get Heat Alarm............................................................................................................. 138
4.5 (n) - Get Fan Status ............................................................................................................... 139
4.5 (o) - Get Firmware ................................................................................................................ 140
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 3
4-Dec-15 (A4)
1 - Overview
This Programming Manual is intended for customers wishing to create their own interface for
Mini-Circuits' USB and Ethernet controlled, RF switch matrices. 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-002.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 switch matrix 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
RF Switch Matrices
Page 4
4-Dec-15 (A4)
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 RF switch matrices.
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
RF Switch Matrices
Page 5
4-Dec-15 (A4)
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’ RF switch matrices 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 Mini-Circuits 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 (mcl_rf_switch_controller.dll) 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_rf_switch_controller.dll
For 64-bit Windows operating systems type (see Fig 2.1-e):
\WINDOWS\SysWOW64\Regsvr32 \WINDOWS\SysWOW64\mcl_rf_switch_controller.dll
4. Hit enter to confirm and a message box will appear to advise of successful registration.
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 6
4-Dec-15 (A4)
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
RF Switch Matrices
Page 7
4-Dec-15 (A4)
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’ RF switch matrices 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 (mcl_rf_switch_controller64.dll) 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
RF Switch Matrices
Page 8
4-Dec-15 (A4)
2.2 - Referencing the DLL Library
The DLL file is installed in the host PC’s system folders using the steps outlined in the
Introduction to this manual. In order to use the DLL functionality, 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, the user just needs to instantiate a new instance of the USB_RF_Switch
object in order to use the switch functions. The details of this vary greatly between
programming environments and languages but Mini-Circuits can provide detailed support on
request. A new switch object would need to be initialized for every USB connected switch
matrix that the user wishes to control. In the following examples, MyPTE1 and MyPTE2 will
be used as names of 2 declared switch objects.
Examples
Visual Basic
Public MyPTE1 As New MCL_RF_Switch_Controller.USB_RF_Switch
' Instantiate new switch object, assign to MyPTE1
Public MyPTE2 As New MCL_RF_Switch_Controller.USB_RF_Switch
' Instantiate new switch object, assign to MyPTE2
Visual C++
USB_RF_SwitchBox ^MyPTE1 = gcnew USB_RF_SwitchBox();
// Instantiate new switch object, assign to MyPTE1
USB_RF_SwitchBox ^MyPTE2 = gcnew USB_RF_SwitchBox();
// Instantiate new switch object, assign to MyPTE2
Visual C#
public MCL_RF_Switch_Controller.USB_RF_Switch MyPTE1 = new
_ MCL_RF_Switch_Controller.USB_RF_Switch();
// Instantiate new switch object, assign to MyPTE1
public MCL_RF_Switch_Controller.USB_RF_Switch MyPTE2 = new
_ MCL_RF_Switch_Controller.USB_RF_Switch();
// Instantiate new switch object, assign to MyPTE2
Matlab
MyPTE1 = actxserver('MCL_RF_Switch_Controller.USB_RF_Switch')
MyPTE2 = actxserver('MCL_RF_Switch_Controller.USB_RF_Switch')
MyPTE1.invoke
% Invoke new switch object, MyPTE1
MyPTE12.invoke
% Invoke new switch object, MyPTE2
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 9
4-Dec-15 (A4)
2.3 - Summary of DLL Functions
The following functions are defined in both of the DLL files. Please see the following sections
for a full description of their structure and implementation.
2.3 (a) - DLL Functions for USB Control
a) Short Connect (Optional String SN)
b) Short ConnectByAddress (Optional Short Address)
c) Void Disconnect ()
d) Short Read_ModelName (String ModelName)
e) Short Read_SN (String SN)
f) Short Set_Switch (String SwitchName, Short Val)
g) Short Set_SwitchesPort (Byte Val)
h) Short Set_SP4T_COM_To (Byte Port)
i) Short Set_2SP4T_COM_To (Short P1, Short P2)
j) Short Set_2SP4T_COMA_To (Short P1)
k) Short Set_2SP4T_COMB_To (Short P1)
l) Short Set_2SP6T_COM_To (Short P1, Short P2)
m) Short Set_2SP6T_COMA_To (Short P1)
n) Short Set_2SP6T_COMB_To (Short P1)
o) Short GetSwitchesStatus (Short StatusRet)
p) Short Get_2SP4T_State (String Sw)
q) Short Get_2SP6T_State (String Sw)
r) Short Set_Address (Short Address)
s) Short Get_Address ()
t) Short Get_Available_SN_List (String SN_List)
u) Short Get_Available_Address_List (String Add_List)
v) Long GetSwitchCounter (String Sw)
w) Short GetAllSwitchCounters (Long Swc[])
x) Float GetDeviceTemperature (Short TSensor)
y) Short GetHeatAlarm ()
z) Short Get_24V_Indicator ()
aa) Short Get_FAN_Indicator ()
bb) Short GetConnectionStatus ()
cc) Short GetUSBConnectionStatus ()
dd) Short Check_Connection ()
ee) String GetUSBDeviceName ()
ff) Short GetExtFirmware (Short A0, Short A1, Short A2, String Firmware)
gg) Short GetFirmware ()
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 10
4-Dec-15 (A4)
2.3 (b) - DLL Functions for Ethernet Configuration (RC Models Only)
a) Short GetEthernet_CurrentConfig (Int IP1, Int IP2, Int IP3, Int IP4, Int Mask1, Int Mask2,
Int Mask3, Int Mask4, Int Gateway1, Int Gateway2, Int Gateway3, Int Gateway4)
b) Short GetEthernet_IPAddress (Int b1, Int b2, Int b3, Int b4)
c) Short GetEthernet_MACAddress (Int MAC1 , Int MAC2, Int MAC3, Int MAC4, Int MAC5,
Int MAC6)
d) Short GetEthernet_NetworkGateway (Int b1, Int b2, Int b3, Int b4)
e) Short GetEthernet_SubNetMask (Int b1, Int b2, Int b3, Int b4)
f) Short GetEthernet_TCPIPPort (Int port)
g) Short GetEthernet_UseDHCP ()
h) Short GetEthernet_UsePWD ()
i) Short GetEthernet_PWD (string Pwd)
j) Short SaveEthernet_IPAddress (Int b1, Int b2, Int b3, Int b4)
k) Short SaveEthernet_NetworkGateway (Int b1, Int b2, Int b3, Int b4)
l) Short SaveEthernet_SubnetMask (Int b1, Int b2, Int b3, Int b4)
m) Short SaveEthernet_TCPIPPort (Int port)
n) Short SaveEthernet_UseDHCP (Int UseDHCP)
o) Short SaveEthernet_UsePWD (Int UsePwd)
p) Short SaveEthernet_PWD (String Pwd)
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 11
4-Dec-15 (A4)
2.4 - DLL Functions for USB Control
These functions apply to all Mini-Circuits switch matrix models and provide a means to
control the device over a USB connection.
2.4 (a) - Connect to Switch Matrix
Declaration
Short Connect(Optional String SN)
Description
Initializes the USB connection to a switch matrix. If multiple switch matrices are connected
to the same computer, then the serial number should be included, otherwise this can be
omitted. The switch should be disconnected on completion of the program using the
Disconnect function.
Parameters
Data Type
String
Variable
SN
Description
Optional. The serial number of the USB switch matrix. Can
be omitted if only one switch matrix is connected.
Value
0
1
2
Description
No connection was possible
Connection successfully established
Connection already established (Connect has been called
more than once). The switch will continue to operate
normally.
Return Values
Data Type
Short
Examples
Visual Basic
status = MyPTE1.Connect(SN)
Visual C++
status = MyPTE1->Connect(SN);
Visual C#
status = MyPTE1.Connect(SN);
Matlab
status = MyPTE1.Connect(SN)
See Also
Connect to Switch Matrix by Address
Disconnect from Switch Matrix
Get List of Connected Serial Numbers
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 12
4-Dec-15 (A4)
2.4 (b) - Connect to Switch Matrix by Address
Declaration
Short ConnectByAddress(Optional Short Address)
Description
This function is called to initialize the USB connection to a switch matrix by referring to a user
defined address. The address is an integer number from 1 to 255 which can be assigned
using the Set_Address function (the factory default is 255). 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 switch is no longer needed. The switch should be
disconnected on completion of the program using the Disconnect function.
Parameters
Data Type
Short
Variable
Address
Description
Optional. The address of the USB switch matrix. Can be
omitted if only one switch matrix is connected.
Value
0
1
2
Description
No connection was possible
Connection successfully established
Connection already established (Connect has been called
more than once)
Return Values
Data Type
Short
Examples
Visual Basic
status = MyPTE1.ConnectByAddress(5)
Visual C++
status = MyPTE1->ConnectByAddress(5);
Visual C#
status = MyPTE1.ConnectByAddress(5);
Matlab
status = MyPTE1.connectByAddress(5)
See Also
Connect to Switch Matrix
Disconnect from Switch Matrix
Set Address of Switch Matrix
Get Address of Switch Matrix
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 13
4-Dec-15 (A4)
2.4 (c) - Disconnect from Switch Matrix
Declaration
Void Disconnect()
Description
This function is called to close the connection to the switch matrix after completion of the
switching routine. 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 switch matrix from the computer, then
reconnect the switch matrix before attempting to start again.
Parameters
Data Type
None
Variable
Description
Value
Description
Return Values
Data Type
None
Examples
Visual Basic
MyPTE1.Disconnect()
Visual C++
MyPTE1->Disconnect();
Visual C#
MyPTE1.Disconnect();
Matlab
MyPTE1.Disconnect
See Also
Connect to Switch Matrix
Connect to Switch Matrix by Address
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 14
4-Dec-15 (A4)
2.4 (d) - Read Model Name of Switch Matrix
Declaration
Short Read_ModelName(String ModelName)
Description
This function is called to determine the Mini-Circuits part number of the connected switch
matrix. The user passes a string variable which is updated with the part number.
Parameters
Data Type
String
Variable
Description
ModelName Required. A string variable that will be updated with the MiniCircuits part number for the switch matrix.
Return Values
Data Type
Short
Value
0
1
Description
Command failed
Command completed successfully
Examples
Visual Basic
If MyPTE1.Read_ModelName(ModelName) > 0 Then
MsgBox ("The connected switch matrix is " & ModelName)
' Display a message stating the model name
End If
Visual C++
if (MyPTE1->Read_ModelName(ModelName) > 0 )
{
MessageBox::Show("The connected switch matrix is " + ModelName);
// Display a message stating the model name
}
Visual C#
if (MyPTE1.Read_ModelName(ref(ModelName)) > 0 )
{
MessageBox.Show("The connected switch matrix is " + ModelName);
// Display a message stating the model name
}
Matlab
[status, ModelName]=MyPTE1.Read_ModelName(ModelName)
If status > 0 then
{
msgbox('The connected switch matrix is ', ModelName)
% Display a message stating the model name
}
See Also
Read Serial Number of Switch Matrix
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 15
4-Dec-15 (A4)
2.4 (e) - Read Serial Number of Switch Matrix
Declaration
Short Read_SN(String SN)
Description
This function is called to determine the serial number of the connected switch matrix. The
user passes a string variable which is updated with the serial number.
Parameters
Data Type
String
Variable
Description
ModelName Required. String variable that will be updated with the MiniCircuits serial number for the switch matrix.
Return Values
Data Type
Short
Value
0
1
Description
Command failed
Command completed successfully
Examples
Visual Basic
If MyPTE1.Read_SN(SN) > 0 Then
MsgBox (“The connected switch matrix is “ & SN)
' Display a message stating the serial number
End If
Visual C++
if (MyPTE1->Read_SN(SN) > 0 )
{
MessageBox::Show("The connected switch matrix is " + SN);
// Display a message stating the serial number
}
Visual C#
if (MyPTE1.Read_SN(ref(SN)) > 0 )
{
MessageBox.Show("The connected switch matrix is " + SN);
// Display a message stating the serial number
}
Matlab
[status, SN]= MyPTE1.Read_SN(SN)
If status > 0 then
{
msgbox('The connected switch matrix is ', SN)
% Display a message stating the serial number
}
See Also
Connect to Switch Matrix
Read Model Name of Switch Matrix
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 16
4-Dec-15 (A4)
2.4 (f) - Set Individual SPDT Switch
Declaration
Short Set_Switch(String SwitchName, Short Val)
Description
This function sets an individual SPDT switch within the switch matrix whilst leaving all other
switches (if applicable) unchanged. The switches are designated A to H, as labeled on the
front of the switch matrix (not all switches are available on all models).
Applies To
Model
USB-xSPDT-A18
RC-xSPDT-A18
Serial Numbers
All serial numbers
All serial numbers
Parameters
Data Type
String
Short
Variable
Description
SwitchName Required. String consisting of a single letter from “A” to “H”,
designating the specific SPDT switch is to operate.
Val
Required. An integer value to set the switch state, 0 for “Com
to port 1” or 1 for “Com to port 2.”
Return Values
Data Type
Short
Value
0
1
2
Description
Command failed
Command completed successfully
Command failed (communication successful but 24V DC
supply is disconnected). This return value is not applicable to
all models (see “Applies To” table for Get 24V DC Supply
Status).
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 17
4-Dec-15 (A4)
Examples
Visual Basic
SwName = "B"
' Set switch "B" state to "Com to port 2"
SwState = 1
Status = MyPTE1.Set_Switch(SwName, SwState)
Visual C++
SwName = "B"; // Set switch "B" state to "Com to port 2"
SwState = 1;
Status = MyPTE1->Set_Switch(SwName, SwState);
Visual C#
SwName = "B"; // Set switch "B" state to "Com to port 2"
SwState = 1;
Status = MyPTE1.Set_Switch(ref(SwName), ref(SwState));
Matlab
[status,SwitchName]=MyPTE1.Set_Switch('B',1)
% Set switch "B" state to “Com to port 2”
See Also
Get Switch Status
Set All SPDT Switches
Set Dual SP4T Switch – Both Switches
Set Dual SP6T Switch – Both Switches
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 18
4-Dec-15 (A4)
2.4 (g) - Set All SPDT Switches
Declaration
Short Set_SwitchesPort(Byte Val)
Description
Sets all SPDT switches in a switch matrix simultaneously.
Applies To
Model
USB-xSPDT-A18
RC-xSPDT-A18
Serial Numbers
All serial numbers
All serial numbers
Parameters
Data Type
Byte
Variable
Val
Description
Required. Each bit corresponds to a single switch, with the
LSB to switch “A” and the MSB to switch “H” (if applicable).
Each bit can be 0 (Com to port 1) or 1 (Com to port 2).
For example:
Val=5 (binary 00000101) sets switches “A” and “C” for Com to
port 2 and all other switches (if applicable) for Com to port 1.
Value
0
1
2
Description
Command failed
Command completed successfully
Command failed (communication successful but 24V DC
supply is disconnected). This return value is not applicable to
all models (see “Applies To” table for Get 24V DC Supply
Status).
Return Values
Data Type
Short
Examples
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 19
4-Dec-15 (A4)
Visual Basic
Status = MyPTE1.Set_SwitchesPort(5)
' Set switches B and C to “Com connected to port 2”
' Set all other available switches to “Com connected to port 1”
Visual C++
Status = MyPTE1->Set_SwitchesPort(5);
// Set switches B and C to “Com connected to port 2”
// Set all other available switches to “Com connected to port 1”
Visual C#
Status = MyPTE1.Set_SwitchesPort(5);
// Set switches B and C to “Com connected to port 2”
// Set all other available switches to “Com connected to port 1”
Matlab
MyPTE1.Set_SwitchesPort(char(5))
% Set switches B and C to “Com connected to port 2”
% Set all other available switches to “Com connected to port 1”
See Also
Get Switch Status
Set Individual SPDT Switch
Set Dual SP4T Switch – Both Switches
Set Dual SP6T Switch – Both Switches
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 20
4-Dec-15 (A4)
2.4 (h) - Set Single SP4T Switch
Declaration
Short Set_SP4T_COM_To(Byte Port)
Description
Sets the state of the SP4T switch, connecting the Com (common) port to one of ports 1, 2, 3
or 4; or disconnecting all ports.
Applies To
Model
USB-1SP4T-A18
RC-xSP4T-A18
Serial Numbers
All serial numbers
All serial numbers
For the RC-2SP4T-A18 dual SP4T switch box, this function will only set switch A.
Parameters
Data Type
Byte
Variable
Port
Description
Required. Byte value corresponding to the SP4T switch
connection to be made. The 5 options for are:
0 = All ports disconnected
1 = Com connected to port 1
2 = Com connected to port 2
3 = Com connected to port 3
4 = Com connected to port 4
Value
0
1
2
Description
Command failed or invalid switch state requested
Command completed successfully
Command failed (communication successful but 24V DC
supply is disconnected). This return value is not applicable to
all models (see “Applies To” table for Get 24V DC Supply
Status).
Return Values
Data Type
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 21
4-Dec-15 (A4)
Examples
Visual Basic
Status = MyPTE1. Set_SP4T_COM_To (3)
' connect COM to port 3
Visual C++
Status = MyPTE1->Set_SP4T_COM_To(3);
// connect COM to port 3
Visual C#
Status = MyPTE1.Set_SP4T_COM_To(3);
// connect COM to port 3
Matlab
MyPTE1.Set_SP4T_COM_To(3)
% connect COM to port 3
See Also
Get Switch Status
Get SP4T Switch State
Set Dual SP4T Switch – Both Switches
Set Dual SP4T – Switch A
Set Dual SP4T – Switch B
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 22
4-Dec-15 (A4)
2.4 (i) - Set Dual SP4T Switch – Both Switches
Declaration
Short Set_2SP4T_COM_To(Short P1, Short P2)
Description
Simultaneously sets the state of both SP4T switches within the dual SP4T switch box. Each
switch’s Com (common) port can be connected to one of ports 1, 2, 3 or 4; or disconnected
from all ports.
Applies To
Model
RC-2SP4T-A18
Serial Numbers
All serial numbers
Parameters
Data Type
Short
Variable
P1
Short
P2
Description
Required. Byte value specifying the connection to be made
for switch A. The 5 options for are:
0 = All ports disconnected
1 = Com connected to port 1
2 = Com connected to port 2
3 = Com connected to port 3
4 = Com connected to port 4
Required. Byte value specifying the connection to be made
for switch B. The 5 options for are:
0 = All ports disconnected
1 = Com connected to port 1
2 = Com connected to port 2
3 = Com connected to port 3
4 = Com connected to port 4
Return Values
Data Type
Short
Value
0
1
Description
Command failed or invalid switch state requested
Command completed successfully
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 23
4-Dec-15 (A4)
Examples
Visual Basic
Status = MyPTE1.Set_2SP4T_COM_To (3, 0)
' set switch A COM to port 3 and switch B all ports disconnected
Visual C++
Status = MyPTE1->Set_2SP4T_COM_To(3, 0);
// set switch A COM to port 3 and switch B all ports disconnected
Visual C#
Status = MyPTE1.Set_2SP4T_COM_To(3, 0);
// set switch A COM to port 3 and switch B all ports disconnected
Matlab
MyPTE1.Set_2SP4T_COM_To(3, 0)
% set switch A COM to port 3 and switch B all ports disconnected
See Also
Set Dual SP4T – Switch A
Set Dual SP4T – Switch B
Get Dual SP4T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 24
4-Dec-15 (A4)
2.4 (j) - Set Dual SP4T – Switch A
Declaration
Short Set_2SP4T_COMA_To(Short P1)
Description
Sets the state of switch A within the dual SP4T, leaving switch B unchanged. Switch A can
have Com (common) port connected to one of ports 1, 2, 3 or 4; or disconnected from all
ports. This function can also be used to set the state of the single SP4T switch in USB-1SP4TA18 or RC-1SP4T-A18.
Applies To
Model
RC-2SP4T-A18
Serial Numbers
All serial numbers
Parameters
Data Type
Short
Variable
P1
Description
Required. Byte value specifying the connection to be made
for switch A. The 5 options for are:
0 = All ports disconnected
1 = Com connected to port 1
2 = Com connected to port 2
3 = Com connected to port 3
4 = Com connected to port 4
Value
0
1
Description
Command failed or invalid switch state requested
Command completed successfully
Return Values
Data Type
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 25
4-Dec-15 (A4)
Examples
Visual Basic
Status = MyPTE1.Set_2SP4T_COMA_To (3)
' set switch A COM to port 3
Visual C++
Status = MyPTE1->Set_2SP4T_COMA_To(3);
// set switch A COM to port 3
Visual C#
Status = MyPTE1.Set_2SP4T_COMA_To(3);
// set switch A COM to port 3
Matlab
MyPTE1.Set_2SP4T_COMA_To(3)
% set switch A COM to port 3
See Also
Set Dual SP4T Switch – Both Switches
Set Dual SP4T – Switch B
Get Dual SP4T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 26
4-Dec-15 (A4)
2.4 (k) - Set Dual SP4T – Switch B
Declaration
Short Set_2SP4T_COMB_To(Short P1)
Description
Sets the state of switch B within the dual SP4T, leaving switch A unchanged. Switch B can
have Com (common) port connected to one of ports 1, 2, 3 or 4; or disconnected from all
ports.
Applies To
Model
RC-2SP4T-A18
Serial Numbers
All serial numbers
Parameters
Data Type
Short
Variable
P1
Description
Required. Byte value specifying the connection to be made
for switch B. The 5 options for are:
0 = All ports disconnected
1 = Com connected to port 1
2 = Com connected to port 2
3 = Com connected to port 3
4 = Com connected to port 4
Value
0
1
Description
Command failed or invalid switch state requested
Command completed successfully
Return Values
Data Type
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 27
4-Dec-15 (A4)
Examples
Visual Basic
Status = MyPTE1.Set_2SP4T_COMB_To (3)
' set switch B COM to port 3
Visual C++
Status = MyPTE1->Set_2SP4T_COMB_To(3);
// set switch B COM to port 3
Visual C#
Status = MyPTE1.Set_2SP4T_COMB_To(3);
// set switch B COM to port 3
Matlab
MyPTE1.Set_2SP4T_COMB_To(3)
% set switch B COM to port 3
See Also
Set Dual SP4T Switch – Both Switches
Set Dual SP4T – Switch A
Get Dual SP4T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 28
4-Dec-15 (A4)
2.4 (l) - Set SP6T Switch
Declaration
Short Set_2SP6T_COM_To(Short P1, Short P2)
Description
Simultaneously sets the state of both SP6T switches within the dual SP6T switch box. The
Com (common) port of each switch can be connected to one of ports 1 to 6; or be
disconnected from all ports.
Applies To
Model
RC-2SP6T-A18
Serial Numbers
All serial numbers
Parameters
Data Type
Short
Variable
P1
Short
P2
Description
Required. Byte value specifying the connection to be made
for switch A. The 7 options for are:
0 = All ports disconnected
1 = Com connected to port 1
2 = Com connected to port 2
3 = Com connected to port 3
4 = Com connected to port 4
5 = Com connected to port 5
6 = Com connected to port 6
Required. Byte value specifying the connection to be made
for switch B. The 7 options for are:
0 = All ports disconnected
1 = Com connected to port 1
2 = Com connected to port 2
3 = Com connected to port 3
4 = Com connected to port 4
5 = Com connected to port 5
6 = Com connected to port 6
Return Values
Data Type
Short
Value
0
1
Description
Command failed or invalid switch state requested
Command completed successfully
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 29
4-Dec-15 (A4)
Examples
Visual Basic
Status = MyPTE1.Set_2SP6T_COM_To (6, 2)
' set switch A COM to port 6 and switch B COM to port 2
Visual C++
Status = MyPTE1->Set_2SP6T_COM_To(6, 2);
// set switch A COM to port 6 and switch B COM to port 2
Visual C#
Status = MyPTE1.Set_2SP6T_COM_To(6, 2);
// set switch A COM to port 6 and switch B COM to port 2
Matlab
MyPTE1.Set_2SP6T_COM_To(6, 2)
% set switch A COM to port 6 and switch B COM to port 2
See Also
Set Dual SP6T – Switch A
Set Dual SP6T – Switch B
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 30
4-Dec-15 (A4)
2.4 (m) - Set Dual SP6T – Switch A
Declaration
Short Set_2SP6T_COMA_To(Short P1)
Description
Sets the state of switch A within the dual SP6T, leaving switch B unchanged. Switch A can
have Com (common) port connected to one of ports 1 to 6; or be disconnected from all
ports.
Applies To
Model
RC-2SP6T-A18
Serial Numbers
All serial numbers
Parameters
Data Type
Short
Variable
P1
Description
Required. Byte value specifying the connection to be made
for switch A. The 7 options for are:
0 = All ports disconnected
1 = Com connected to port 1
2 = Com connected to port 2
3 = Com connected to port 3
4 = Com connected to port 4
5 = Com connected to port 5
6 = Com connected to port 6
Value
0
1
Description
Command failed or invalid switch state requested
Command completed successfully
Return Values
Data Type
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 31
4-Dec-15 (A4)
Examples
Visual Basic
Status = MyPTE1.Set_2SP6T_COMA_To (3)
' set switch A COM to port 3
Visual C++
Status = MyPTE1->Set_2SP6T_COMA_To(3);
// set switch A COM to port 3
Visual C#
Status = MyPTE1.Set_2SP6T_COMA_To(3);
// set switch A COM to port 3
Matlab
MyPTE1.Set_2SP6T_COMA_To(3)
% set switch A COM to port 3
See Also
Set SP6T Switch
Set Dual SP6T – Switch B
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 32
4-Dec-15 (A4)
2.4 (n) - Set Dual SP6T – Switch B
Declaration
Short Set_2SP6T_COMB_To(Short P1)
Description
Sets the state of switch B within the dual SP6T, leaving switch A unchanged. Switch B can
have Com (common) port connected to one of ports 1, 2, 3 or 4; or disconnected from all
ports.
Applies To
Model
RC-2SP6T-A18
Serial Numbers
All serial numbers
Parameters
Data Type
Short
Variable
P1
Description
Required. Byte value specifying the connection to be made
for switch B. The 7 options for are:
0 = All ports disconnected
1 = Com connected to port 1
2 = Com connected to port 2
3 = Com connected to port 3
4 = Com connected to port 4
5 = Com connected to port 5
6 = Com connected to port 6
Value
0
1
Description
Command failed or invalid switch state requested
Command completed successfully
Return Values
Data Type
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 33
4-Dec-15 (A4)
Examples
Visual Basic
Status = MyPTE1.Set_2SP6T_COMB_To (3)
' set switch B COM to port 3
Visual C++
Status = MyPTE1->Set_2SP6T_COMB_To(3);
// set switch B COM to port 3
Visual C#
Status = MyPTE1.Set_2SP6T_COMB_To(3);
// set switch B COM to port 3
Matlab
MyPTE1.Set_2SP6T_COMB_To(3)
% set switch B COM to port 3
See Also
Set SP6T Switch
Set Dual SP6T – Switch A
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 34
4-Dec-15 (A4)
2.4 (o) - Get Switch States
Declaration
Short GetSwitchesStatus(Short StatusRet)
Description
Returns the states of all switches in the switch matrix. The indicated status differs between
switch type (SPDT or SP4T), see explanations below.
Applies To
Model
USB-xSPDT-A18
RC-xSPDT-A18
USB-1SP4T-A18
RC-xSP4T-A18
Serial Numbers
All serial numbers
All serial numbers
All serial numbers
All serial numbers
Parameters (SPDT Switch Boxes)
Data Type
Short
Variable
StatusRet
Description
Required. A user defined variable that will be updated with the
current status. The integer should be interpreted by the user as
binary with the LSB representing the state of switch A, the next
bit representing the state of switch B (if applicable) and so on.
Each bit will be either 0 (COM connected to port 1) or 1 (COM
connected to port 2). Any bits representing switches that are
not available in the current model will be 0.
For example:
1) StatusRet = 12
2) Convert to binary string = 00001100
3) Bits 3 (switch C) and 4 (switch D) = 1, all others = 0
Therefore:
Switch A = 0 (COM connected to port 1)
Switch B = 0 (COM connected to port 1)
Switch C = 1 (COM connected to port 2)
Switch D = 1 (COM connected to port 2)
All other switches (if applicable) = 0 (COM connected to port 1)
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 35
4-Dec-15 (A4)
Parameters (SP4T Switch Boxes)
Data Type
Short
Variable
StatusRet
Description
Required. An integer variable that will be updated with the
current status. The integer should be represented as a binary
value, where the 4 LSB (least significant bits) correspond to
switch A. For USB-2SP4T-A18 (dual SP4T switch) only, the 4
MSB (most significant bits) correspond to switch B.
Switch A (all models):
If Bits 0 to 3 = 0, switch A has all ports disconnected
If Bit 0 = 1, switch A has Com connected to port 1
If Bit 1 = 1, switch A has Com connected to port 2
If Bit 2 = 1, switch A has Com connected to port 3
If Bit 3 = 1, switch A has Com connected to port 4
Switch B (dual SP4T switch boxes only):
If Bits 4 to 7 = 0, switch B has all ports disconnected
If Bit 4 = 1, switch B has Com connected to port 1
If Bit 5 = 1, switch B has Com connected to port 2
If Bit 6 = 1, switch B has Com connected to port 3
If Bit 7 = 1, switch B has Com connected to port 4
Return Values (All Models)
Data Type
Short
Value
0
1
Description
Command failed
Command completed successfully
Examples (USB-xSPDT-A18)
Visual Basic
If MyPTE1.GetSwitchesStatus(PortStatus) = 1 Then
' Convert integer PortStatus to binary string
' Use each bit to represent switch states
End if
Visual C++
if (MyPTE1->GetSwitchesStatus(PortStatus) == 1)
{
// Convert integer PortStatus to binary string
// Use each bit to represent switch states
}
Visual C#
if (MyPTE1.GetSwitchesStatus(ref(PortStatus)) == 1)
{
// Convert integer PortStatus to binary string
// Use each bit to represent switch states
}
Matlab
[status,PortStatus]=MyPTE1.GetSwitchesStatus(tmp)
If status == 1 then
{
% Convert integer PortStatus to binary string
% Use each bit to represent switch states
}
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 36
4-Dec-15 (A4)
Examples (USB-1SP4T-A18)
Visual Basic
If MyPTE1.GetSwitchesStatus(PortStatus)
Select Case PortStatus
Case 0
' switch is disconnected
Case 1
' switch connected, com to port
Case 2
' switch connected, com to port
Case 4
' switch connected, com to port
Case 8
' switch connected, com to port
End Select
End if
= 1 Then
1
2
3
4
Visual C++
if (MyPTE1->GetSwitchesStatus(PortStatus) == 1)
{
switch(PortStatus){
case 0:
// switch is disconnected
case 1:
// switch connected, com to
case 2:
// switch connected, com to
case 4:
// switch connected, com to
case 8:
// switch connected, com to
}
}
port 1
port 2
port 3
port 4
Visual C#
if (MyPTE1.GetSwitchesStatus(ref(PortStatus))==1)
{
switch(PortStatus)
{
case 0:
// switch is disconnected
case 1:
// switch connected, com to
case 2:
// switch connected, com to
case 4:
// switch connected, com to
case 8:
// switch connected, com to
}
}
port 1
port 2
port 3
port 4
Matlab
[status,PortStatus]=MyPTE1.GetSwitchesStatus(tmp)
If status == 1 then
{
switch PortStatus
case 0
% switch is disconnected
case 1
% switch connected, com to port
case 2
% switch connected, com to port
case 4
% switch connected, com to port
case 8
% switch connected, com to port
end
}
Portable Test Equipment Programming Manual
RF Switch Matrices
1
2
3
4
Page 37
4-Dec-15 (A4)
See Also
Set Individual Switch
Set All Switches
Set Single SP4T Switch
Set SP6T Switch
Get Dual SP4T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 38
4-Dec-15 (A4)
2.4 (p) - Get SP4T Switch State
Declaration
Short Get_2SP4T_State(String sw)
Description
Returns the state of an SP4T switch box.
Applies To
Model
USB-1SP4T-A18
RC-xSP4T-A18
Serial Numbers
All serial numbers
All serial numbers
Parameters
Data Type
String
Variable
sw
Description
Required. String to indicate which SP4T switch state to
return, either “A” or “B”.
Value
-1
0
1
2
3
4
Description
Command failed
Switch has all ports disconnected
Switch has Com port connected to port 1
Switch has Com port connected to port 2
Switch has Com port connected to port 3
Switch has Com port connected to port 4
Return Values
Data Type
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 39
4-Dec-15 (A4)
Examples
Visual Basic
SwState = MyPTE1.Get_2SP4T_State('A')
If SwState > -1 Then
MsgBox ('Switch A state is Com to port ' & SwState)
End if
Visual C++
SwState = MyPTE1->Get_2SP4T_State('A');
if (SwState > -1)
{
MessageBox::Show("Switch A state is Com to port " + SwState);
}
Visual C#
SwState = MyPTE1.Get_2SP4T_State('A');
if (SwState > -1)
{
MessageBox.Show("Switch A state is Com to port " + SwState);
}
Matlab
[SwState] = MyPTE1.Get_2SP4T_State('A')
If SwState > -1 then
{
MsgBox ('Switch A state is Com to port ', SwState)
}
See Also
Set SP6T Switch
Set Dual SP4T – Switch A
Set Dual SP4T – Switch B
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 40
4-Dec-15 (A4)
2.4 (q) - Get SP6T Switch State
Declaration
Short Get_2SP6T_State(String sw)
Description
Returns the state of an SP6T switch box.
Applies To
Model
RC-2SP6T-A18
Serial Numbers
All serial numbers
Parameters
Data Type
String
Variable
sw
Description
Required. String to indicate which SP6T switch state to
return, either “A” or “B”.
Value
-1
0
1
2
3
4
5
6
Description
Command failed
Switch has all ports disconnected
Switch has Com port connected to port 1
Switch has Com port connected to port 2
Switch has Com port connected to port 3
Switch has Com port connected to port 4
Switch has Com port connected to port 5
Switch has Com port connected to port 6
Return Values
Data Type
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 41
4-Dec-15 (A4)
Examples
Visual Basic
SwState = MyPTE1.Get_2SP6T_State('A')
If SwState > -1 Then
MsgBox ('Switch A state is Com to port ' & SwState)
End if
Visual C++
SwState = MyPTE1->Get_2SP6T_State('A');
if (SwState > -1)
{
MessageBox::Show("Switch A state is Com to port " + SwState);
}
Visual C#
SwState = MyPTE1.Get_2SP6T_State('A');
if (SwState > -1)
{
MessageBox.Show("Switch A state is Com to port " + SwState);
}
Matlab
[SwState] = MyPTE1.Get_2SP6T_State('A')
If SwState > -1 then
{
MsgBox ('Switch A state is Com to port ', SwState)
}
See Also
Set SP6T Switch
Set Dual SP6T – Switch A
Set Dual SP6T – Switch B
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 42
4-Dec-15 (A4)
2.4 (r) - Set Address of Switch Matrix
Declaration
Short Set_Address(Short Address)
Description
This function allows the internal address of the connected switch matrix to be changed from
the factory default of 255. The switch matrix can be referred to by the address instead of the
serial number (see Connect to Switch Matrix by Address).
Parameters
Data Type
Short
Variable
Address
Description
Required. An integer value from 1 to 255
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
Short
Example
Visual Basic
status = MyPTE1.Set_Address(1)
Visual C++
status = MyPTE1->Set_Address(1);
Visual C#
status = MyPTE1.Set_Address(1);
Matlab
status = MyPTE1.Set_Address(1)
See Also
Connect to Switch Matrix by Address
Get Address of Switch Matrix
Get List of Available Addresses
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 43
4-Dec-15 (A4)
2.4 (s) - Get Address of Switch Matrix
Declaration
Short Get_Address()
Description
This function returns the address of the connected switch matrix.
Parameters
Data Type
None
Variable
Description
Value
0
1-255
Description
Command failed
Address of the switch matrix
Return Values
Data Type
Short
Short
Examples
Visual Basic
addr = MyPTE1.Get_Address()
Visual C++
addr = MyPTE1->Get_Address();
Visual C#
addr = MyPTE1.Get_Address();
Matlab
addr = MyPTE1.Get_Address
See Also
Connect to Switch Matrix by Address
Set Address of Switch Matrix
Get List of Available Addresses
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 44
4-Dec-15 (A4)
2.4 (t) - Get List of Connected Serial Numbers
Declaration
Short Get_Available_SN_List(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) switch matrices.
Parameters
Data Type
String
Variable
SN_List
Description
Required. String variable which will be updated with a list of
all available serial numbers, separated by a single space
character; for example “11301020001 11301020002
11301020003”.
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
Short
Short
Example
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
Connect to Switch Matrix
Get List of Available Addresses
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 45
4-Dec-15 (A4)
2.4 (u) - Get List of Available Addresses
Declaration
Short Get_Available_Address_List(String Add_List)
Description
This function takes a user defined variable and updates it with a list of addresses of all
connected switch matrices.
Parameters
Data Type
String
Variable
Add_List
Description
Required. String variable which the function will update with
a list of addresses separated by a single space character, for
example, “5 101 254 255”
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
Short
Short
Example
Visual Basic
If MyPTE1.Get_Available_Add_List(st_Ad_List) > 0 Then
' Get list of available addresses
array_Ad() = Split(st_Ad_List, " ")
' Split the list into an array of addresses
For i As Integer = 0 To array_Ad.Length - 1
' Loop through the array and use each address
Next
End If
Visual C++
if (MyPTE1->Get_Available_Address_List(Add_List) > 0);
{
// split the List into array of Addresses
}
Visual C#
if (MyPTE1.Get_Available_Address_List(ref(Add_List)) > 0)
{
// split the List into array of Addresses
}
Matlab
[status, Add_List]= MyPTE1.Get_Available_Address_List(Add_List)
If status > 0 then
{
% split the List into array of Addresses
}
See Also
Connect to Switch Matrix by Address
Get List of Connected Serial Numbers
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 46
4-Dec-15 (A4)
2.4 (v) - Get Switch Counter
Declaration
Long GetSwitchCounter(String Sw)
Description
Returns the number of switching cycles undertaken by an individual switch (specified by the
user) within an SPDT switch box.
Applies To
Model
USB-1SPDT-A18
USB-2SPDT-A18
USB-3SPDT-A18
USB-4SPDT-A18
USB-8SPDT-A18
RC-1SPDT-A18
RC-2SPDT-A18
RC-3SPDT-A18
RC-4SPDT-A18
RC-8SPDT-A18
Serial Numbers
From 11309160001 (firmware version C3 required)
From 11311270010 (firmware version C3 required)
From 11310100001 (firmware version C3 required)
From 11310100009 (firmware version C3 required)
From 11309290001 (firmware version C3 required)
All serial numbers
All serial numbers
All serial numbers
All serial numbers
All serial numbers
Parameters
Data Type
String
Variable
Sw
Description
Required. The switch name, from “A” to “H” (model
dependent), designating the specific switch to monitor.
Value
-1
Count
Description
Command failed
The number of switch cycles for the specified switch
Return Values
Data Type
Short
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 47
4-Dec-15 (A4)
Examples
Visual Basic
SwCount = MyPTE1.GetSwitchCounter("B")
MsgBox(SwCount & " switch cycles.")
Visual C++
SwCount = MyPTE1->GetSwitchCounter("B");
MessageBox::Show(SwCount + " switch cycles.");
Visual C#
SwCount = MyPTE1.GetSwitchCounter("B");
MessageBox.Show(SwCount + " switch cycles.");
Matlab
[SwCount] = MyPTE1.GetSwitchCounter("B")
msgbox(SwCount, ' switch cycles.')
See Also
Get All Switch Counters
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 48
4-Dec-15 (A4)
2.4 (w) - Get All Switch Counters
Declaration
Short GetAllSwitchCounters(Long Swc[])
Description
Returns the number of switching cycles undertaken by each individual switch within an SPDT
switch box. For SP4T switches, the return indicates the number of times that the Com port
has connected to each of the 4 input/output ports.
Applies To
Model
USB-1SPDT-A18
USB-2SPDT-A18
USB-3SPDT-A18
USB-4SPDT-A18
USB-8SPDT-A18
USB-1SP4T-A18
USB-2SP4T-A18
RC-1SPDT-A18
RC-2SPDT-A18
RC-3SPDT-A18
RC-4SPDT-A18
RC-8SPDT-A18
RC-1SP4T-A18
RC-2SP4T-A18
Serial Numbers
From 11309160001 (firmware version C3 required)
From 11311270010 (firmware version C3 required)
From 11310100001 (firmware version C3 required)
From 11310100009 (firmware version C3 required)
From 11309290001 (firmware version C3 required)
From 11310100001 (firmware version C3 required)
All serial numbers
All serial numbers
All serial numbers
All serial numbers
All serial numbers
All serial numbers
All serial numbers
All serial numbers
Parameters (SPDT Switch Boxes)
Data Type
Long
Variable
Swc[]
Description
Required. User defined array of 8 elements. This will be
updated with the value of each counter.
Swc[0] = Switch A counter
Swc[1] = Switch B counter (model dependent)
…
Swc[7] = Switch H counter (model dependent)
Any unneeded array elements will have value 0
For example, USB-4SPDT-A18 (consisting of four SPDT
switches) would return the below array if all switches have
been cycled 500 times:
Swc[] = {500, 500, 500, 500, 0, 0, 0, 0}
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 49
4-Dec-15 (A4)
Parameters
Data Type
Long
Variable
Swc[]
Description
Required. User defined array of 8 elements. This will be
updated with the values of each of the counters.
All SP4T models:
Swc[0] = Counter of Switch A Com to port 1 connections
Swc[1] = Counter of Switch A Com to port 2 connections
Swc[2] = Counter of Switch A Com to port 3 connections
Swc[3] = Counter of Switch A Com to port 4 connections
Dual SP4T models only:
Swc[4] = Counter of Switch B Com to port 1 connections
Swc[5] = Counter of Switch B Com to port 2 connections
Swc[6] = Counter of Switch B Com to port 3 connections
Swc[7] = Counter of Switch B Com to port 4 connections
For example, USB-1SP4T-A18 (single SP4T switch) would
return the below array if all 4 input/output ports have been
connected to the Com port 500 times:
Swc[] = {500, 500, 500, 500, 0, 0, 0, 0}
Return Values
Data Type
Short
Short
Value
0
1
Description
Command failed
Command completed successfully
Examples
Visual Basic
status = MyPTE1.GetSwitchCounter(SwCounter)
MsgBox("Switch A: " & SwCounter(0) & " cycles.")
MsgBox("Switch H: " & SwCounter(7) & " cycles.")
Visual C++
status = MyPTE1->GetSwitchCounter(SwCounter);
MessageBox::Show("Switch A: " + SwCounter[0] + " cycles.");
MessageBox::Show("Switch H: " + SwCounter[7] + " cycles.");
Visual C#
status = MyPTE1.GetSwitchCounter(SwCounter[8]);
MessageBox.Show("Switch A: " + SwCounter[0] + " cycles.");
MessageBox.Show("Switch H: " + SwCounter[7] + " cycles.");
Matlab
See Also
Get Switch Counter
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 50
4-Dec-15 (A4)
2.4 (x) - Get Temperature of Switch Matrix
Declaration
Float GetDeviceTemperature(Short TSensor)
Description
This function returns the internal temperature of the switch matrix. There are 1 to 3 internal
sensors that can be polled (model dependent):
 USB-1SPDT-A18 / RC-1SPDT-A18 (1 sensor)
 USB-1SP4T-A18 / RC-1SP4T-A18 (1 sensor)
 USB-2SPDT-A18 / RC-2SPDT-A18 (2 sensors)
 USB-3SPDT-A18 / RC-3SPDT-A18 (2 sensors)
 USB-4SPDT-A18 / RC-4SPDT-A18 (2 sensors)
 USB-8SPDT-A18 / RC-8SPDT-A18 (3 sensors)
 RC-2SP4T-A18 (2 sensors)
Note: Units with serial numbers earlier than 11108010000 may have a different number of
sensors than indicated above.
Parameters
Data Type
Short
Variable
TSensor
Description
Required. Short integer variable (1 to 3) to define which
temperature sensor to read.
Return Values
Data Type
Float
Value
Description
Temperature The device internal temperature in degrees Celsius
Examples
Visual Basic
MsgBox ("Temperature is " & MyPTE1.GetDeviceTemperature(2))
' Display a message box with the device temperature
Visual C++
MessageBox::Show("Temperature is " + MyPTE1->GetDeviceTemperature(2));
// Display a message box with the device temperature
Visual C#
MessageBox.Show("Temperature is " + MyPTE1.GetDeviceTemperature(2));
// Display a message box with the device temperature
Matlab
[temp,status]=MyPTE1.GetDeviceTemperature(2)
Msgbox('Temperature is ', temp)
% Display a message box with the device temperature
See Also
Get Heat Alarm
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 51
4-Dec-15 (A4)
2.4 (y) - Get Heat Alarm
Declaration
Short GetHeatAlarm()
Description
This function returns an alarm notification if any of the internal temperature sensors exceeds
the factory programmed limits (45°C on the PCB or 48°C on the internal switch case).
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
Temperature within normal range
Temperature exceeds specified limit
Return Values
Data Type
Short
Short
Examples
Visual Basic
If MyPTE1.GetHeatAlarm > 0 Then
MsgBox ("Temperature has exceeded specified limit")
' Display a warning message
End If
Visual C++
if (MyPTE1->GetHeatAlarm() > 0 )
{
MessageBox::Show("Temperature has exceeded specified limit");
// Display a warning message
}
Visual C#
if (MyPTE1.GetHeatAlarm() > 0 )
{
MessageBox.Show("Temperature has exceeded specified limit");
// Display a warning message
}
Matlab
alarm = MyPTE1.GetHeatAlarm
If alarm > 0 then
{
Msgbox('Temperature has exceeded specified limit')
% Display a warning message
}
See Also
Get Temperature of Switch Matrix
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 52
4-Dec-15 (A4)
2.4 (z) - Get 24V DC Supply Status (Antiquated)
Declaration
Short Get24V_Indicator()
Description
See Applies To section below. This function checks whether the required 24V DC power
supply is connected. If the DC supply is not connected then all SPDT switches will be in the
“COM connected to port 1” state and all SP4T switches will be in the “disconnected” state.
Applies To
This function is only applicable to the below model and serial number ranges. All subsequent
hardware will only communicate when the 24V DC supply is connected so there is no reason
to perform an additional check.
Model
USB-1SPDT-A18
USB-2SPDT-A18
USB-3SPDT-A18
USB-4SPDT-A18
USB-8SPDT-A18
USB-1SP4T-A18
Serial Numbers
From 11210140015 to 11309160000
From 11010030072 to 11311270000
From 11210140041 to 11403130000
From 11210090035 to 11210090049 and
from 11210170001 to 11310100000
From 11210150051 to 11309290000
All serial numbers up to 11310100000
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
24V DC supply not connected
24V DC supply is connected
Return Values
Data Type
Short
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 53
4-Dec-15 (A4)
Examples
Visual Basic
If MyPTE1.Get24V_Indicator > 0 Then
' 24V supply connected
End If
Visual C++
if (MyPTE1-> Get24V_Indicator() > 0 )
{
// 24V supply connected
}
Visual C#
if (MyPTE1.Get_24V_Indicator() > 0)
{
// 24V supply connected
}
Matlab
dcstatus = MyPTE1.Get24V_Indicator
If dcstatus > 0 then
{
% 24V supply connected
}
See Also
Get Fan Status
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 54
4-Dec-15 (A4)
2.4 (aa) - Get Fan Status
Declaration
Short Get_FAN_Indicator()
Description
This function checks whether the internal fan is currently operating (model dependent).
Applies To
Model
USB-2SPDT-A18
USB-3SPDT-A18
USB-4SPDT-A18
USB-8SPDT-A18
RC-2SPDT-A18
RC-3SPDT-A18
RC-4SPDT-A18
RC-8SPDT-A18
Serial Numbers
From 11108010000
From 11108010000
From 11108010000
From 11108010000
All serial numbers
All serial numbers
All serial numbers
All serial numbers
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
Fan not currently operating
Fan operating
Return Values
Data Type
Short
Short
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 55
4-Dec-15 (A4)
Examples
Visual Basic
If MyPTE1.Get_FAN_Indicator > 0 Then
' Fan is currently operating
End If
Visual C++
if (MyPTE1-> Get_FAN_Indicator() > 0 )
{
// Fan is currently operating
}
Visual C#
if (MyPTE1.Get_FAN_Indicator() > 0)
{
// Fan is currently operating
}
Matlab
fanstatus = MyPTE1.Get_FAN_Indicator
If fanstatus > 0 then
{
% Fan is currently operating
}
See Also
Check Internal Temperature
Get Heat Alarm
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 56
4-Dec-15 (A4)
2.4 (bb) - Get Software Connection Status
Declaration
Short GetConnectionStatus()
Description
This function checks whether there is an open software connection to the switch matrix.
This will be true if the Connect function (or similar) has previously been called.
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
No connection
Switch matrix is connected
Return Values
Data Type
Short
Short
Examples
Visual Basic
Status = MyPTE1.GetConnectionStatus()
Visual C++
Status = MyPTE1->GetConnectionStatus();
Visual C#
Status = MyPTE1.GetConnectionStatus();
Matlab
Status = MyPTE1.GetConnectionStatus()
See Also
Connect to Switch Matrix
Connect to Switch Matrix by Address
Disconnect from Switch Matrix
Get USB Connection Status
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 57
4-Dec-15 (A4)
2.4 (cc) - Get USB Connection Status
Declaration
Short GetUSBConnectionStatus()
Description
This function checks whether the USB connection to the switch matrix is still active.
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
No connection
USB connection to switch matrix is active
Return Values
Data Type
Short
Short
Examples
Visual Basic
If MyPTE1.GetUSBConnectionStatus = 1 Then
' switch matrix is connected
End If
Visual C++
if (MyPTE1->GetUSBConnectionStatus() == 1)
{
// switch matrix is connected
}
Visual C#
if (MyPTE1.GetUSBConnectionStatus() == 1)
{
// switch matrix is connected
}
Matlab
usbstatus = MyPTE1.GetUSBConnectionStatus
If usbstatus == 1 then
{
% switch matrix is connected
}
See Also
Get Software Connection Status
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 58
4-Dec-15 (A4)
2.4 (dd) - Check Connection (Antiquated)
Declaration
Short Check_Connection()
Description
This function is antiquated, GetUSBConnectionStatus should be used instead. The function
checks whether the USB connection to the switch matrix is still active.
Parameters
Data Type
None
Variable
Description
Value
0
1
Description
No connection
USB connection to switch matrix is active
Return Values
Data Type
Short
Short
See Also
Get Software Connection Status
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 59
4-Dec-15 (A4)
2.4 (ee) - Get USB Device Name
Declaration
String GetUSBDeviceName()
Description
This function is for advanced users to identify the USB device name of the switch matrix for
direct communication.
Parameters
Data Type
None
Variable
Description
Value
Name
Description
Device name of the switch matrix
Return Values
Data Type
String
Examples
Visual Basic
usbname = MyPTE1.GetUSBDeviceName()
' Return the USB device name as a string
Visual C++
usbname = MyPTE1->GetUSBDeviceName();
// Return the USB device name as a string
Visual C#
usbname = MyPTE1.GetUSBDeviceName();
// Return the USB device name as a string
Matlab
usbname = MyPTE1.GetUSBDeviceName
% Return the USB device name as a string
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 60
4-Dec-15 (A4)
2.4 (ff) - Get Firmware
Declaration
Short GetExtFirmware(Short A0, Short A1, Short A2, String Firmware)
Description
This function returns the internal firmware version of the switch matrix along with three
reserved variables (for factory use).
Parameters
Data Type
Short
Short
Short
String
Variable
A0
A1
A2
Firmware
Description
Required. User defined variable for factory use only.
Required. User defined variable for factory use only.
Required. User defined variable for factory use only.
Required. User defined variable which will be updated with
the current firmware version, for example “B3”.
Value
0
1
Description
Command failed
Command completed successfully
Return Values
Data Type
Short
Short
Examples
Visual Basic
If MyPTE1.GetExtFirmware(A0, A1, A2, Firmware) > 0 Then
MsgBox ("Firmware version is " & Firmware)
End If
Visual C++
if (MyPTE1->GetExtFirmware(A0, A1, A2, Firmware) > 0 )
{
MessageBox::Show("Firmware version is " + Firmware);
}
Visual C#
if (MyPTE1.GetExtFirmware(ref(A0, A1, A2, Firmware)) > 0 )
{
MessageBox.Show("Firmware version is " + Firmware);
}
Matlab
[status, A0, A1, A2, Firmware]=MyPTE1.GetExtFirmware(A0, A1, A2, Firmware)
If status > 0 then
{
msgbox('Firmware version is ', Firmware)
}
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 61
4-Dec-15 (A4)
2.4 (gg) - Get Firmware Version (Antiquated)
Declaration
Short GetFirmware()
Description
This function is antiquated, GetExtFirmware should be used instead. The function returns a
numeric value corresponding to the internal firmware version of the switch matrix.
Parameters
Data Type
None
Variable
Description
Value
Firmware
Description
Version number of the internal switch matrix firmware
Return Values
Data Type
Short
Examples
Visual Basic
FW = MyPTE1.GetFirmware()
Visual C++
FW = MyPTE1->GetFirmware();
Visual C#
FW = MyPTE1.GetFirmware();
Matlab
FW = MyPTE1.GetFirmware()
See Also
Get Firmware
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 62
4-Dec-15 (A4)
2.5 - DLL Functions for Ethernet Configuration
These functions apply to the Mini-Circuits “RC” series of switch matrix models with an
Ethernet interface (RJ45 connector). The 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 devices are connected via the USB interface.
2.5 (a) - Get Ethernet Configuration
Declaration
Short GetEthernet_CurrentConfig(Int IP1, Int IP2, Int IP3, Int IP4,
Int Mask1, Int Mask2, Int Mask3, Int Mask4,
Int Gateway1, Int Gateway2, Int Gateway3, Int Gateway4)
Description
This function returns the current IP configuration of the connected switch matrix 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
RF Switch Matrices
Page 63
4-Dec-15 (A4)
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
RF Switch Matrices
Page 64
4-Dec-15 (A4)
2.5 (b) - Get IP Address
Declaration
Short GetEthernet_IPAddress(Int b1, Int b2, Int b3, Int b4)
Description
This function returns the current IP address of the connected switch matrix 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
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 65
4-Dec-15 (A4)
Example
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
RF Switch Matrices
Page 66
4-Dec-15 (A4)
2.5 (c) - Get MAC Address
Declaration
Short GetEthernet_MACAddress(Int MAC1, Int MAC2, Int MAC3, Int MAC4,
Int MAC5, Int MAC6)
Description
This function returns the MAC (media access control) address, the physical address, of the
connected switch matrix 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
RF Switch Matrices
Page 67
4-Dec-15 (A4)
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
RF Switch Matrices
Page 68
4-Dec-15 (A4)
2.5 (d) - Get Network Gateway
Declaration
Short GetEthernet_NetworkGateway(Int b1, Int b2, Int b3, Int b4)
Description
This function returns the IP address of the network gateway to which the switch matrix 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
RF Switch Matrices
Page 69
4-Dec-15 (A4)
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
RF Switch Matrices
Page 70
4-Dec-15 (A4)
2.5 (e) - Get Subnet Mask
Declaration
Short GetEthernet_SubNetMask(Int b1, Int b2, Int b3, Int b4)
Description
This function returns the subnet mask used by the network gateway to which the switch
matrix 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
RF Switch Matrices
Page 71
4-Dec-15 (A4)
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
RF Switch Matrices
Page 72
4-Dec-15 (A4)
2.5 (f) - Get TCP/IP Port
Declaration
Short GetEthernet_TCPIPPort(Int port)
Description
This function returns the TCP/IP port used by the switch matrix 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
RF Switch Matrices
Page 73
4-Dec-15 (A4)
2.5 (g) - Get DHCP Status
Declaration
Short GetEthernet_UseDHCP()
Description
This function indicates whether the switch matrix 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
RF Switch Matrices
Page 74
4-Dec-15 (A4)
2.5 (h) - Get Password Status
Declaration
Short GetEthernet_UsePWD()
Description
This function indicates whether the switch matrix 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
RF Switch Matrices
Page 75
4-Dec-15 (A4)
2.5 (i) - Get Password
Declaration
Short GetEthernet_PWD(String Pwd)
Description
This function returns the current password used by the switch matrix 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
RF Switch Matrices
Page 76
4-Dec-15 (A4)
2.5 (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 switch matrix.
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
RF Switch Matrices
Page 77
4-Dec-15 (A4)
2.5 (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 switch matrix 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
RF Switch Matrices
Page 78
4-Dec-15 (A4)
2.5 (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 switch matrix 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
RF Switch Matrices
Page 79
4-Dec-15 (A4)
2.5 (m) - Save TCP/IP Port
Declaration
Short SaveEthernet_TCPIPPort(Int port)
Description
This function sets the TCP/IP port used by the switch matrix 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
RF Switch Matrices
Page 80
4-Dec-15 (A4)
2.5 (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 switch matrix 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
RF Switch Matrices
Page 81
4-Dec-15 (A4)
2.5 (o) - Use Password
Declaration
Short SaveEthernet_UsePWD(Int UsePwd)
Description
This function enables or disables the password requirement for HTTP/Telnet communication
with the switch matrix.
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
RF Switch Matrices
Page 82
4-Dec-15 (A4)
2.5 (p) - Set Password
Declaration
Short SaveEthernet_PWD(String Pwd)
Description
This function sets the password used by the switch matrix for HTTP/Telnet communication.
The password will not affect switch 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
RF Switch Matrices
Page 83
4-Dec-15 (A4)
3 - Operating in a Linux Environment via USB
To open a USB connection to the Mini-Circuits RF switch matrix series, the Vendor ID and
Product ID are required:
 Mini-Circuits Vendor ID: 0x20CE
 Switch Matrix Product ID: 0x22
Communication with the switch matrix 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 switch matrix.
A worked example is included in Appendix C of this document. The example uses the libhid
and libusb libraries to interface with the switch matrix as a USB HID (Human Interface
Device).
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 84
4-Dec-15 (A4)
3.1 - Summary of USB Interrupt Functions
The commands that can be sent to the switch matrix are summarized in the table below and
detailed on the following pages.
Description
Command Code
(Byte 0)
a
Get Device Model Name
40
b
Get Device Serial Number
41
c
Set Single SPDT Switch
1
2
3
4
5
6
7
8
d
Set All SPDT Switches
9
e
Set All SP4T Switches
9
f
Set SP6T Switch
12
g
Get All SPDT Switch States
15
h
Get All SP4T Switch States
15
i
Get SP6T Switch State
13
j
Get Firmware
99
k
Check Internal Temperature
114
115
118
l
Get 24V DC Power Indicator
116
m
Get Heat Alarm
117
n
Get Fan Status
119
o
Get Switch Counter
17
p
Get All Switch Counters
18
Portable Test Equipment Programming Manual
RF Switch Matrices
Comments
Switch
Switch
Switch
Switch
Switch
Switch
Switch
Switch
A
B
C
D
E
F
G
H
Sensor 1
Sensor 2
Sensor 3
Page 85
4-Dec-15 (A4)
3.2 - Description of USB Interrupt Functions
3.2 (a) - Get Device Model Name
Description
Returns the Mini-Circuits part number of the connected switch matrix.
Transmit Array
Byte
0
1 - 63
Data
40
Not significant
Description
Interrupt code for Get Device Model Name
“Don’t care” bytes, can be any value
Data
40
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’ USB-4SPDT-A18 switch matrix (see
Appendix A for conversions between decimal, binary and ASCII characters):
Byte
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Data
40
85
83
42
45
52
83
80
68
84
45
65
49
56
0
Description
Interrupt code for Get Device Model Name
ASCII character code for U
ASCII character code for S
ASCII character code for B
ASCII character code for ASCII character code for 4
ASCII character code for S
ASCII character code for P
ASCII character code for D
ASCII character code for T
ASCII character code for ASCII character code for A
ASCII character code for 1
ASCII character code for 8
Zero value byte to indicate end of string
See Also
Get Device Serial Number
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 86
4-Dec-15 (A4)
3.2 (b) - Get Device Serial Number
Description
Returns the serial number of the connected switch matrix.
Transmit Array
Byte
0
1- 63
Data
41
Not significant
Description
Interrupt code for Get Device Serial Number
“Don’t care” bytes, can be any value
Data
41
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 connected switch box has serial number
1130922011 (see Appendix A for conversions between decimal, binary and ASCII characters):
Byte
0
1
2
3
4
5
6
7
8
9
10
11
Data
41
49
49
51
48
57
50
50
48
49
49
0
Description
Interrupt code for Get Device Serial Number
ASCII character code for 1
ASCII character code for 1
ASCII character code for 3
ASCII character code for 0
ASCII character code for 9
ASCII character code for 2
ASCII character code for 2
ASCII character code for 0
ASCII character code for 1
ASCII character code for 1
Zero value byte to indicate end of string
See Also
Get Device Model Name
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 87
4-Dec-15 (A4)
3.2 (c) - Set Single SPDT Switch
Description
Sets an individual switch within an SPDT switch matrix whilst leaving all other switches (if
applicable) unchanged. The switches are designated A to H, as labeled on the front of the
switch matrix (not all switches are available in all models).
The switch can be set to position 1 (Com port connected to port 2) or position 0 (Com port
connected to port 1).
Applies To
Model
USB-xSPDT-A18
RC-xSPDT-A18
Serial Numbers
All serial numbers
All serial numbers
Transmit Array
Byte
0
Data
1-8
1
Switch State
2-63
Not significant
Description
Interrupt code for Set Single SPDT Switch:
1 = Switch A
2 = Switch B (model dependent)
…
8 = Switch H (model dependent)
Integer value for the switch position to set:
0 = Com port connected to port 1
1 = Com port connected to port 2
“Don’t care” bytes, can be any value
Returned Array
Byte
0
Data
1-8
1-63
Not significant
Portable Test Equipment Programming Manual
RF Switch Matrices
Description
Interrupt code for Set Single SPDT Switch:
1 = Switch A
2 = Switch B (model dependent)
…
8 = Switch H (model dependent)
“Don’t care” bytes, can be any value
Page 88
4-Dec-15 (A4)
Example
The following transmit array will set switch C to position 1 (Com connected to port 2):
Byte
0
1
Data
3
1
Description
Set Switch C
Set switch to state 1 (Com port connected to port 2)
The following transmit array will set switch C to position 0 (Com connected to port 1):
Byte
0
1
Data
3
0
Description
Set Switch C
Set switch to state 0 (Com port connected to port 1)
See Also
Set All SPDT Switches
Set All SP4T Switches
Set SP6T Switch
Get All SPDT Switch States
Get All SP4T Switch States
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 89
4-Dec-15 (A4)
3.2 (d) - Set All SPDT Switches
Description
Sets the states of all switches simultaneously within an SPDT switch box. The common port
(Com) of each switch can be in either position 1 (Com port connected to port 2) or position 0
(Com port connected to port 1).
Applies To
Model
USB-xSPDT-A18
RC-xSPDT-A18
Serial Numbers
All serial numbers
All serial numbers
Transmit Array
Byte
0
1
Data
9
Switch State
2-63
Not significant
Description
Interrupt code for Set All SPDT Switches
Numeric value indicating the required switch states. Each
bit in BYTE1 represents the state of an individual SPDT
switch with value:
0 = Com port connected to port 1
1 = Com port connected to port 2
The least significant bit (LSB) represents switch A and the
most significant bit (MSB) represents switch H (if applicable).
“Don’t care” bytes, can be any value
Data
9
Not significant
Description
Interrupt code for Set All SPDT Switches
“Don’t care” bytes, could be any value
Returned Array
Byte
0
1-63
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 90
4-Dec-15 (A4)
Example 1 (USB-8SPDT-A18 and RC-8SPDT-A18)
USB-8SPDT-A18 and RC-8SPDT-A18 each have 8 SPDT switches available (named A to H).
To set switches A, B and H to state 1 (Com connected to port 2) and all other switches to
state 0 (Com port connected to port 1), BYTE1 would be represented as:
Bit
Switch
Description
Value
Bit 7
(MSB)
H
State
1
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
G
State
0
F
State
0
E
State
0
D
State
0
C
State
0
B
State
1
Bit 0
(LSB)
A
State
1
BYTE1 = 10000011
= decimal 131
The complete transmit array (excluding “don’t care” bytes) would be:
Byte
0
1
Data
9
131
Description
Interrupt code for Set All SPDT Switches
Switch state to set
Example 2 (USB-2SPDT-A18 and RC-2SPDT-A18)
USB-2SPDT-A18 and RC-2SPDT-A18 each have 2 SPDT switches available (named A and B).
To set both switches to state 1 (Com connected to port 2), BYTE1 would be represented as:
Bit
Switch
Description
Value
Bit 7
(MSB)
--Don’t
care
0
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
B
Bit 0
(LSB)
A
State
State
1
1
BYTE1 = 00000011
= decimal 3
The complete transmit array (excluding “don’t care” bytes) would be:
Byte
0
1
Data
9
3
Description
Interrupt code for Set All SPDT Switches
Switch state to set
See Also
Set Single SPDT Switch
Set All SP4T Switches
Set SP6T Switch
Get All SPDT Switch States
Get All SP4T Switch States
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 91
4-Dec-15 (A4)
3.2 (e) - Set All SP4T Switches
Description
Sets the state of all switches simultaneously within an SP4T switch box. The common port
(Com) of each switch can be connected to any one of the input/output ports (ports 1 to 4) or
disconnected from all ports.
Applies To
Model
USB-1SP4T-A18
RC-xSP4T-A18
Serial Numbers
All serial numbers
All serial numbers
Transmit Array
Byte
0
1
Data
Value
Code
9
Switch State
Description
Interrupt code for Set All SP4T Switches
Numeric value indicating the required switch state. Each bit
in BYTE1 corresponds to an input/output port, with the 4
least significant bits (LSB) corresponding to switch A (all
models) and the 4 most significant bits (MSB) corresponding
to switch B (USB-2SP4T-A18/RC-2SP4T-A18 only). Setting
any of these bits to 1 designates that this port should be
connected to the Com port. Setting all bits to 0 disconnects
all ports.
Switch A (all models):
If Bits 0 to 3 = 0, disconnect all ports for switch A
If Bit 0 = 1, connect switch A Com to port 1
If Bit 1 = 1, connect switch A Com to port 2
If Bit 2 = 1, connect switch A Com to port 3
If Bit 3 = 1, connect switch A Com to port 4
2-63
Not significant
Switch B (USB-2SP4T-A18/RC-2SP4T-A18 only):
If Bits 4 to 7 = 0, disconnect all ports for switch B
If Bit 4 = 1, connect switch B Com to port 1
If Bit 5 = 1, connect switch B Com to port 2
If Bit 6 = 1, connect switch B Com to port 3
If Bit 7 = 1, connect switch B Com to port 4
“Don’t care” bytes, can be any value
Returned Array
Byte
Data
Description
0
1
9
Status
2-63
Not significant
Interrupt code for Set All SP4T Switches
1 = Command executed successfully
4 = Switch not set (invalid switch state requested)
“Don’t care” bytes, could be any value
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 92
4-Dec-15 (A4)
Example 1.a (USB-1SP4T-A8/RC-1SP4T-A18)
Bits 4 to 7 refer to switch B which is not applicable for these models, they can therefore take
any value. To set switch A to position 3 (connecting Com port to port 3); BYTE1 could be
represented as:
Bit
Bit 7
(MSB)
Bit 6
Don’t
care
0
Don’t
care
0
Switch
Description
Value
Bit 5
--Don’t
care
0
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
Switch A
Don’t
Port 4 Port 3 Port 2 Port 1
care
0
0
1
0
0
BYTE1 = 00000100
= decimal 4
The complete transmit array would be:
Byte
0
1
Data
9
4
Description
Interrupt code for Set All SP4T Switches
Set switch A to position 3
Example 1.b (USB-1SP4T-A8/RC-1SP4T-A18)
To disconnect all ports, bits 0 to 3 must all be 0 (bits 4 to 7 are still “don’t care”):
Bit 7
(MSB)
Bit
Bit 6
Switch
Description
Value
Bit 5
---
Don’t
care
0
Don’t
care
0
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
Switch A
Don’t
care
0
Don’t
Port 4 Port 3 Port 2 Port 1
care
0
0
0
0
0
BYTE1 = 00000000
= decimal 0
The complete transmit array would be:
Byte
0
1
Data
9
0
Portable Test Equipment Programming Manual
RF Switch Matrices
Description
Interrupt code for Set All SP4T Switches
Disconnect all ports
Page 93
4-Dec-15 (A4)
Example 2.a (USB-2SP4T-A8/RC-2SP4T-A18)
To set switch A to position 2 (connecting Com port to port 2) and switch B to position 4
(connecting Com port to port 4), BYTE1 should be:
Bit 7
(MSB)
Bit
Switch
Description
Value
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 0
(LSB)
Bit 1
Switch B
Switch A
Port 4 Port 3 Port 2 Port 1 Port 4 Port 3 Port 2 Port 1
1
0
0
0
0
0
1
0
BYTE1 = 10000010
= decimal 130
The complete transmit array (excluding “don’t care” bytes) would be:
Byte
0
1
Data
9
130
Description
Interrupt code for Set All SP4T Switches
Set switch A to position 2 and switch B to position 4
Example 2.b (USB-2SP4T-A8/RC-2SP4T-A18)
To disconnect all ports in switch A and set switch B to position 1 (connecting Com port to
port 1), BYTE1 should be:
Bit 7
(MSB)
Bit
Switch
Description
Value
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
Switch B
Switch A
Port 4 Port 3 Port 2 Port 1 Port 4 Port 3 Port 2 Port 1
0
0
0
1
0
0
0
0
BYTE1 = 00010000
= decimal 16
The complete transmit array would be:
Byte
0
1
Data
9
16
Description
Interrupt code for Set All SP4T Switches
Disconnect switch A (all ports) and set switch B to position 1
See Also
Set Single SPDT Switch
Set All SPDT Switches
Set SP6T Switch
Get All SPDT Switch States
Get All SP4T Switch States
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 94
4-Dec-15 (A4)
3.2 (f) - Set SP6T Switch
Description
Sets an individual switch within an SP6T switch matrix. Any other switches present in the
matrix will be left unchanged.
Applies To
Model
RC-2SP6T-A18
Serial Numbers
All serial numbers
Transmit Array
Byte
0
Data
12
1
Switch Number
2
Switch State
3 - 63
Not significant
Description
Interrupt code for Set SP6T Switch
The switch to set:
1 = Switch A
2 = Switch B
The switch state to set:
0 = All ports disconnected
1 = Com to port 1
2 = Com to port 2
3 = Com to port 3
4 = Com to port 4
5 = Com to port 5
6 = Com to port 6
“Don’t care” bytes, can be any value
Returned Array
Byte
0
Data
12
1 - 63
Not significant
Portable Test Equipment Programming Manual
RF Switch Matrices
Description
Interrupt code for Set SP6T Switch
“Don’t care” bytes, can be any value
Page 95
4-Dec-15 (A4)
Example
The following transmit array will set switch A to position 5 (Com connected to port 5):
Byte
0
1
2
Data
12
1
5
Description
Set SP6T Switch
Set switch A
Set switch to state 5 (Com port connected to port 5)
The following transmit array will disconnect all ports in switch B:
Byte
0
1
2
Data
12
2
0
Description
Set SP6T Switch
Set switch B
Disconnect all ports
See Also
Set Single SPDT Switch
Set All SPDT Switches
Set All SP4T Switches
Get All SPDT Switch States
Get All SP4T Switch States
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 96
4-Dec-15 (A4)
3.2 (g) - Get All SPDT Switch States
Description
Returns the state of all switches within an SPDT switch box. The common port (Com) of each
switch can be in position 1 (Com port connected to port 2) or position 0 (Com port connected
to port 1).
Applies To
Model
USB-xSPDT-A18
RC-xSPDT-A18
Serial Numbers
All serial numbers
All serial numbers
Transmit Array
Byte
0
1-63
Data
15
Not significant
Description
Interrupt code for Get All SPDT Switch States
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1
Data
15
Switch State
2-63
Not significant
Description
Interrupt code for Get All SPDT Switch States
Numeric value indicating the switch states. The value should
be interpreted as a byte, with each bit representing the
state of an individual SPDT switch as below:
0 = Com port connected to port 1
1 = Com port connected to port 2
The least significant bit (LSB) represents switch A and the
most significant bit (MSB) represents switch H (if applicable).
“Don’t care” bytes, could be any value
Example 1 (USB-1SPDT-A18/RC-1SPDT-A18)
Byte
0
1
Data
15
1
Description
Interrupt code for Get All SPDT Switch States
Switch states
USB-1SPDT-A18 and RC-1SPDT-A18 have only a single SPDT, named switch A. The above
returned array has BYTE1 = 1 which can be represented as:
Bit
Switch
Description
Value
Bit 7
(MSB)
--Don’t
care
0
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
Bit 0
(LSB)
A
State
1
Bit 0 = 1, therefore switch A is set to position 1 (Com port connected to port2).
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 97
4-Dec-15 (A4)
Example 2 (USB-4SPDT-A18/RC-4SPDT-A18)
Byte
0
1
Data
15
13
Description
Interrupt code for Get All SPDT Switch States
Switch states
USB-4SPDT-A18 and RC-4SPDT-A18 have four SPDT switches, named A to D. The above
returned array has BYTE1 = 13 which can be represented as:
Bit
Switch
Description
Value
Bit 7
(MSB)
--Don’t
care
0
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
D
C
B
Bit 0
(LSB)
A
State
State
State
State
1
1
0
1
Bits 0, 2 and 3 have value 1, therefore switches A, C and D are set to position 1 (Com port
connected to port2).
Bit 1 has value 0, therefore switch B is set to position 0 (Com port connected to port 1).
See Also
Set Single SPDT Switch
Set All SPDT Switches
Set All SP4T Switches
Set SP6T Switch
Get All SP4T Switch States
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 98
4-Dec-15 (A4)
3.2 (h) - Get All SP4T Switch States
Description
Returns the state of all switches within an SP4T switch box. The common port (Com) of each
switch can be in positions 1 to 4, indicating that the common port (Com) is connected to the
respective input/output port, or in position 0 to indicate that the Com port is disconnected
from all input/output ports.
Applies To
Model
USB-1SP4T-A18
RC-xSP4T-A18
Serial Numbers
All serial numbers
All serial numbers
Transmit Array
Byte
0
1-63
Data
15
Not significant
Description
Interrupt code for Get All SP4T Switch States
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1
Data
15
Switch State
Description
Interrupt code for Get All SP4T Switch States
Numeric value indicating the switch states. Each bit in
BYTE1 corresponds to an input/output port, with the 4 least
significant bits (LSB) corresponding to switch A (all models)
and the 4 most significant bits (MSB) corresponding to
switch B (USB-2SP4T-A18/RC-2SP4T-A18 only).
Switch A (all models):
If Bits 0 to 3 = 0, switch A has all ports disconnected
If Bit 0 = 1, switch A has Com connected to port 1
If Bit 1 = 1, switch A has Com connected to port 2
If Bit 2 = 1, switch A has Com connected to port 3
If Bit 3 = 1, switch A has Com connected to port 4
2 - 63
Not significant
Portable Test Equipment Programming Manual
RF Switch Matrices
Switch B (USB-2SP4T-A18/RC-2SP4T-A18 only):
If Bits 4 to 7 = 0, switch B has all ports disconnected
If Bit 4 = 1, switch B has Com connected to port 1
If Bit 5 = 1, switch B has Com connected to port 2
If Bit 6 = 1, switch B has Com connected to port 3
If Bit 7 = 1, switch B has Com connected to port 4
“Don’t care” bytes, can be any value
Page 99
4-Dec-15 (A4)
Example 1 (USB-1SP4T-A18/RC-1SP4T-A18)
Byte
0
1
Data
15
8
Description
Interrupt code for Get All SP4T Switch States
Switch state
USB-1SP4T-A18 and RC-1SP4T-A18 have only a single SP4T, named switch A. The above
returned array has BYTE1 = 8 which can be represented as:
Bit
Bit 7
(MSB)
Bit 6
Don’t
care
0
Don’t
care
0
Switch
Description
Value
Bit 5
--Don’t
care
0
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
Switch A
Don’t
Port 4 Port 3 Port 2 Port 1
care
0
1
0
0
0
Bit 3 = 1, therefore switch A is set to position 4 (Com port connected to port 4).
Example 2 (USB-2SP4T-A18/RC-2SP4T-A18)
Byte
0
1
Data
15
68
Description
Interrupt code for Get All SP4T Switch States
Switch state
USB-4SPDT-A18 and RC-4SPDT-A18 have two SP4T switches, named A and B. The above
returned array has BYTE1 = 68 which can be represented as:
Bit
Switch
Description
Value
Bit 7
(MSB)
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
Switch B
Switch A
Port 4 Port 3 Port 2 Port 1 Port 4 Port 3 Port 2 Port 1
0
1
0
0
0
1
0
0
Bit 2 has value 1, indicating that switch A is in position 3 (Com port connected to port 3).
Bit 6 has value 1, indicating that switch B is also in position 3 (Com port connected to port 3).
See Also
Set Single SPDT Switch
Set All SPDT Switches
Set All SP4T Switches
Set SP6T Switch
Get All SPDT Switch States
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 100
4-Dec-15 (A4)
3.2 (i) - Get SP6T Switch State
Description
Returns the state of a specific switch within an SP6T switch box.
Applies To
Model
RC-2SP6T-A18
Serial Numbers
All serial numbers
Transmit Array
Byte
0
1
Data
13
Switch Number
2 - 63
Not significant
Description
Interrupt code for Get SP6T Switch State
The switch to query:
1 = Switch A
2 = Switch B
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1
Data
13
Switch State
2 - 63
Not significant
Portable Test Equipment Programming Manual
RF Switch Matrices
Description
Interrupt code for Get SP6T Switch State
Numeric value indicating the switch state:
0 = All ports disconnected
1 = Com to port 1
2 = Com to port 2
3 = Com to port 3
4 = Com to port 4
5 = Com to port 5
6 = Com to port 6
“Don’t care” bytes, can be any value
Page 101
4-Dec-15 (A4)
Example
Send the following transmit array to query the state of switch B:
Byte
0
1
Data
13
2
Description
Interrupt code for Get SP6T Switch State
Switch B
The below returned array would indicate switch B has com port connected to port
Byte
0
1
Data
13
6
Description
Interrupt code for Get SP6T Switch State
Com connected to port 6
See Also
Set Single SPDT Switch
Set All SPDT Switches
Set All SP4T Switches
Set SP6T Switch
Get All SPDT Switch States
Get All SP4T Switch States
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 102
4-Dec-15 (A4)
3.2 (j) - Get Firmware
Description
Returns the internal firmware version of the switch box.
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 switch box 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
RF Switch Matrices
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 103
4-Dec-15 (A4)
3.2 (k) - Get Internal Temperature
Description
Returns the internal temperature of the switch matrix in degrees Celsius to 2 decimal places.
There are 1 to 3 internal sensors that can be polled (model dependent):
 USB-1SPDT-A18 / RC-1SPDT-A18 (1 sensor)
 USB-1SP4T-A18 / RC-1SP4T-A18 (1 sensor)
 USB-2SP4T-A18 / RC-2SP4T-A18 (2 sensors)
 USB-2SPDT-A18 / RC-2SPDT-A18 (2 sensors)
 USB-3SPDT-A18 / RC-3SPDT-A18 (2 sensors)
 USB-4SPDT-A18 / RC-4SPDT-A18 (2 sensors)
 USB-8SPDT-A18 / RC-8SPDT-A18 (3 sensors)
Note: Units with serial numbers earlier than 11108010000 may have a different number of
sensors than indicated above.
If a sensor that does not exist is polled (for example there is no sensor 2 on USB-1SPDT-A18)
the temperature returned will work out to “+25.00”.
Transmit Array
Byte
0
Data
114, 115 or 118
1-63
Not significant
Description
Interrupt code for Get Internal Temperature:
114 = Check temperature sensor 1
115 = Check temperature sensor 2 (if available)
118 = Check temperature sensor 3 (if available)
“Don’t care” bytes, can be any value
Returned Array
Byte
0
Data
114, 115 or 118
1
43 or 45
2
Temperature
Digit 1
Temperature
Digit 2
46
Temperature
Decimal Place 1
Temperature
Decimal Place 2
Not significant
3
4
5
6
7-63
Portable Test Equipment Programming Manual
RF Switch Matrices
Description
Interrupt code for Get Internal Temperature:
114 = Check temperature sensor 1
115 = Check temperature sensor 2 (if available)
118 = Check temperature sensor 3 (if available)
ASCII code for the first character of the temperature:
43 = positive (+)
45 = negative (-)
ASCII character code for the first digit of the temperature
reading
ASCII character code for the second digit of the temperature
reading
ASCII character code for the decimal point symbol (“.”)
ASCII character code for the first decimal place of the
temperature reading
ASCII character code for the second decimal place of the
temperature reading
“Don’t care” bytes, can be any value
Page 104
4-Dec-15 (A4)
Example
To check the internal temperature measured by sensor 2, send the following transmit array.
Byte
0
Data
115
Description
Interrupt code for Get Internal Temperature at sensor 2
The below returned array would indicate a temperature of +28.43°C. See Appendix A for
conversions between decimal, binary and ASCII characters.
Byte
0
1
2
3
4
5
6
Data
115
43
50
56
45
52
51
Description
Interrupt code for Get Internal Temperature at sensor 1
ASCII code for the character “+” (positive)
ASCII code for the character “2”
ASCII code for the character “8”
ASCII code for the character “.”
ASCII code for the character “4”
ASCII code for the character “3”
See Also
Get Heat Alarm
Get Fan Status
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 105
4-Dec-15 (A4)
3.2 (l) - Get 24V DC Power Status
Description
See Applies To section below. This function checks whether the required 24V DC power
supply is connected. If the DC supply is not connected then all SPDT switches will be in the
“COM connected to port 1” state and all SP4T switches will be in the “disconnected” state.
Applies To
This function is only applicable to the below model and serial number ranges. All subsequent
hardware will only communicate when the 24V DC supply is connected so there is no reason
to perform an additional check.
Model
USB-1SPDT-A18
USB-2SPDT-A18
USB-3SPDT-A18
USB-4SPDT-A18
USB-8SPDT-A18
USB-1SP4T-A18
Serial Numbers
From 11210140015 to 11309160000
From 11010030072 to 11311270000
From 11210140041 to 11403130000
From 11210090035 to 11210090049 and
from 11210170001 to 11310100000
From 11210150051 to 11309290000
All serial numbers up to 11310100000
Transmit Array
Byte
0
1-63
Data
116
Not required
Description
Interrupt code for Get 24V DC Power Status
“Don’t care” bytes, can be any value
Byte
0
1
Data
116
DC Status
2-63
Not required
Description
Interrupt code for Get 24V DC Power Status
The 24V DC supply status:
0 = 24V supply not present
1 = 24V supply connected
“Don’t care” bytes, could be any value
Returned Array
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 106
4-Dec-15 (A4)
Example
The following return array would indicate the 24V DC supply is not connected:
Byte
0
1
Data
116
0
Description
Interrupt code for Get 24V DC Power Status
24V supply not present
The following return array would indicate the 24V DC supply is connected:
Byte
0
1
Data
116
1
Description
Interrupt code for Get 24V DC Power Status
24V supply connected
See Also
Get Heat Alarm
Get Fan Status
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 107
4-Dec-15 (A4)
3.2 (m) - Get Heat Alarm
Description
Returns an alarm notification if any of the internal temperature sensors exceeds the factory
programmed limits (45°C on the PCB or 48°C on the internal switch case).
Transmit Array
Byte
0
1-63
Data
117
Not required
Description
Interrupt code for Get Heat Alarm
“Don’t care” bytes, can be any value
Byte
0
1
Data
117
Alarm Status
2-63
Not required
Description
Interrupt code for Get Heat Alarm
The heat alarm status:
0 = All temperature sensors are within allowed limits
1 = Temperature exceeds specified limits
“Don’t care” bytes, could be any value
Returned Array
Example
The following return array would indicate the unit is within normal temperature limits:
Byte
0
1
Data
117
0
Description
Interrupt code for Get Heat Alarm
All temperature sensors are within allowed limits
The following return array would indicate the unit has exceeded the internal temperature
limit:
Byte
0
1
Data
117
1
Description
Interrupt code for Get Heat Alarm
Temperature exceeds specified limits
See Also
Get Internal Temperature
Get Fan Status
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 108
4-Dec-15 (A4)
3.2 (n) - Get Fan Status
Description
Indicates whether the internal fan is currently operating.
Applies To
Model
USB-2SPDT-A18
USB-3SPDT-A18
USB-4SPDT-A18
USB-8SPDT-A18
RC-2SPDT-A18
RC-3SPDT-A18
RC-4SPDT-A18
RC-8SPDT-A18
Serial Numbers
From 11108010000
From 11108010000
From 11108010000
From 11108010000
All serial numbers
All serial numbers
All serial numbers
All serial numbers
Transmit Array
Byte
0
1-63
Data
119
Not required
Description
Interrupt code for Get Fan Status
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1
Data
119
Fan Status
2-63
Not required
Description
Interrupt code for Get Fan Status
The fan status:
0 = fan not currently operating
1 = fan operating
“Don’t care” bytes, could be any value
Example
The following return array would indicate the fan is not currently operating:
Byte
0
1
Data
119
0
Description
Interrupt code for Get Fan Status
Fan not currently operating
See Also
Get Internal Temperature
Get Heat Alarm
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 109
4-Dec-15 (A4)
3.2 (o) - Get Switch Counter
Description
Returns the number of switching cycles undertaken by an individual switch (specified by the
user) within an SPDT switch box.
Applies To
Model
USB-1SPDT-A18
USB-2SPDT-A18
USB-3SPDT-A18
USB-4SPDT-A18
USB-8SPDT-A18
RC-xSPDT-A18
Serial Numbers
From 11309160001 (firmware version C3 required)
From 11311270010 (firmware version C3 required)
From 11310100001 (firmware version C3 required)
From 11310100009 (firmware version C3 required)
From 11309290001 (firmware version C3 required)
All serial numbers
Transmit Array
Byte
0
1
Data
17
Switch Name
2-63
Not required
Description
Interrupt code for Get Switch Counter
ASCII character code for the switch name.
For example, switch A = 65, switch B = 66…
“Don’t care” bytes, can be any value
Returned Array
Byte
0
1-4
Data
17
Counter Value
5-63
Not significant
Portable Test Equipment Programming Manual
RF Switch Matrices
Description
Interrupt code for Get Switch Counter
The switch counter value split across 4 bytes. The count is
calculated as:
BYTE1 + (BYTE2*256) + (BYTE3*2562) + (BYTE4*2563)
“Don’t care” bytes, could be any value
Page 110
4-Dec-15 (A4)
Example
To query the counter of switch C, send:
Byte
0
1
Data
17
67
Description
Interrupt code for Get Switch Counter
Query switch C counter (ASCII character code for C = 67)
Calculate the counter value from the below example return array:
Byte
0
1
2
3
4
Data
17
97
132
11
0
Description
Interrupt code for Get Switch Counter
The switch counter value split across 4 bytes, calculated as:
COUNT = 97 + (132*256) + (11*2562) + (0*2563)
= 754,785 cycles
See Also
Get All Switch Counters
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 111
4-Dec-15 (A4)
3.2 (p) - Get All Switch Counters
Description
Returns the number of switching cycles undertaken by each individual switch within an SPDT
switch box. For SP4T switches, the return indicates the number of times that the Com port
has connected to each of the 4 input/output ports.
Applies To
Model
USB-1SPDT-A18
USB-2SPDT-A18
USB-3SPDT-A18
USB-4SPDT-A18
USB-8SPDT-A18
USB-1SP4T-A18
RC-xSPDT-A18
RC-xSP4T-A18
Serial Numbers
From 11309160001 (firmware version C3 required)
From 11311270010 (firmware version C3 required)
From 11310100001 (firmware version C3 required)
From 11310100009 (firmware version C3 required)
From 11309290001 (firmware version C3 required)
From 11310100001 (firmware version C3 required)
All serial numbers
All serial numbers
Transmit Array
Byte
0
1-63
Data
18
Not required
Portable Test Equipment Programming Manual
RF Switch Matrices
Description
Interrupt code for Get All Switch Counters
“Don’t care” bytes, can be any value
Page 112
4-Dec-15 (A4)
Returned Array (SPDT Switch Boxes)
Byte
0
1-4
Data
18
Switch A
Counter Value
5-8
Switch B
Counter Value
9-12
Switch C
Counter Value
13-16
Switch D
Counter Value
17-20
Switch E
Counter Value
21-24
Switch F
Counter Value
25-28
Switch G
Counter Value
29-32
Switch H
Counter Value
33-63
Not significant
Description
Interrupt code for Get All Switch Counters
Switch A counter value split across 4 bytes. The count is
calculated as:
BYTE1 + (BYTE2*256) + (BYTE3*2562) + (BYTE4*2563)
Switch B (if applicable) counter value split across 4 bytes.
The count is calculated as:
BYTE5 + (BYTE6*256) + (BYTE7*2562) + (BYTE8*2563)
Switch C (if applicable) counter value split across 4 bytes.
The count is calculated as:
BYTE9 + (BYTE10*256) + (BYTE11*2562) + (BYTE12*2563)
Switch D (if applicable) counter value split across 4 bytes.
The count is calculated as:
BYTE13 + (BYTE14*256) + (BYTE15*2562) + (BYTE16*2563)
Switch E (if applicable) counter value split across 4 bytes.
The count is calculated as:
BYTE17 + (BYTE18*256) + (BYTE19*2562) + (BYTE20*2563)
Switch F (if applicable) counter value split across 4 bytes.
The count is calculated as:
BYTE21 + (BYTE22*256) + (BYTE23*2562) + (BYTE24*2563)
Switch G (if applicable) counter value split across 4 bytes.
The count is calculated as:
BYTE25 + (BYTE26*256) + (BYTE27*2562) + (BYTE28*2563)
Switch H (if applicable) counter value split across 4 bytes.
The count is calculated as:
BYTE29 + (BYTE30*256) + (BYTE31*2562) + (BYTE32*2563)
“Don’t care” bytes, could be any value
Note: Bytes relating to switches that are not available in the connected hardware become
“don’t care” bytes and will contain arbitrary values. For example, RC-3SPDT-A18 has 3 SPDT
switches, named A to C. Therefore, only bytes 0 to 12 are relevant in the returned array.
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 113
4-Dec-15 (A4)
Returned Array (SP4T Switch Boxes)
Byte
0
1-4
Data
18
Switch A, Port 1
Counter Value
5-8
Switch A, Port 2
Counter Value
9-12
Switch A, Port 3
Counter Value
13-16
Switch A, Port 4
Counter Value
17-20
Switch B, Port 1
Counter Value
21-24
Switch B, Port 2
Counter Value
25-28
Switch B, Port 3
Counter Value
29-32
Switch B, Port 4
Counter Value
33-63
Not significant
Description
Interrupt code for Get All Switch Counters
Counter of Switch A Com to port 1 connections, split across
4 bytes. The count is calculated as:
BYTE1 + (BYTE2*256) + (BYTE3*2562) + (BYTE4*2563)
Counter of Switch A Com to port 2 connections, split across
4 bytes. The count is calculated as:
BYTE5 + (BYTE6*256) + (BYTE7*2562) + (BYTE8*2563)
Counter of Switch A Com to port 3 connections, split across
4 bytes. The count is calculated as:
BYTE9 + (BYTE10*256) + (BYTE11*2562) + (BYTE12*2563)
Counter of Switch A Com to port 4 connections, split across
4 bytes. The count is calculated as:
BYTE13 + (BYTE14*256) + (BYTE15*2562) + (BYTE16*2563)
Counter of Switch B Com to port 1 connections (if
applicable), split across 4 bytes. The count is calculated as:
BYTE17 + (BYTE18*256) + (BYTE19*2562) + (BYTE20*2563)
Counter of Switch B Com to port 2 connections (if
applicable), split across 4 bytes. The count is calculated as:
BYTE21 + (BYTE22*256) + (BYTE23*2562) + (BYTE24*2563)
Counter of Switch B Com to port 3 connections (if
applicable), split across 4 bytes. The count is calculated as:
BYTE25 + (BYTE26*256) + (BYTE27*2562) + (BYTE28*2563)
Counter of Switch B Com to port 4 connections (if
applicable), split across 4 bytes. The count is calculated as:
BYTE29 + (BYTE30*256) + (BYTE31*2562) + (BYTE32*2563)
“Don’t care” bytes, could be any value
Note: Bytes 17 to 32 relating to switch B are only relevant to dual SP4T models. Single SP4T
switches do not have switch B so these bytes become “don’t care” bytes.
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 114
4-Dec-15 (A4)
Example (SPDT Switch Boxes)
The following returned array shows the counter values for RC-3SPDT-A18 (three SPDT switch
box):
Byte
0
1
2
3
4
5
6
7
8
9
10
11
12
Data
18
97
132
11
0
5
15
5
0
111
97
2
1
Description
Interrupt code for Get All Switch Counters
Switch A counter value split across 4 bytes, calculated as:
COUNT = 97 + (132*256) + (11*2562) + (0 * 2563)
= 754,785 cycles
Switch B counter value split across 4 bytes, calculated as:
COUNT = 5 + (15*256) + (5*2562) + (0 * 2563)
= 331,525 cycles
Switch C counter value split across 4 bytes, calculated as:
COUNT = 111 + (97*256) + (2*2562) + (1 * 2563)
= 16,933,231 cycles
Example (SP4T Switch Boxes)
The following returned array shows the counter values for USB-1SP4T-A18 (single SP4T
switch box):
Byte
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Data
18
97
132
11
0
5
15
5
0
111
97
2
1
15
20
3
0
Description
Interrupt code for Get All Switch Counters
Counter of Switch A Com to port 1 connections, split across
4 bytes, calculated as:
COUNT = 97 + (132*256) + (11*2562) + (0 * 2563)
= 754,785 cycles
Counter of Switch A Com to port 1 connections, split across
4 bytes, calculated as:
COUNT = 5 + (15*256) + (5*2562) + (0 * 2563)
= 331,525 cycles
Counter of Switch A Com to port 1 connections, split across
4 bytes, calculated as:
COUNT = 111 + (97*256) + (2*2562) + (1 * 2563)
= 16,933,231 cycles
Counter of Switch A Com to port 1 connections, split across
4 bytes, calculated as:
COUNT = 15 + (20*256) + (3*2562) + (0 * 2563)
= 201,743 cycles
See Also
Get Switch Counter
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 115
4-Dec-15 (A4)
4 - Ethernet Control over IP Networks
The Mini-Circuits “RC” switch matrix models have an additional RJ45 connector option 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
switch matrix devices 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 (the port used for HTTP communication with the network;
default is port)
 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 (the port used for HTTP communication with the network;
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 switch unless the
default port 80 is used
2. Port 23 is reserved for Telnet communication
4.1 - Configuring Ethernet Settings via USB
The switch matrix 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 necessary
functions for configuring the Ethernet settings via USB, please see Description of DLL
Functions for Ethernet Configuration for details.
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 116
4-Dec-15 (A4)
4.2 - Ethernet Communication Methodology
Communication over Ethernet can be accomplished using HTTP Get/Post commands or
Telnet communication. These communication 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.
4.2 (a) - Setting Switch States Using HTTP
The basic format of the HTTP command to set the switch 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 switch
Example 1:
http://192.168.100.100:800/PWD=123;SETA=1
Explanation:
 The switch has IP address 192.168.100.100 and uses port 800
 Password security is enabled and set to “123”
 The command is to set switch A to state 1 (see below for the full explanation of
all commands/queries)
Example 2:
http://10.10.10.10/SETB=0
Explanation:
 The switch has IP address 10.10.10.10 and uses the default port 80
 Password security is disabled
 The command is to set switch B to state 0 (see below for the full explanation of
all commands/queries)
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 117
4-Dec-15 (A4)
4.2 (b) - Querying Switch Properties Using HTTP
The basic format of the HTTP command to query the switch 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 switch
Example 1:
http://192.168.100.100:800/PWD=123;MN?
Explanation:
 The switch 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 switch matrix (see below for the
full explanation of all commands/queries)
Example 2:
http://10.10.10.10/SWPORT?
Explanation:
 The switch has IP address 10.10.10.10 and uses the default port 80
 Password security is disabled
 The query is to return the states of all switches in the switch matrix (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
RF Switch Matrices
Page 118
4-Dec-15 (A4)
4.2 (c) - Communication Using Telnet
Communication with the device is started by creating a Telnet connection to the switch IP
address. On successful connection the “line feed” character will be returned. If the switch
matrix has a password enabled then this must be sent as the first command after connection.
The full list of all 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 switch matrix with IP address 192.168.9.60:
2) The “line feed” character is returned indicating the connection was successful:
3) The password (if enabled) must be sent as the first command:
 The password must be entered in the format PWD=password;
 A return value of 1 indicates success:
4) Any number of commands and queries can be sent as needed:
5) Use the control and "]" keys to end the session.
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 119
4-Dec-15 (A4)
4.3 - Device Discovery Using UDP
In addition to HTTP and Telnet, the RC series of Ethernet controlled switch matrices 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 RC switch matrices
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 switch
matrix 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’ RC switch matrices 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 switch’s IP address is already known it
is not necessary to use UDP.
Transmission
The command MCLRFSWITCH? should be broadcast to the local network using UDP protocol
on port 4950.
Receipt
All Mini-Circuits RC switch matrices 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
RF Switch Matrices
Page 120
4-Dec-15 (A4)
Example
Sent Data:
MCLRFSWITCH?
Received Data:
Model Name: RC-2SPDT-A18
Serial Number: 11302120001
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: RC-2SPDT-A18
Serial Number: 11302120002
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: RC-2SPDT-A18
Serial Number: 11302120003
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
RF Switch Matrices
Page 121
4-Dec-15 (A4)
4.4 - Summary of Ethernet Commands/Queries
The commands that can be sent to the switch matrix are summarized below and described
on the following pages; they apply to both HTTP and Telnet communication.
Description
Command/Query
a
Set Single SPDT Switch
SETA
SETB
SETC
SETD
SETE
SETF
SETG
SETH
b
Set All SPDT Switches
SETP
c
Set Single SP4T Switch
d
Set All SP4T Switches
e
Set SP6T Switch
f
Get All SPDT Switch States
g
Get Single SP4T Switch State
h
Get All SP4T Switch States
i
Get SP6T Switch State
j
Get Model Name
MN?
k
Get Serial Number
SN?
l
Get Internal Temperature
l
Get Heat Alarm
HEATALARM?
n
Get Fan Status
FAN?
o
Get Firmware
Portable Test Equipment Programming Manual
RF Switch Matrices
SP4TA:STATE
SP4TB:STATE
Comments
Switch
Switch
Switch
Switch
Switch
Switch
Switch
Switch
A
B
C
D
E
F
G
H
Switch A
Switch B
SETP
SP6TA:STATE
SP6TB:STATE
Switch A
Switch B
SWPORT?
SP4TA:STATE?
SP4TB:STATE?
Switch A
Switch B
SWPORT?
SP6TA:STATE?
SP6TB:STATE?
TEMP1?
TEMP2?
TEMP3?
Switch A
Switch B
Sensor 1
Sensor 2
Sensor 3
FIRMWARE?
Page 122
4-Dec-15 (A4)
4.5 - Description of Ethernet Commands/Queries
4.5 (a) - Set Single SPDT Switch
Description
Sets an individual switch within an SPDT switch matrix whilst leaving all other switches (if
applicable) unchanged.
Applies To
Model
RC-xSPDT-A18
Serial Numbers
All serial numbers
Command
SET[switch]=[state]
Parameter Description
[switch] The individual switch (A-H) to be controlled. For example:
SETA sets switch A
SETB sets switch B
[state]
The state (0 or 1) into which the switch should be set:
0 - Connect Com port to port 1
1 - Connect Com port to port 2
Return Value
Value
0
1
Description
Command failed
Command completed successfully
Examples
Set switch A to state 1 (Com port connected to port 2):
SETA=1
Set switch C to state 0 (Com port connected to port 1):
SETC=0
See Also
Set All SPDT Switches
Set All SP4T Switches
Set SP6T Switch
Get SPDT Switch States
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 123
4-Dec-15 (A4)
4.5 (b) - Set All SPDT Switches
Description
Sets the states of all switches simultaneously within an SPDT switch box.
Applies To
Model
RC-xSPDT-A18
Serial Numbers
All serial numbers
Command
SETP=[states]
Parameter Description
[states] Integer value of a byte that represents the switch states. Each bit in
the byte represents the state of an individual SPDT switch with value:
0 = Com port connected to port 1
1 = Com port connected to port 2
The least significant bit (LSB) represents switch A and the most
significant bit (MSB) represents switch H (if applicable).
Return Value
Value
0
1
Description
Command failed
Command completed successfully
Example 1 (RC-8SPDT-A18)
RC-8SPDT-A18 has 8 SPDT switches available (named A to H).
To set switches A, B and H to state 1 (Com connected to port 2) and all other switches to
state 0 (Com port connected to port 1), the byte can be represented as:
Bit
Switch
Description
Value
[states]
Bit 7
(MSB)
H
State
1
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
G
State
0
F
State
0
E
State
0
D
State
0
C
State
0
B
State
1
Bit 0
(LSB)
A
State
1
= 10000011 (binary)
= 131 (decimal)
The command to send is: SETP=131
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 124
4-Dec-15 (A4)
Example 2 (RC-2SPDT-A18)
RC-2SPDT-A18 has 2 SPDT switches available (named A and B).
To set both switches to state 1 (Com connected to port 2), the byte can be represented as:
Bit
Switch
Description
Value
[states]
Bit 7
(MSB)
--Don’t
care
0
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
--Don’t
care
0
B
Bit 0
(LSB)
A
State
State
1
1
= 00000011 (binary)
= 3 (decimal)
The command to send is: SETP=3
See Also
Set Single SPDT Switch
Set All SP4T Switches
Set SP6T Switch
Get SPDT Switch States
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 125
4-Dec-15 (A4)
4.5 (c) - Set Single SP4T Switch
Description
Sets an individual switch within an SP4T switch matrix whilst leaving any other switches (if
applicable) unchanged.
Applies To
Model
RC-xSP4T-A18
Requirements
Firmware C8 or later
Command
SP4T[switch]:STATE:[state]
Parameter Description
[switch] The individual switch (A or B) to be controlled
[state]
The switch state to set:
0 = All ports disconnected
1 = Connect Com port to port 1
2 = Connect Com port to port 2
3 = Connect Com port to port 3
4 = Connect Com port to port 4
Return Value
Value
0
1
Description
Command failed
Command completed successfully
Examples
Set switch A to state 3 (Com port connected to port 3):
SP4TA:STATE:3
Set switch B to state 0 (all ports disconnected):
SP4TB:STATE:0
See Also
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 126
4-Dec-15 (A4)
4.5 (d) - Set All SP4T Switches
Description
Sets all switches within an SP4T switch box to a specified state.
Applies To
Model
RC-xSP4T-A18
Serial Numbers
All serial numbers
Command
SETP=[state]
Parameter
[state]
Description
Integer value of a byte that represents the switch states. Each bit in
the byte corresponds to an input/output port, with the 4 least
significant bits (LSB) corresponding to switch A (all models) and the 4
most significant bits (MSB) corresponding to switch B (RC-2SP4T-A18
only).
Switch A (all models):
If Bits 0 to 3 = 0, switch A has all ports disconnected
If Bit 0 = 1, switch A has Com connected to port 1
If Bit 1 = 1, switch A has Com connected to port 2
If Bit 2 = 1, switch A has Com connected to port 3
If Bit 3 = 1, switch A has Com connected to port 4
Switch B (RC-2SP4T-A18 only):
If Bits 4 to 7 = 0, switch B has all ports disconnected
If Bit 4 = 1, switch B has Com connected to port 1
If Bit 5 = 1, switch B has Com connected to port 2
If Bit 6 = 1, switch B has Com connected to port 3
If Bit 7 = 1, switch B has Com connected to port 4
Return Value
Value
0
1
4
Description
Command failed
Command completed successfully
Switch not set (invalid switch state requested)
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 127
4-Dec-15 (A4)
Example 1 (RC-1SP4T-A18)
Bits 4 to 7 refer to switch B which is not applicable for this model, they can therefore take
any value. To set switch A to position 3 (connecting Com port to port 3); the full byte could
be represented as:
Bit
Bit 7
(MSB)
Bit 6
Don’t
care
0
Don’t
care
0
Switch
Description
Value
[state]
Bit 5
--Don’t
care
0
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
Switch A
Don’t
Port 4 Port 3 Port 2 Port 1
care
0
0
1
0
0
= 00000100 (binary)
= 4 (decimal)
The command to send is: SETP=4
Example 2 (RC-2SP4T-A18)
To set switch A to position 2 (connecting Com port to port 2) and switch B to position 4
(connecting Com port to port 4), the full byte should be:
Bit
Bit 7
(MSB)
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
Switch
Description
Value
Switch B
Switch A
Port 4 Port 3 Port 2 Port 1 Port 4 Port 3 Port 2 Port 1
1
0
0
0
0
0
1
0
[state]
= 10000010 (binary)
= 130 (decimal)
The command to send is: SETP=130
See Also
Set All SPDT Switches
Set Single SP4T Switch
Set SP6T Switch
Get SP4T Switch States
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 128
4-Dec-15 (A4)
4.5 (e) - Set SP6T Switch
Description
Sets an individual switch within an SP6T switch matrix whilst leaving any other switches (if
applicable) unchanged.
Applies To
Model
RC-2SP6T-A18
Requirements
Firmware C8 or later
Command
SP6T[switch]:STATE:[state]
Parameter Description
[switch] The individual switch (A or B) to be controlled
[state]
The switch state to set:
0 = All ports disconnected
1 = Connect Com port to port 1
2 = Connect Com port to port 2
3 = Connect Com port to port 3
4 = Connect Com port to port 4
5 = Connect Com port to port 5
6 = Connect Com port to port 6
Return Value
Value
0
1
Description
Command failed
Command completed successfully
Examples
Set switch A to state 6 (Com port connected to port 6):
SP6TA:STATE:6
Set switch B to state 0 (all ports disconnected):
SP6TB:STATE:0
See Also
Set Single SPDT Switch
Set Single SP4T Switch
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 129
4-Dec-15 (A4)
4.5 (f) - Get All SPDT Switch States
Description
Returns the state of all switches within an SPDT switch box.
Applies To
Model
RC-xSPDT-A18
Serial Numbers
All serial numbers
Command
SWPORT?
Return Value
Value
Description
[states] Numeric value indicating the switch states. The value should be
interpreted as a byte, with each bit representing the state of an
individual SPDT switch as below:
0 = Com port connected to port 1
1 = Com port connected to port 2
The least significant bit (LSB) represents switch A and the most
significant bit (MSB) represents switch H (if applicable).
Example
The command SWPORT? is sent and the return value is 131.
The decimal value 131 corresponds to 10000011 in binary so the switch states are:
Bit
Switch
Value
Bit 7
(MSB)
H
1
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
G
0
F
0
E
0
D
0
C
0
B
1
Bit 0
(LSB)
A
1
Switches A, B and H are in state 1 (Com port connected to port 2); all others are in state 0
(Com port connected to port 1).
See Also
Set Single SPDT Switch
Set All SPDT Switches
Get SP4T Switch States
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 130
4-Dec-15 (A4)
4.5 (g) - Get Single SP4T Switch State
Description
Returns the state of a specific switch within an SP4T switch box.
Applies To
Model
RC-xSP4T-A18
Requirements
Firmware C8 or later
Command
SP4T[switch]:STATE?
Parameter Description
[switch] The individual switch (A or B) to be controlled.
Return Value
Value
[state]
Description
The switch state:
0 = All ports disconnected
1 = Connect Com port to port 1
2 = Connect Com port to port 2
3 = Connect Com port to port 3
4 = Connect Com port to port 4
Example
Return the state of switch A:
SP4TA:STATE?
See Also
Set Single SP4T Switch
Set All SP4T Switches
Get All SPDT Switch States
Get All SP4T Switch States
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 131
4-Dec-15 (A4)
4.5 (h) - Get All SP4T Switch States
Description
Returns the state of all switches within an SP4T switch box. The common port (Com) of each
switch can be in positions 1 to 4, indicating that the common port (Com) is connected to the
respective input/output port, or in position 0 to indicate that the Com port is disconnected
from all input/output ports.
Applies To
Model
RC-xSP4T-A18
Serial Numbers
All serial numbers
Command
SWPORT?
Return Value
Value
[state]
Description
Numeric value indicating the switch states. The value should be
interpreted as a byte, with each bit corresponding to an input/output
port. The 4 least significant bits (LSB) represent switch A (all models)
and the 4 most significant bits (MSB) represent switch B (RC-2SP4TA18 only).
Switch A (all models):
If Bits 0 to 3 = 0, switch A has all ports disconnected
If Bit 0 = 1, switch A has Com connected to port 1
If Bit 1 = 1, switch A has Com connected to port 2
If Bit 2 = 1, switch A has Com connected to port 3
If Bit 3 = 1, switch A has Com connected to port 4
Switch B (RC-2SP4T-A18 only):
If Bits 4 to 7 = 0, switch B has all ports disconnected
If Bit 4 = 1, switch B has Com connected to port 1
If Bit 5 = 1, switch B has Com connected to port 2
If Bit 6 = 1, switch B has Com connected to port 3
If Bit 7 = 1, switch B has Com connected to port 4
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 132
4-Dec-15 (A4)
Example (RC-1SP4T-A18)
The command SWPORT? is sent and the return value is 4.
The decimal value 4 corresponds to 00000100 in binary. The switch states can therefore be
represented by the following table:
Bit 7
(MSB)
Bit 6
Don’t
care
0
Don’t
care
0
Bit
Switch
Description
Value
Bit 5
--Don’t
care
0
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
Switch A
Don’t
Port 4 Port 3 Port 2 Port 1
care
0
0
1
0
0
Switch A is in position 3; Com port connected to port 3
Example (RC-2SP4T-A18)
The command SWPORT? is sent and the return value is 129.
The decimal value 129 corresponds to 10000001 in binary. The switch states can therefore
be represented by the following table:
Bit
Switch
Description
Value
Bit 7
(MSB)
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
(LSB)
Switch B
Switch A
Port 4 Port 3 Port 2 Port 1 Port 4 Port 3 Port 2 Port 1
1
0
0
0
0
0
0
1
Switch B is in position 4; Com port connected to port 2
Switch A is in position 1; Com port connected to port 1
See Also
Set All SP4T Switches
Get All SPDT Switch States
Get Single SP4T Switch State
Get SP6T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 133
4-Dec-15 (A4)
4.5 (i) - Get SP6T Switch State
Description
Returns the state of a specific switch within an SP6T switch box.
Applies To
Model
RC-xSP6T-A18
Requirements
Firmware C8 or later
Command
SP6T[switch]:STATE?
Parameter Description
[switch] The individual switch (A or B) to be controlled.
Return Value
Value
[state]
Description
The switch state:
0 = All ports disconnected
1 = Connect Com port to port 1
2 = Connect Com port to port 2
3 = Connect Com port to port 3
4 = Connect Com port to port 4
5 = Connect Com port to port 5
6 = Connect Com port to port 6
Example
Return the state of switch A:
SP6TA:STATE?
See Also
Set SP6T Switch
Get All SPDT Switch States
Get Single SP4T Switch State
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 134
4-Dec-15 (A4)
4.5 (j) - Get Model Name
Description
Returns the model name of the connected switch matrix.
Command
MN?
Return Value
MN=[model]
Value
[model]
Description
The model name of the switch matrix as a string of ASCII characters
(for example RC-3SPDT-A18).
Example
The command MN? is sent and MN=RC-3SPDT-A18 is returned.
See Also
Get Serial Number
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 135
4-Dec-15 (A4)
4.5 (k) - Get Serial Number
Description
Returns the serial number of the connected switch matrix.
Command
SN?
Return Value
SN=[serial]
Value
Description
[serial] The serial number of the switch matrix as a string of ASCII characters
(for example 11305010002).
Example
The command SN? is sent and SN=11305010002 is returned.
See Also
Get Model Name
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 136
4-Dec-15 (A4)
4.5 (l) - Get Internal Temperature
Description
Returns the internal temperature of the switch matrix. There are 1 to 3 internal sensors that
can be polled (model dependent):
 RC-1SP4T-A18 (1 sensor)
 RC-1SPDT-A18 (1 sensor)
 RC-2SP4T-A18 (2 sensors)
 RC-2SPDT-A18 (2 sensors)
 RC-3SPDT-A18 (2 sensors)
 RC-4SPDT-A18 (2 sensors)
 RC-8SPDT-A18 (3 sensors)
Command
TEMP[sensor]?
Parameter Description
[sensor] The internal temperature sensor (1 to 3) to poll. For example:
TEMP1? to poll sensor 1
TEMP2? to poll sensor 2 (model dependent)
TEMP3? to poll sensor 3 (model dependent)
Return Value
Value
[temp]
Description
The temperature reading of the specified internal sensor in Degrees
Celsius.
Example
The command TEMP1? is sent and +37.25 is returned.
See Also
Get Heat Alarm
Get Fan Status
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 137
4-Dec-15 (A4)
4.5 (m) - Get Heat Alarm
Description
Returns an alarm notification if any of the internal temperature sensors exceeds the factory
programmed limits (45°C on the PCB or 48°C on the internal switch case).
Command
HEATALARM?
Return Value
Value
Description
[status] Integer value to indicate the heat alarm status:
0 – Device is within normal operating temperature limits
1 – Device temperature has exceeded the recommended limits
Example
The command HEATALARM? is sent and 0 is returned to indicate the device is within normal
limits
See Also
Get Internal Temperature
Get Fan Status
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 138
4-Dec-15 (A4)
4.5 (n) - Get Fan Status
Description
This function indicates whether the internal fan is currently operating (model dependent).
Applies To
Model
RC-2SPDT-A18
RC-3SPDT-A18
RC-4SPDT-A18
RC-8SPDT-A18
Serial Numbers
All serial numbers
All serial numbers
All serial numbers
All serial numbers
Command
FAN?
Return Value
Value
Description
[status] Integer value to indicate the fan status:
0 – Fan is not operating
1 – Fan is currently operating
Example
The command FAN? is sent and 1 is returned to indicate it is currently operating.
See Also
Get Internal Temperature
Get Heat Alarm
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 139
4-Dec-15 (A4)
4.5 (o) - Get Firmware
Description
Returns the internal firmware version of the switch box.
Command
FIRMWARE?
Return Value
Value
Description
[firmware] The current firmware version, for example “B3”.
Example
The command FIRMWARE? is sent and C3 is returned.
Portable Test Equipment Programming Manual
RF Switch Matrices
Page 140
4-Dec-15 (A4)
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising