Author Topic: Rigol DG4000 series RAF file format  (Read 8863 times)

0 Members and 1 Guest are viewing this topic.

Offline boeserbaerTopic starter

  • Contributor
  • Posts: 21
Rigol DG4000 series RAF file format
« 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
« Last Edit: November 28, 2014, 09:54:24 pm by boeserbaer »
 

Offline Murray

  • Newbie
  • Posts: 6
Re: Rigol DG4000 series RAF file format
« Reply #1 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
 

Offline biot

  • Regular Contributor
  • *
  • Posts: 70
Re: Rigol DG4000 series RAF file format
« Reply #2 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.
 

Offline boeserbaerTopic starter

  • Contributor
  • Posts: 21
Re: Rigol DG4000 series RAF file format
« Reply #3 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
 

Offline Sparky

  • Frequent Contributor
  • **
  • Posts: 449
  • Country: us
Re: Rigol DG4000 series RAF file format
« Reply #4 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.
 

Offline Carrington

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: es
Re: Rigol DG4000 series RAF file format
« Reply #5 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
My English can be pretty bad, so suggestions are welcome. ;)
Space Weather.
Lightning & Thunderstorms in Real Time.
 

Offline biot

  • Regular Contributor
  • *
  • Posts: 70
Re: Rigol DG4000 series RAF file format
« Reply #6 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.
 

Offline boeserbaerTopic starter

  • Contributor
  • Posts: 21
Re: Rigol DG4000 series RAF file format
« Reply #7 on: December 03, 2014, 06:25:04 pm »
Any suggestions on how to upload a .raf file here?
 

Offline boeserbaerTopic starter

  • Contributor
  • Posts: 21
Re: Rigol DG4000 series RAF file format
« Reply #8 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.
 

Offline Teneyes

  • Frequent Contributor
  • **
  • Posts: 498
  • Country: ca
Re: Rigol DG4000 series RAF file format
« Reply #9 on: December 03, 2014, 07:25:13 pm »
@ boeserbaer , is this your Wave?
« Last Edit: December 04, 2014, 12:20:59 am by Teneyes »
IiIiIiIiIi  --  curiosity killed the cat but, satisfaction brought it back
 

Offline boeserbaerTopic starter

  • Contributor
  • Posts: 21
Re: Rigol DG4000 series RAF file format
« Reply #10 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.
 

Offline Teneyes

  • Frequent Contributor
  • **
  • Posts: 498
  • Country: ca
Re: Rigol DG4000 series RAF file format
« Reply #11 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
« Last Edit: December 04, 2014, 12:22:15 am by Teneyes »
IiIiIiIiIi  --  curiosity killed the cat but, satisfaction brought it back
 

Offline Sparky

  • Frequent Contributor
  • **
  • Posts: 449
  • Country: us
Re: Rigol DG4000 series RAF file format
« Reply #12 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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf