# :WAVeform:CGRade:XML:READ?

:WAVeform CGRade Commands

- :WAVeform:CGRade:ASCii:DATA?
- :WAVeform:CGRade:COLumns?
- :WAVeform:CGRade:INTeger:DATA?
- :WAVeform:CGRade:POINts?
- :WAVeform:CGRade:ROWS?
- :WAVeform:CGRade:STATus?
- :WAVeform:CGRade:STATus:REASon?
- :WAVeform:CGRade:UICount?
- :WAVeform:CGRade:WCOunt?
- :WAVeform:CGRade:XINCrement?
- :WAVeform:CGRade:XML:READ?
- :WAVeform:CGRade:XML:WRITe?
- :WAVeform:CGRade:XORigin?
- :WAVeform:CGRade:YINCrement?
- :WAVeform:CGRade:YORigin?

## Query Syntax

    :WAVeform:CGRade:XML:READ? <source_waveform>

<source_waveform> Parameter
Source Waveform | Parameter
--- | ---
Channel | `CHAN<connection1-8>_<ch1-8>`; With connection 1, the "`1_`" part is optional, and you can simply use `CHAN<ch1-8>`
Differential channel | `DIFF{1:8}{A|C}`
Common mode channel | `CMOD{1:8}{A|C}`
Function output | `FUNCtion{1:64}`
Waveform memory | `WMEMory{1:8}`
Color-grade gray-scale memory | `CGMemory{1:8}`
Trace (used for displaying S-parameters.) | `TRACe{128}`

## Description

Directly returns the database waveform values from color-grade gray-scale memory or from channels, differentials, common modes, functions, or traces. The returned data is in the internal color-grade gray-scale waveform format. This is the same data format used when saving waveform data to Infiniium's file system (.cgsi) using the `:DISK:EYE:SAVE` and `:DISK:EYE:SAVE:FTYPe` commands. The returned data is comprised of an ASCII XML header followed by binary waveform data. The waveform's vertical and horizontal scaling parameters are included. The advantage of using this query is that the returned waveform data is read directly by your program without first having to command Infiniium to save the data to a file.

Once the data is returned, your program can save the data to a file or write the data into one of Infiniium's eight color-grade gray-scale memories using the `:WAVeform:CGRade:XML:WRITe?` command.

## Python Example

This script demonstrates Infiniium's `:WAVeform:CGRade:XML:READ?` and `:WAVeform:CGRade:XML:WRITe?` queries. The color-grade gray-scale database is:

1. Returned from Infiniium's Connection 1 Channel 1.
2. Written into Infiniium's color-grade gray-scale memory 2.
3. Saved to a color-grade gray-scale file (.cgsi) in the script folder.