Anritsu MA24106A, 0701012 manual Appendix B Sample Visual Basic Code, Demo Application

Page 53

Appendix B — Sample Visual Basic Code

B-1 Demo Application

The MA24106A CD contains a demo application that allows you to interface with the power sensor using the remote programming protocol. The sample code is written in Microsoft® Visual Basic® 6.0 and is given at the end of this appendix. The complete project, DempApp.vbp, is available on the CD that shipped with the sensor. The Demo Application’s main form is shown below:

Figure B-1.Demo Application

It is recommended to use the source code and project available on the CD that shipped with the sensor to minimize typing errors. You may need to add Microsoft® Comm Control 6.0 manually, which can be added from Visual Basic® 6.0 IDE by navigating to: Project Components.

B-2 Using the Demo Application

Once connected to the PC using the USB cable, the MA24106A shows up as a Serial port device on the PC. You can check the COM port number using the device manager in the Windows® control panel.

Type the COM port number in the ComPortNo: text box and click Initialize. Once the COM port is initialized, you can type commands in the Command text box, and then click the Send button. Any responses from the sensor will be displayed in the Received text box. You can use the Functions group buttons to exercise the sensor for power readings, frequency readings and settings, and for zeroing sensor.

Note: The Demo Application uses Microsoft Comm Control, which limits COM Port number usage to less than 16 (COM3 to COM16).

MA24106A UG

B-1

Image 53
Contents True-RMS, 50 MHz to 6 GHz MA24106A USB Power Sensor User GuideUpdates Anritsu Company Software License Agreement Page Table of Contents Table of Contents General Information Preparation for Storage/Shipment Preparation for Storage/ShipmentHardware and Software Requirements InstallationDriver Installation Anritsu Power Meter Installation Driver InstallationLicense Agreement Installation Driver InstallationSoftware 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 Graphical User Interface Using the Power SensorData Entry Fields Buttons Using the Power SensorButtons Status Bar Using the Power Sensor Display WindowDisplay Window Menu Bar Menu Bar Using the Power SensorFile Menu Tools MenuDataLogging Menu Data Logging Menu10. Data Logging Power GraphTime, X-axis 30 minutes 14.Offset Entry Screen Offset Table16. Open Dialog MA24106A UG 17.Offset Table Menu Offset Table Off Status Session RestoreConnecting the DUT Basic Power MeasurementUsing the Power Sensor Making Measurements Making MeasurementsZeroing the Sensor Making Measurements Using the Power SensorCalibrating the Sensor Applying a Calibration Factor Correction±0.20 dB ±0.15 dB ±0.10 dB ±0.05 dB ±0.01 dB DBm Noise Number Averages Needed forTime Varying Signals Error StatesMeasurement Considerations Using the Power Sensor Message Description ResolutionMultitone Signals High Crest Factor Signals peak to average ratioUsing the Power Sensor Measurement Considerations Noise and AveragingSettling Time Uncertainty of a Measurement Using the Power Sensor Uncertainty of a MeasurementUncertainty Adjusted Specification Uncertainty of a Measurement Using the Power SensorUncertainty Example Noise Calculations at 12 dBm 16 mWRemote Operation Remote Operation Commands SummaryCommand Description Remote Operation Command Details Remote Operation Command DetailsFREQ? Remote Operation Remote Operation Command DetailsHAT Required Equipment Sensor Operational TestsVswr Pretest Sensor Operational Tests Test ProcedureVswr Pretest Sensor Operational Tests Calibration Factor Test Calibration Factor TestMA24106A Calibration Factor Test Sensor Operational TestsSensor Operational Tests Linearity Test Linearity TestApply Linearity Test Sensor Operational TestsSensor Operational Tests Linearity Test +20 +15 +10 Adjust per Max Min Delta E11 E12 Measurement Results 2 GHz Measurement Results 6 GHz Beware of destructive pin depth mating connectors Appendix a Connector Care and HandlingAvoid applying excessive power Avoid over torquing connectorsCleaning connectors Connector Care and HandlingDemo Application Using the Demo ApplicationAppendix B Sample Visual Basic Code Using the Demo Application Sample Visual Basic Code Sample Visual Basic Code Using the Demo Application Delay routine Appendix C Serial Port Compatibility For Anritsu Power Meter 1.0 OnlyMethod 3-Remapping a Serial Port Method 1-Download Updated SoftwareFigure C-2.System Properties Serial Port CompatibilityFigure C-3.Device Manager Method 3-Remapping a Serial PortFigure C-4.Advanced Settings for COM Port Close all windows that you have opened up to this point Upgrading the Firmware Appendix D Upgrading the FirmwareUpgrading the Firmware Figure D-3.Firmware Upgrade DialogFigure D-5.Open File Dialog Figure D-7 Index SymbolsSymbols to L Index-2 MA24106A UG To SUSB To Z