EEVblog Electronics Community Forum

Products => Test Equipment => Topic started by: boeserbaer on November 28, 2014, 07:11:37 pm

Title: Rigol DG4000 series RAF file format
Post by: boeserbaer on November 28, 2014, 07:11:37 pm
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
Title: Re: Rigol DG4000 series RAF file format
Post by: Murray on November 29, 2014, 03:06:15 am
Thank you so much!
I have a DG4162, and I expect this information tol come in very handy.

Murray
Title: Re: Rigol DG4000 series RAF file format
Post by: biot on December 03, 2014, 12:08:27 pm
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.
Thanks very much for figuring this out and documenting it.

We're going to be documenting and writing sigrok input/output modules for this file format. I realize you've basically described the whole thing here, but I wonder if I could impose on you to send me a few files like these generated by your DG4062? Sine, square, ... it would really help to have "real world" files to test against when writing implementations, as testing an implementation against your own synthesized data is just asking for trouble.
Title: Re: Rigol DG4000 series RAF file format
Post by: boeserbaer on December 03, 2014, 04:26:31 pm
Hi,

I am not sure what you are asking for?  If you want a file which I have created using my QT program, I can certainly give you one. 
What I have are basically recorded detector signals, translated for playback by the 4062.  Let me know what you mean, and I will post something.

Best Regards, Mike
Title: Re: Rigol DG4000 series RAF file format
Post by: Sparky on December 03, 2014, 04:29:32 pm
I am not sure what you are asking for?  If you want a file which I have created using my QT program, I can certainly give you one. 
What I have are basically recorded detector signals, translated for playback by the 4062.  Let me know what you mean, and I will post something.

Maybe biot refers to the waveforms you created using the official Rigol UltraStation software -- you mentioned in your original post you created some test signals to help determine the file format.
Title: Re: Rigol DG4000 series RAF file format
Post by: Carrington on December 03, 2014, 04:40:06 pm
Maybe biot refers to the waveforms you created using the official Rigol UltraStation software...
Sure!

http://www.sigrok.org/wiki/TODO (http://www.sigrok.org/wiki/TODO)
Title: Re: Rigol DG4000 series RAF file format
Post by: biot on December 03, 2014, 04:47:31 pm
I am not sure what you are asking for?  If you want a file which I have created using my QT program, I can certainly give you one. 
What I have are basically recorded detector signals, translated for playback by the 4062.  Let me know what you mean, and I will post something.

Maybe biot refers to the waveforms you created using the official Rigol UltraStation software -- you mentioned in your original post you created some test signals to help determine the file format.
Ah, I was under the impression you could save waveforms which the hardware had on board to a USB stick or something. If that's not possible, sure -- the ones generated by that software will do. As long as I know they work well on the hardware, they'll serve for the purpose.
Title: Re: Rigol DG4000 series RAF file format
Post by: boeserbaer on December 03, 2014, 06:25:04 pm
Any suggestions on how to upload a .raf file here?
Title: Re: Rigol DG4000 series RAF file format
Post by: boeserbaer on December 03, 2014, 06:41:05 pm
I am so used to gmail examining the contents of zip files, that I forgot about zipping it.  Duhh.
Title: Re: Rigol DG4000 series RAF file format
Post by: Teneyes on December 03, 2014, 07:25:13 pm
@ boeserbaer , is this your Wave?
Title: Re: Rigol DG4000 series RAF file format
Post by: boeserbaer on December 03, 2014, 08:21:26 pm
That looks exactly like what I put in, but I cannot tell the horizontal scale.  The pulses should be separated by 408ns.
Title: Re: Rigol DG4000 series RAF file format
Post by: Teneyes on December 03, 2014, 08:40:22 pm
That looks exactly like what I put in, but I cannot tell the horizontal scale.  The pulses should be separated by 408ns.
Look again, Zoom  408nsec /div
EDIT , changed pix to your 408ns/div
Title: Re: Rigol DG4000 series RAF file format
Post by: Sparky on July 09, 2018, 03:14:32 am
Just wanted to post that Rigol did provide a specification of the Arb. Wave Gen format across the DG1000/4000/5000 series.  It was written in Jan 2015 but probably came out much later than that.  I just found it when looking for info on the .RAF file format.

Sparky