Low Cost PCB's Low Cost Components

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

0 Members and 1 Guest are viewing this topic.

Offline boeserbaer

  • Contributor
  • Posts: 16
Rigol DG4000 series RAF file format
« on: November 29, 2014, 06:11:37 AM »
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 29, 2014, 08:54:24 AM by boeserbaer »
 

Offline Murray

  • Contributor
  • Posts: 6
Re: Rigol DG4000 series RAF file format
« Reply #1 on: November 29, 2014, 02:06:15 PM »
Thank you so much!
I have a DG4162, and I expect this information tol come in very handy.

Murray
 

Offline biot

  • Regular Contributor
  • *
  • Posts: 64
Re: Rigol DG4000 series RAF file format
« Reply #2 on: December 03, 2014, 11: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 boeserbaer

  • Contributor
  • Posts: 16
Re: Rigol DG4000 series RAF file format
« Reply #3 on: December 04, 2014, 03:26:31 AM »
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: 311
  • Country: us
Re: Rigol DG4000 series RAF file format
« Reply #4 on: December 04, 2014, 03:29:32 AM »
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: 1138
  • Country: es
Re: Rigol DG4000 series RAF file format
« Reply #5 on: December 04, 2014, 03:40:06 AM »
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: 64
Re: Rigol DG4000 series RAF file format
« Reply #6 on: December 04, 2014, 03:47:31 AM »
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 boeserbaer

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

Offline boeserbaer

  • Contributor
  • Posts: 16
Re: Rigol DG4000 series RAF file format
« Reply #8 on: December 04, 2014, 05:41:05 AM »
I am so used to gmail examining the contents of zip files, that I forgot about zipping it.  Duhh.
 

Offline Teneyes

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

Offline boeserbaer

  • Contributor
  • Posts: 16
Re: Rigol DG4000 series RAF file format
« Reply #10 on: December 04, 2014, 07:21:26 AM »
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: 495
  • Country: ca
Re: Rigol DG4000 series RAF file format
« Reply #11 on: December 04, 2014, 07:40:22 AM »
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, 11:22:15 AM by Teneyes »
IiIiIiIiIi  --  curiosity killed the cat but, satisfaction brought it back
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf