# :MEASure:HORizontal:PHASe

Phase Commands

- :MEASure:HORizontal:PHASe
- :MEASure:HORizontal:PHASe:EDIRection
- :MEASure:HORizontal:PHASe:FAVorite
- :MEASure:HORizontal:PHASe:LOCation?
- :MEASure:HORizontal:PHASe:OCCurrences
- :MEASure:HORizontal:PHASe:REGion
- :MEASure:HORizontal:PHASe:SOURce
- :MEASure:HORizontal:PHASe:STATus?
- :MEASure:HORizontal:PHASe:STATus:DETails?
- :MEASure:HORizontal:PHASe:STATus:REASon?
- :MEASure:HORizontal:PHASe:UREFerence:STATe
- :MEASure:HORizontal:PHASe:UREFerence:VALue

## Command Syntax

    :MEASure:HORizontal:PHASe

## Query Syntax

    :MEASure:HORizontal:PHASe?

## Description

Performs a phase measurement on NRZ and PAM waveforms. Phase measures the phase between two locations on the same waveform or two locations on separate waveforms. If the measurement is already displayed in the results table, the measurement is moved to the top of the table. The query form of the command returns the measured value. Use child commands to specify the source waveforms (`:MEASure:HORizontal:PHASe:SOURce`) and its edge direction (`:MEASure:HORizontal:PHASe:EDIRection`). Sources can be any displayed waveform, waveform memory, or function. For example, CHAN1_1, WMEMory1, or FUNCtion1. Use the child commands to set the measurement parameters before sending the parent command. Use `:MEASure:TBASe:GENeral:METHod` to change the definition of the waveform's top/base. Use `:<waveform>:THReshold:GENeral:METHod` to change the definition of the waveform's threshold.

## Example Command Sequence

    :MEASure:HORizontal:PHASe:SOURce1 CHAN1_1
    //  Defines first measurement edge
    :MEASure:HORizontal:PHASe:EDIRection1 RISing
    //  Defines second measurement edge
    :MEASure:HORizontal:PHASe:SOURce2 WMEMory1
    :MEASure:HORizontal:PHASe:EDIRection2 FALLing
    //  Perform measurement
    :MEASure:HORizontal:PHASe
    :MEASure:HORizontal:PHASe?

## Measurement Ready?

To confirm that the measurement is ready to read, you can query the measurement's status:

    if ('CORR' in Infiniium.query(':MEASure:HORizontal:PHASe:STATus?')):
    	measurement = Infiniium.query(':MEASure:HORizontal:PHASe?')

If averaging is turned on (`:ACQuire:SMODe AVERage`), you can also confirm if the measurement result is ready by comparing the number of specified averages (`:ACQuire:COUNt?`) versus the number of measurement sweeps that have occurred (`:ACQuire:COUNt?`). The technique uses the `:COUNt?` common measurement query. For example,

    if (Infiniium.query(':MEASure:HORizontal:PHASe:COUNt?') >= Infiniium.query(':ACQuire:COUNt?')):
    	measurement = Infiniium.query(':MEASure:HORizontal:PHASe?')

You can also use an acquisition limit test to test that a number of waveforms or samples have completed before returning a measurement. Refer to the `:LTESt:ACQuire:CTYPe` command.

## Querying Measurement Results and Statistics

You can query measurement results using the `:MEASure:HORizontal:PHASe?` query after making the proper instance settings.

If a measurement is installed into Results table (using the `:MEASure:HORizontal:PHASe` command) and you have made the proper instance settings, you can query statistics using common child queries.

Also, you can query measurement results and statistics directly from the Results table (without having to make the proper instance settings beforehand). See Querying Measurement Results and Statistics.