Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DS1054Z file format parsing #10

Open
kelvinlawson opened this issue Nov 17, 2015 · 2 comments
Open

DS1054Z file format parsing #10

kelvinlawson opened this issue Nov 17, 2015 · 2 comments

Comments

@kelvinlawson
Copy link

I've tried the latest code on a WFM generated by a DS1054Z. The first error that came up was:

./wfmutil.py plot --forgiving ../data/test1/NewFile1.wfm 
Format does not follow the known file format. Try the --forgiving option.
If you'd like to help development, please report this error:
Field magic == 42405 not met, got 65281

If I edit the magic number in wfm.py it hits the next one:

Field padding1 ==  not met, got ��

It would be great to see the DS1054Z supported, happy to help where I can. The file is available here for 14 days: https://transfer.sh/1fBvNf/newfile1.wfm

Many thanks

@freman
Copy link

freman commented Dec 21, 2016

I've run headlong into this too :(

I've noticed that some of what was previously "padding" is now model and firmware version

Header that I have managed to parse (I think, assumptions made, I only have the one wave form atm but i'll make more later)

	Magic uint16
	Unknown1 [6]byte
	Model [20]byte /* string */
	Firmware [20]byte /* string */
	ActiveChannels byte
	Unknown2 [2047]byte
	Channels [4]ChannelHeader

And ChannelHeader looks something like

	Name [8]byte
	Enabled byte
	Unknown [51]byte

Some output

(*wfm.Header)(0xc04208c000)({
 Magic: (uint16) 65281,
 Unknown1: ([6]uint8) (len=6 cap=6) {
  00000000  ff ff a6 a5 38 00                                 |....8.|
 },
 Model: ([20]uint8) (len=20 cap=20) {
  00000000  44 53 31 31 30 34 5a 00  00 00 00 00 00 00 00 00  |DS1104Z.........|
  00000010  00 00 00 00                                       |....|
 },
 Firmware: ([20]uint8) (len=20 cap=20) {
  00000000  30 30 2e 30 34 2e 30 33  2e 53 50 32 00 00 00 00  |00.04.03.SP2....|
  00000010  00 00 00 00                                       |....|
 },
 ActiveChannels: (uint8) 1,
 Unknown2: ([2047]uint8) (len=2047 cap=2047) {
 Channels: ([4]wfm.ChannelHeader) (len=4 cap=4) {
  (wfm.ChannelHeader) {
   Name: ([8]uint8) (len=8 cap=8) {
    00000000  43 48 34 00 00 00 00 00                           |CH4.....|
   },
   Enabled: (uint8) 0,
   Unknown: ([51]uint8) (len=51 cap=51) {
    00000000  00 00 00 03 01 38 00 01  00 00 00 00 00 00 00 00  |.....8..........|
    00000010  00 00 00 00 02 00 01 09  02 00 07 00 ca 9a 3b 00  |..............;.|
    00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    00000030  00 00 00                                          |...|
   }
  },
  (wfm.ChannelHeader) {
   Name: ([8]uint8) (len=8 cap=8) {
    00000000  43 48 33 00 00 00 00 00                           |CH3.....|
   },
   Enabled: (uint8) 0,
   Unknown: ([51]uint8) (len=51 cap=51) {
    00000000  00 00 00 02 01 38 00 01  00 00 00 00 00 00 00 00  |.....8..........|
    00000010  00 00 00 00 01 00 01 09  02 00 07 00 ca 9a 3b 00  |..............;.|
    00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    00000030  00 00 00                                          |...|
   }
  },
  (wfm.ChannelHeader) {
   Name: ([8]uint8) (len=8 cap=8) {
    00000000  43 48 32 00 00 00 00 00                           |CH2.....|
   },
   Enabled: (uint8) 0,
   Unknown: ([51]uint8) (len=51 cap=51) {
    00000000  00 00 00 01 01 38 00 01  01 00 00 00 00 00 00 00  |.....8..........|
    00000010  00 00 00 00 00 00 01 09  02 00 07 00 ca 9a 3b 00  |..............;.|
    00000020  00 00 00 00 f0 a1 a0 ff  ff ff ff 00 00 00 00 00  |................|
    00000030  00 00 00                                          |...|
   }
  },
  (wfm.ChannelHeader) {
   Name: ([8]uint8) (len=8 cap=8) {
    00000000  43 48 31 00 00 00 00 00                           |CH1.....|
   },
   Enabled: (uint8) 1,
   Unknown: ([51]uint8) (len=51 cap=51) {
    00000000  00 00 00 06 04 05 00 00  00 00 32 3c 18 02 10 00  |..........2<....|
    00000010  00 cf 00 2a af 91 98 0f  00 00 00 00 00 00 00 00  |...*............|
    00000020  a0 86 01 00 a0 86 01 00  a0 86 01 00 a0 86 01 00  |................|
    00000030  00 8f fd                                          |...|
   }
  }
 },

but then... I'm probably completely wrong :D

@scottprahl
Copy link

Three years later ...

Check out https://github.com/scottprahl/RigolWFM or https://github.com/michal-szkutnik/pyRigolWfm1000Z for support for the 1000Z .wfm format. These differ significantly from the 1000E series files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants