Anritsu 0701012, MA24106A manual Using the Demo Application Sample Visual Basic Code

Page 54

Using the Demo Application

Sample Visual Basic Code

************************************************************************

//This sample program shows how to control Anritsu MA24106A USB power sensor using //Microsoft Visual basic 6.0

Option Explicit

Public gstrInputBuffer As String

'Event handler for InitializeComPort button Private Sub btnInitializeComPort_Click()

Call SetCommPort(Val(Trim(txtCOMPORTNo.Text))) End Sub

'Subroutine to set the com port

Public Sub SetCommPort(portNo As Integer) On Error GoTo errHndler

'Setup MSComm control MSComm1.Settings = "115200,n,8,1" MSComm1.CommPort = Trim(txtCOMPORTNo.Text) MSComm1.PortOpen = True MSComm1.RThreshold = 1 MSComm1.SThreshold = 1

'

'Wait for half a second before sending START command Delay (0.5)

'Arm sensor to start making measurements txtCommand.Text = "START"

Call btnSend_Click

'

Exit Sub

errHndler:

MsgBox ("ERROR: " & Err.Description)

End Sub

'Event handler for ResetComPort button Private Sub btnResetComPort_Click()

'Close com port

If MSComm1.PortOpen = True Then

MSComm1.PortOpen = False End If

End Sub

'Event handler for Send button Private Sub btnSend_Click()

Dim strResult As String

'Clear buffer & receive text window before sending command gstrInputBuffer = ""

txtReceived.Text = ""

'Send command and appeand Termination character, 0x0A(10)with it. MSComm1.Output = UCase(txtCommand.Text) & Chr(10)

'Display received result on the Received text box txtReceived.Text = strResult

'

End Sub

B-2

MA24106A UG

Image 54
Contents MA24106A USB Power Sensor User Guide True-RMS, 50 MHz to 6 GHzUpdates Anritsu Company Software License Agreement Page Table of Contents Table of Contents General Information Preparation for Storage/Shipment Preparation for Storage/ShipmentInstallation Driver InstallationHardware and Software Requirements Driver Installation Anritsu Power Meter InstallationInstallation Driver Installation License AgreementSoftware will then install to the selected location Found New Hardware Wizard Select the hardware type Computer, and then click Next Click Have Disk..., and then click Next 14.Found New Hardware Wizard Click Finish to close the wizard Page Using the Power Sensor Graphical User InterfaceButtons Using the Power Sensor ButtonsData Entry Fields Using the Power Sensor Display Window Display WindowStatus Bar File Menu Menu Bar Using the Power SensorMenu Bar Tools MenuData Logging Menu DataLogging MenuPower Graph 10. Data LoggingTime, X-axis 30 minutes Offset Table 14.Offset Entry Screen16. Open Dialog MA24106A UG Session Restore 17.Offset Table Menu Offset Table Off StatusUsing the Power Sensor Making Measurements Basic Power MeasurementConnecting the DUT Making MeasurementsCalibrating the Sensor Making Measurements Using the Power SensorZeroing the Sensor Applying a Calibration Factor CorrectionNumber Averages Needed for ±0.20 dB ±0.15 dB ±0.10 dB ±0.05 dB ±0.01 dB DBm NoiseMeasurement Considerations Using the Power Sensor Error StatesTime Varying Signals Message Description ResolutionUsing the Power Sensor Measurement Considerations High Crest Factor Signals peak to average ratioMultitone Signals Noise and AveragingSettling Time Using the Power Sensor Uncertainty of a Measurement Uncertainty of a MeasurementUncertainty Example Uncertainty of a Measurement Using the Power SensorUncertainty Adjusted Specification Noise Calculations at 12 dBm 16 mWRemote Operation Commands Summary Command DescriptionRemote Operation Remote Operation Command Details Remote Operation Command DetailsRemote Operation Remote Operation Command Details FREQ?HAT Sensor Operational Tests Required EquipmentTest Procedure Vswr PretestVswr Pretest Sensor Operational Tests Calibration Factor Test Sensor Operational Tests Calibration Factor TestCalibration Factor Test Sensor Operational Tests MA24106ALinearity Test Sensor Operational Tests Linearity TestLinearity Test Sensor Operational Tests ApplySensor Operational Tests Linearity Test +20 +15 +10 Adjust per Max Min Delta E11 E12 Measurement Results 2 GHz Measurement Results 6 GHz Appendix a Connector Care and Handling Beware of destructive pin depth mating connectorsCleaning connectors Avoid over torquing connectorsAvoid applying excessive power Connector Care and HandlingUsing the Demo Application Appendix B Sample Visual Basic CodeDemo Application Using the Demo Application Sample Visual Basic Code Sample Visual Basic Code Using the Demo Application Delay routine For Anritsu Power Meter 1.0 Only Appendix C Serial Port CompatibilityMethod 1-Download Updated Software Method 3-Remapping a Serial PortSerial Port Compatibility Figure C-2.System PropertiesMethod 3-Remapping a Serial Port Figure C-3.Device ManagerFigure C-4.Advanced Settings for COM Port Close all windows that you have opened up to this point Appendix D Upgrading the Firmware Upgrading the FirmwareFigure D-3.Firmware Upgrade Dialog Upgrading the FirmwareFigure D-5.Open File Dialog Figure D-7 Symbols Symbols to LIndex To S Index-2 MA24106A UGTo Z USB