Hi all,
I just purchased a Rigol DG4062, and first off, I am very pleased with the unit.
One thing I had a lot of trouble locating was a descriptor of the file format.
After creating some signals using the UltraStation software, I determined that the file format is a very simple 16 bit offset binary. Little Endian. No Header
Basically there are 16384 samples in the file. Each sample is in the range 0 to 16383.
Also, To force the DG4000 to output at 500MSPS, set the period to 32.768 us.
16383 is positive full scale
8192 is zero volts
0 is negative full scale
For those of you who use QT, here is a snippet :
QString outFN = base_fn;
outFN += QString::number(i);
outFN += ".raf";
QFile saveFile(outFN);
if (!saveFile.open(QFile::WriteOnly))
{
qDebug() << "saveFile() unable to open" << outFN;
return -1;
}
qDebug() << "saveData()" << outFN;
QDataStream ds(&saveFile);
ds.setByteOrder(QDataStream::LittleEndian);
for (int j=0;j< 16384;j++)
{
double val = indata[j]; // indata is pre-filled with values in the range -1.0 to 1.0
val *= 8192.0; // now in the range -8192 to 8192
val += 8192.0; // now 0 - 16384
if (val <0)
val = 0.0;
quint16 outInt = val;
if (val > 16383)
val = 16383;
ds << outInt;
}
saveFile.close();
edit: corrected formatting of "C" code