EasyManua.ls Logo

Rohde & Schwarz SMW200A - How to Create a Control List Using Tag File Format

Rohde & Schwarz SMW200A
1312 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Remote Control Commands
R&S
®
SMW200A
979User Manual 1175.6632.02 ─ 16
fclose(fp);
// SICO.wv
// Generating a binary data set from the I/Q pairs in the file SICO.txt
// and storing the result to file SICO.wv
FILE *fp_sour, *fp_dest;
float i_float, q_float;
unsigned short i_usint, q_usint;
fp_sour = fopen("SICO.TXT", "rt");
if (fp_sour == 0)
return -1;
fp_dest = fopen("SICO.WV", "wb");
if (fp_dest == 0)
{
fclose(fp_sour);
return -1;
}
// Write required tags to waveform file
fprintf(fp_dest, "{TYPE: SMU-WV,0}");
fprintf(fp_dest, "{CLOCK: 10e6}");
fprintf(fp_dest, "{SAMPLES: %d}", samples);
// RMS, Peak
fprintf(fp_dest, "{LEVEL OFFS: %f,%f}", -1.0f * 20.0f * log10(1.0f/sqrt(2.0f)), 0.0f);
fprintf(fp_dest, "{WAVEFORM-%d:#", (samples * 4) + 1);
for (i=0; i<samples; i++)
{
// Read I/Q pair from ASCII file
if (fscanf(fp_sour, "%f %f", &i_float, &q_float) == EOF)
break;
// Convert I/Q pair to unsigned short
i_usint = (unsigned short)floor((i_float * 32767.0) + 0.5);
q_usint = (unsigned short)floor((q_float * 32767.0) + 0.5);
// Write converted I/Q pair to waveform file
fwrite(&i_usint, 2, 1, fp_dest);
fwrite(&q_usint, 2, 1, fp_dest);
}
fprintf(fp_dest, "}");
fclose(fp_dest);
fclose(fp_sour);
return 0;
}
How to Create a Control List Using Tag File Format
The R&S SMW provides the following ways to create a file containing control signals:
to use the dedicated "Control Data Editor" and create a file in ASCII format and
with extension *.dm_iqc, see "To create a control list in ASCII format manually"
on page 286
To use the tag-oriented format and create a control list file, see "To create a control
list using tag file format" on page 980
SOURce Subsystem

Table of Contents

Related product manuals