Author Topic: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG  (Read 45654 times)

0 Members and 2 Guests are viewing this topic.

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
At a certain point after getting the SDG1204X-E oscilloscope I started to wonder if it might be possible to use the Bode plot function with a non-Siglent waveform generator. After some hours of researching and reverse engineering I wrote this Python program. It is a small server which emulates Siglent arbitrary waveform generator connected to LAN.

While drawing a Bode plot, the oscilloscope sends the commands to PC instead of the AWG and my program is what makes the oscilloscope think that it communicates with a genuine Siglent signal generator. The program extracts the commands sent to the generator, parses them and translates to the commands, which can be understood by the connected to the PC non-Siglent generator.

The program is written in Python. I tested it only under Linux. Later I'll test it under Windows too.

The source code and the explanations about running it are located here:

https://github.com/4x1md/sds1004x_bode

Here is a video which shows how the program works:



You are welcome to discuss the program here.
« Last Edit: November 25, 2018, 05:44:21 pm by 4x1md »
 

Offline bluejedi

  • Contributor
  • Posts: 33
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #1 on: July 29, 2018, 03:52:26 pm »
At a certain point after getting the SDG1204X-E oscilloscope I started to wonder if it might be possible to use the Bode plot function with a non-Siglent waveform generator. After some hours of researching and reverse engineering I wrote this Python program. It is a small server which emulates Siglent arbitrary waveform generator connected to LAN.

While drawing a Bode plot, the oscilloscope sends the commands to PC instead of the AWG and my program is what makes the oscilloscope think that it communicates with a genuine Siglent signal generator. The program extracts the commands sent to the generator, parses them and translates to the commands, which can be understood by the connected to the PC non-Siglent generator.

Do you have any plans to add support for the MHS-5200A?
https://www.eevblog.com/forum/testgear/mhs-5200a-serial-protocol-reverse-engineered/

Except for the UI and max. frequency the MHS-5200A looks functionally similar to the JDS6600 (but I'm unaware if their interface command language / format is similar).
« Last Edit: July 29, 2018, 04:03:08 pm by bluejedi »
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #2 on: July 29, 2018, 07:18:24 pm »
Currently I support only the devices I have. I'll add one more model which is very similar to BK4075.

It would be nice to add more generators but currently I have no idea how to do it without having the specific model. Maybe I'll have to work together with somebody who has it and can test my code.

Offline xenganier

  • Newbie
  • Posts: 1
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #3 on: August 07, 2018, 09:56:57 pm »
Thanks for doing this.  I have it working with an RPi3 running Dietpi and it works well except for a few glitches.  Especially on medium and high resolution modes the JDS6600 goes to zero frequency once in awhile, maybe three times on a 20-20k sweep.   In your video near the end on high res yours does it too.  I tried raising Sleeptime in steps up to 100ms but it didn't seem to make a difference.  Any idea what might be going on? 
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #4 on: August 11, 2018, 09:20:47 pm »
Thanks for doing this.  I have it working with an RPi3 running Dietpi and it works well except for a few glitches.  Especially on medium and high resolution modes the JDS6600 goes to zero frequency once in awhile, maybe three times on a 20-20k sweep.   In your video near the end on high res yours does it too.  I tried raising Sleeptime in steps up to 100ms but it didn't seem to make a difference.  Any idea what might be going on?
No. I'll try to understand when I have free time.

Offline ltwin8

  • Contributor
  • Posts: 12
  • Country: de
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #5 on: November 05, 2018, 07:03:36 pm »
Would be cool to just add a RPi into the JDS6600 Case and use LAN of it, but without display etc. is that possible? and yes how?

I have a RPi B, would it be enough?

thanks for the answers
 

Offline Dundarave

  • Regular Contributor
  • *
  • Posts: 156
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #6 on: November 21, 2018, 03:08:12 am »
Excellent work making the non-Siglent AWGs work with the SDS1004X-E!  :clap:  It's been fun to play with: I loaded the script up on a Raspberry PI and it worked brilliantly with the scope and my AWG.

Following your JDS6600.py driver file as a template, I've managed to modify it to support the FeelTech FY6600 AWG using a copy of the FY6600 comm protocol that I found somewhere on the net.  It works pretty well, but I had to crank the inter-command Sleeptime up to 500ms in order to reliably pass your test script:  It doesn't seem to affect anything with the actual Bode plotting activity, as the commands from the scope come relatively slowly.

I've tested it as much as I could, and I'd now like to make the driver file available to all: Can I email it to you for inclusion in your Git repository? Or is there a better way to make it available?  Note - Jan. 27/19: Added fy6600.py & the FY6600 comm protocol here per a reader request.

Cheers -
« Last Edit: January 28, 2019, 05:36:08 am by Dundarave »
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 29335
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #7 on: November 21, 2018, 04:47:58 am »
Excellent work making the non-Siglent AWGs work with the SDS1004X-E!  :clap:  It's been fun to play with: I loaded the script up on a Raspberry PI and it worked brilliantly with the scope and my AWG.

Following your JDS6600.py driver file as a template, I've managed to modify it to support the FeelTech FY6600 AWG using a copy of the FY6600 comm protocol that I found somewhere on the net.  It works pretty well, but I had to crank the inter-command Sleeptime up to 500ms in order to reliably pass your test script:  It doesn't seem to affect anything with the actual Bode plotting activity, as the commands from the scope come relatively slowly.

I've tested it as much as I could, and I'd now like to make the driver file available to all: Can I email it to you for inclusion in your Git repository? Or is there a better way to make it available?

Cheers -
Welcome to the forum.

How large is it ? Up to 1 Mb you can attach it to a reply/post even if it's not a permitted file type by just adding .(dot)<permitted type> and mentioning to remove .dot<permitted type>.

Avid Rabid Hobbyist.
Some stuff seen @ Siglent HQ cannot be shared.
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #8 on: November 21, 2018, 06:51:01 am »
Excellent work making the non-Siglent AWGs work with the SDS1004X-E!  :clap:  It's been fun to play with: I loaded the script up on a Raspberry PI and it worked brilliantly with the scope and my AWG.

Following your JDS6600.py driver file as a template, I've managed to modify it to support the FeelTech FY6600 AWG using a copy of the FY6600 comm protocol that I found somewhere on the net.  It works pretty well, but I had to crank the inter-command Sleeptime up to 500ms in order to reliably pass your test script:  It doesn't seem to affect anything with the actual Bode plotting activity, as the commands from the scope come relatively slowly.

I've tested it as much as I could, and I'd now like to make the driver file available to all: Can I email it to you for inclusion in your Git repository? Or is there a better way to make it available?

Cheers -
My script is open source. You can open a pull request on GitHub and I'll merge the changes with the main repository. If you don't want to deal with GitHub you can just send me your version of the script and I'll add your changes myself.

The only thing I'll ask you is to test your driver as good as possible, because I don't own a FY6600 and therefore I'm not able to test it myself.

Thanks for your work.
« Last Edit: November 21, 2018, 12:47:10 pm by 4x1md »
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #9 on: November 21, 2018, 06:54:22 am »
Would be cool to just add a RPi into the JDS6600 Case and use LAN of it, but without display etc. is that possible? and yes how?

I have a RPi B, would it be enough?

thanks for the answers
It seems possible. You'll have to connect its UART to the JDS6600. If you want to work directly with the scope without using the LAN, the RPi must also run a DHCP server. You'll also need a power supply which can provide enough power to both AWG and RPi.

Offline ltwin8

  • Contributor
  • Posts: 12
  • Country: de
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with non-Siglent AWG
« Reply #10 on: November 21, 2018, 07:58:30 pm »
Can someone post a guide on facebook on how to run this on a raspberry and how to connect? (unidentified AWG, unable to connect to AWG) I dont get my scope to connect to the Raspberry.

Maybe someone can upload an image of the SD card for the raspberry? I have no experience in raspberry and linux with respect to this task.

Would be very lucky if someone could help me. Thanks
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #11 on: January 30, 2019, 10:09:46 pm »
I uploaded the FY6600 driver to the main repository on GitHub. Sorry for such a long delay.

Dundarave, thanks for your contribution.

Offline Andreax1985

  • Regular Contributor
  • *
  • Posts: 64
  • Country: it
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #12 on: January 31, 2019, 09:34:26 am »
Is this good also for FY6800 AWG model?
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #13 on: January 31, 2019, 09:39:33 am »
Is this good also for FY6800 AWG model?
I'm not familiar with FY6800. You can try to run the awg_tests.py and see if it works.

Offline gamerpaddy

  • Regular Contributor
  • *
  • Posts: 55
  • Country: de
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #14 on: February 06, 2019, 01:24:40 pm »
Could this be ported onto a Microcontroller with networking?
Like a Arduino with Network shield or ESP8266/32 over wifi?
<i may have asked this a while ago on one of your youtube videos, cant remember>

Unfourtainly i lack the skills to do this, but it seems more cost effective than using a raspberry pi.

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #15 on: February 07, 2019, 08:51:03 am »
Could this be ported onto a Microcontroller with networking?
Like a Arduino with Network shield or ESP8266/32 over wifi?
<i may have asked this a while ago on one of your youtube videos, cant remember>

Unfourtainly i lack the skills to do this, but it seems more cost effective than using a raspberry pi.
It may be possible but I can't say anything about ESP8266/32 because I've never worked with them and I don't know if they have enough ROM and RAM for such program.

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #16 on: February 07, 2019, 09:02:30 am »
Defiantly can be emulated, you just need to emulated a few commands, Basicwave, Output and IDN

For the IDN String you can look into the earlier python project for converting the commands for another brand AWG,

The scope uses output to turn on the AWG output, then justs broadcasts basicwave with different fixed frequencies for each measurement step.

I should also mention you don't need anything as grand as a VI library to deal with SCPI messages, just treat them like standard packets
« Last Edit: February 07, 2019, 09:04:01 am by Rerouter »
 
The following users thanked this post: 4x1md

Offline gamerpaddy

  • Regular Contributor
  • *
  • Posts: 55
  • Country: de
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #17 on: February 08, 2019, 07:09:12 am »
there's certainly enough ram/flash available for this kind of stuff.
i tried my best but after 6 hours and headache im only halfway there, but at the most inefficient way possible. i bet this gets the worst code 2019 award.

I managed to make the "test connection" thing succeed and the siglent allready sent me some AWG parameters.
im using a arduino leonardo with a Ethernet shield, LAN cable directly into the scope.



 
The following users thanked this post: 4x1md

Offline MrTick

  • Newbie
  • Posts: 6
  • Country: pl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #18 on: April 23, 2019, 11:26:55 am »
Hi this is my very first message on eevblog, so hello everybody! :)

I've just recently got my hands on SDS1104X-E and I was looking for the solution to connect it to FY6800 AWG.
Thanks 4x1md for reverse engineering the Siglent communication protocol and your very nice solution.
But as I think using pc/raspberry to just translate the messages is an overkill, I've implemented similar code for ESP8266.

FY6800 has a nice uart connector on the back, the logic levels are 3,3V, the VCC is 5V however, so you need to find some way to drop it to 3.3V.
(I've realized that just when writing this post, fortunately my ESP-01 survived all tests fed directly from 5v. Currently I just soldered yellow LED in series, it seems to be dropping the voltage to ~3.2V)

I've used the simplest ESP-01 module.

Currently only FY6800 is supported, FY6600 and clones should work also.

https://github.com/PanKaczka/espBode

To compile the code I'm using the standard Arduino-ESP library: https://github.com/esp8266/Arduino

To use it in your own environment you need to edit esp_config.h, so WiFi mode, network name and password matches your network configuration.
 
The following users thanked this post: 4x1md, MikeLud

Offline tinhead

  • Super Contributor
  • ***
  • Posts: 1918
  • Country: 00
    • If you like my hacks, send me a donation
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #19 on: April 23, 2019, 11:44:29 am »
Hi this is my very first message on eevblog, so hello everybody! :)

Hi ho

I've implemented similar code for ESP8266

cool, dzieki/thanks Jakub
I don't want to be human! I want to see gamma rays, I want to hear X-rays, and I want to smell dark matter ...
I want to reach out with something other than these prehensile paws and feel the solar wind of a supernova flowing over me.
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #20 on: April 23, 2019, 06:09:15 pm »
I've just recently got my hands on SDS1104X-E and I was looking for the solution to connect it to FY6800 AWG.
Thanks 4x1md for reverse engineering the Siglent communication protocol and your very nice solution.
But as I think using pc/raspberry to just translate the messages is an overkill, I've implemented similar code for ESP8266.

FY6800 has a nice uart connector on the back, the logic levels are 3,3V, the VCC is 5V however, so you need to find some way to drop it to 3.3V.
(I've realized that just when writing this post, fortunately my ESP-01 survived all tests fed directly from 5v. Currently I just soldered yellow LED in series, it seems to be dropping the voltage to ~3.2V)

I've used the simplest ESP-01 module.

Currently only FY6800 is supported, FY6600 and clones should work also.
Welcome and thank you very much for sharing this project.

It can be a good idea to develop a small PCB with a simple circuitry for voltage and logic level conversion. It can even be made like a plug which fits the rear connector of the AWG.

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5126
  • Country: bt
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #21 on: April 23, 2019, 06:42:23 pm »
Would it be possible to create following setup:
- ESP8266 module
- DDS 0-60MHz 2Vpp out, wired to the ESP module
and use it with 1104X-E as the AWG?
Readers discretion is advised..
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #22 on: April 23, 2019, 06:44:47 pm »
Would it be possible to create following setup:
- ESP8266 module
- DDS 0-60MHz 2Vpp out, wired to the ESP module
and use it with 1104X-E as the AWG?
I think yes. 2Vpp out must be defined in Bode settings of the oscilloscope.

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #23 on: April 23, 2019, 06:46:10 pm »
The PCB I'm speaking about can be something like this one but with a female header connector which can be plugged directly into FY6600/JDS6600.
 
The following users thanked this post: helloitsme

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 218
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #24 on: April 24, 2019, 03:35:52 am »
I just ordered some ESP-01 and goodies to see if I can get my FY6800 and SDS1104X-E play nice.
« Last Edit: April 24, 2019, 03:56:43 am by MikeLud »
 

Offline Old Printer

  • Frequent Contributor
  • **
  • Posts: 759
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #25 on: April 24, 2019, 03:57:28 pm »
I have only had my 1104x-e a week now so still feeling my way along. Right now my best AWG is my Analog Discovery 2. While limited in frequency, it's other controls are pretty versatile. This has me wondering about the possibility to interface these two...
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #26 on: April 24, 2019, 06:39:47 pm »
I have only had my 1104x-e a week now so still feeling my way along. Right now my best AWG is my Analog Discovery 2. While limited in frequency, it's other controls are pretty versatile. This has me wondering about the possibility to interface these two...
It may be possible but I'm not familiar with this device so I can't tell you more.
 
The following users thanked this post: commongrounder

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 218
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #27 on: April 27, 2019, 04:18:32 am »
I modified an ESP-01 Adapter as shown in photos below and I am having issues with communication. It work for about 30 seconds to a minute then I get the error shown in photo below. I tried several delay settings but had no luck. Does anyone know how to get it to work.

Thanks in Advance,

Mike
 

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 218
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #28 on: April 27, 2019, 04:28:07 am »
MrTick

I added a Pull Request to fix a compile issue I had.
« Last Edit: April 27, 2019, 04:58:08 am by MikeLud »
 
The following users thanked this post: MrTick

Offline MikeLud

  • Regular Contributor
  • *
  • Posts: 218
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #29 on: April 28, 2019, 01:48:20 am »
I figured out what was causing my communication issues. It was having the scope set to DHCP, once I set the scope to a static IP it works like a charm. Below are some photos of the final setup.

4x1md & MrTick,

Thanks for all of your hard work on this great non-Siglent AWG hack. :-+

Mike
« Last Edit: April 28, 2019, 03:15:20 am by MikeLud »
 
The following users thanked this post: 4x1md, aimc

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #30 on: June 01, 2019, 05:01:03 pm »
Has anybody tried my code with Bode Plot II from the new FW 6.1.33?
« Last Edit: June 01, 2019, 05:03:33 pm by 4x1md »
 

Offline MrTick

  • Newbie
  • Posts: 6
  • Country: pl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #31 on: June 02, 2019, 09:43:25 am »
Has anybody tried my code with Bode Plot II from the new FW 6.1.33?

Hi, thanks for the heads up, I've just upgraded my SDS.
I've tested only my ESP SW, though it communicates exactly same like your implementation.
It still works without any problems, no additional AWG verifications were introduced :)

I'm attaching sample sweep output from a diy 40db attenuator.
 

Offline rf-loop

  • Super Contributor
  • ***
  • Posts: 4134
  • Country: fi
  • Born in Finland with DLL21 in hand
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #32 on: June 02, 2019, 04:07:03 pm »


Hi, thanks for the heads up, I've just upgraded my SDS.
I've tested only my ESP SW, though it communicates exactly same like your implementation.
It still works without any problems, no additional AWG verifications were introduced :)

I'm attaching sample sweep output from a diy 40db attenuator.



If look your image it looks weird. Exept it tell your AWG is working with Siglent what was perhaps main thing.

But then, your setup and settings are possible totally mess.

What signal goes to reference channel (Ch1)

First make sure your signal source (AWG) output go  to your DUT (in your case your selfmade attenuator) input and exactly same signal goes to Ch1 (as long as you have not defined other channel for reference).
Then your DUT (device under test - your attenuator) output goes to Ch2 (because in your image you have selected it (or it is just as scope default).

First it need be sure these signal connections are ok.

Then need look about your BodePlot II settings are right if need.

Basic signal connections (user can free select channels including what is ref channel)

You have measured attenuator but your display show "40 - 60dB" amplifier.


In attached image Ch4 is selected for DUT out but scope factory default is Ch2
(Ch4 is selected for main DUT out in image related to other things = with 1 in 1 out system can keep 1GHz samplerate but also Ch4 is far from Ch1 so it may crosstalk with strong reference signal bit less than Ch2 if need get all out from dynamic range = in basic works just forget this and happy use Ch1 Ch2 pair)
« Last Edit: June 02, 2019, 04:14:14 pm by rf-loop »
EV of course. Cars with smoke exhaust pipes - go to museum. In Finland quite all electric power is made using nuclear, wind, solar and water.

Wises must compel the mad barbarians to stop their crimes against humanity. Where have the (strong)wises gone?
 

Offline MrTick

  • Newbie
  • Posts: 6
  • Country: pl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #33 on: June 02, 2019, 06:20:20 pm »
If look your image it looks weird. Exept it tell your AWG is working with Siglent what was perhaps main thing.

But then, your setup and settings are possible totally mess.

You are totally right.

First I've swapped CH1 and CH2, so the reference was connected wrongly to a CH2 instead of CH1.
That's why all results should be basically multiplied by -1 (or - better, the connection should be fixed and measurements done again).

Second: calling my device a 40dB attenuator is an insult for attenuators :)
It's just bunch metalized resistors soldered together and clamped into a BNC connector, it behaves correctly up till ~10MHz, then it's good only for testing Bode plots :)
 
The following users thanked this post: bicycleguy

Offline aimc

  • Contributor
  • Posts: 19
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #34 on: September 03, 2019, 12:51:39 am »
This looks very interesting. I am wondering though if the scopes communication protocol is the same for serial USB? Did you try to communicate with the Arduino? I am thinking along the line of using one USB (to the scope) and the simple serial connection to the FY6800. The Leonardo (32U4) would be suitable as it has 4 UART's that can be used with the serial(1...n) library. Do you think that is a doable approach? I have worked successfully with asynchronous handshakes between a Leonardo and an ESP, so it would require some changes to your code and of course hardware. Even with USB to the FY6800 (in which case you may need a second MCU for the USB chip) I think this could be a better solution since you don't need to depend on a WiFi connection in your local network. The extra cable and PSU plug pack should not be a problem.

Let me know what you think.
cheers
 

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #35 on: September 03, 2019, 05:59:12 am »
This looks very interesting. I am wondering though if the scopes communication protocol is the same for serial USB? Did you try to communicate with the Arduino? I am thinking along the line of using one USB (to the scope) and the simple serial connection to the FY6800. The Leonardo (32U4) would be suitable as it has 4 UART's that can be used with the serial(1...n) library. Do you think that is a doable approach? I have worked successfully with asynchronous handshakes between a Leonardo and an ESP, so it would require some changes to your code and of course hardware. Even with USB to the FY6800 (in which case you may need a second MCU for the USB chip) I think this could be a better solution since you don't need to depend on a WiFi connection in your local network. The extra cable and PSU plug pack should not be a problem.
Is may be a good idea. As far, as I know, these Chinese AWGs can provide 5V on their rear header connector. It means that you'll not need an additional PSU for the external USB-AWG connection board. It will be interesting to try but the problem is that I'm not familiar with USB protocols. I'd be happy to work together with somebody on this.

Offline MrTick

  • Newbie
  • Posts: 6
  • Country: pl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #36 on: September 03, 2019, 09:47:03 am »
Handling the USB using AVR devices was always a tricky issue.
USB signals can reach dozens of Mbps that frequently is hard to handle for 16MHz CPUs.
https://www.obdev.at/products/vusb/index.html is a good place to start.
Another thing would be to connect Siglent AWG to PCs USB and see what kind of device shows up. It's possible that it's just another serial-usb COM port, then the direct USB-AWG interface should be doable on a AVR.

Another thing, if you don't want to use external WiFi network you may use 8266 in an access-point mode, where the scope would connect directly to the network generated by AWG and no additional routers/networks is necessary.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #37 on: September 03, 2019, 09:49:58 am »
The scope shows up as a test and measure device, the AWG as a class I have not seen before.
« Last Edit: September 03, 2019, 10:07:21 am by Rerouter »
 

Offline MrTick

  • Newbie
  • Posts: 6
  • Country: pl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #38 on: September 03, 2019, 09:57:24 am »
Both the scope and the AWG show up as USB class SCPI devices.
That sounds promising. SCPI is basically a text protocol often exchanged via more or less exotic serial implementation. I'll try to connect some arduinos to the scope when I'm back at home.

Would it be possible for you to share the USB Vendor/Device IDs of the Siglent AWG? (We'll probably need that to mimic the AWG with Arduino)
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #39 on: September 03, 2019, 10:06:44 am »
For the scope its
USB Test and Measurement Device
VID: F4EC
PID: EE38
REV: 9999

For the AWG its
USB Serial Bus Devices
Description: SAG1021
VID: F4ED
PID: EE3A
REV: 0100
Manufacturer: Shenzhen Siglent Co., Ltd.
Device Instance Path: USB\VID_F4ED&PID_EE3A\SAG10DAQ1R0000 (zero'd out my serial number)

If you need anything else, just ask, as i would be interested in knowing how to drive the thing from windows.
« Last Edit: September 03, 2019, 10:12:48 am by Rerouter »
 

Offline aimc

  • Contributor
  • Posts: 19
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #40 on: November 04, 2019, 03:28:54 pm »
I am also thinking along using the build-in USB FTDI of any Arduino board to communicate with the scope. Especially then the simple serial RS232 library could be used. Downside is that debugging via this port is no longer available, but this could be temporarily managed by alternative means (e.g. via a I2C LCD Display). More importantly is the question if this serial <-> USB FTDI can be used on the scope at all, and what parameters (baud rate etc.) are appropriate? Did anyone here experiment with this? The scope's USB accepts any PC connection and WiFi dongle, but what does it do with the FTDI that requires a driver on a PC? Also then the USP could power the Arduino board and all levels to the FeelTech remain 5V TTL. Only concern is the connection of the scope and AWR grounds, that where we all know might be problematic with the FeelTech. But then again this will happen anyways via the grounds of the DUT. Any input is appreciated, thanks in advance :)
 

Offline aimc

  • Contributor
  • Posts: 19
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #41 on: December 07, 2019, 08:14:08 pm »
Just wanted to let you know that I opened a pull request on your GIT repo - adding the STL's for a enclosure - if you are interested that is... Otherwise the fork is available at https://github.com/AimcLsc/espBode. (sorry for the crudity, I am new to GIT...)
 

Offline BlackICE

  • Regular Contributor
  • *
  • Posts: 225
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #42 on: February 25, 2020, 07:26:49 am »
I want to thank MrTick for the ESP code he put on GitHub. I downloaded to and modified it to work with an ESP32 that I had already. I haven't fully tested it yet. But go it to communicate with the scope and it isn't complaining when I run a fake bode plot without any input or outputs.

The ESP32 has 3 serial ports so I used one for debug output and another for talking to the FY6900. I had change some code because a member function availableForWrite() doesn't exist for the ESP32 libraries.


/* availableForWrite() doesn't exist for esp32 so we do differently

        while(!client.availableForWrite());
        client.write((uint8_t*)&response, sizeof(rpcresp_getport));

*/

changed to:

        while (sizeof(rpcresp_getport) != client.write((uint8_t*)&response, sizeof(rpcresp_getport)))
   DEBUG("ERROR: client.write2");
;


#include <ESP8266WiFi.h>

changed to

#include <esp_wifi.h>

 

Offline BlackICE

  • Regular Contributor
  • *
  • Posts: 225
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #43 on: March 25, 2020, 06:11:07 am »
Just noticed the waveforms were distorted, had jitter in timing and amplitude. Turns out powering an ESP32 from the 5V output on the back is drawing too much current. After I disconnecting the 5V wire the waveforms were now as before.
« Last Edit: March 30, 2020, 11:31:41 pm by BlackICE »
 

Offline BlackICE

  • Regular Contributor
  • *
  • Posts: 225
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #44 on: March 30, 2020, 11:30:58 pm »
Using the bode II stimulus in units other than amplitude (eg. dBV, dBu) doesn't work. I looked at the code and those commands are not being handled. The FY6900 I have doesn't have those units either but it should be strait forward to convert from dB units to amplitude to get the desired results, although the FY6900 display will show volts. Any interest for me to do so and to post the code back to GitHub?
 

Offline ewaller

  • Contributor
  • Posts: 29
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #45 on: May 01, 2020, 09:49:24 pm »
I have been playing with 4x1md's code and have expanded on it quite a bit. And have ported it to Python 3.

I now have a full blown CLI program that controls an FY6800 allowing control of both channels for waveform, amplitude, offset and duty cycle.  It can control modulation, VCO and counter functions, and can upload wave forms to the instrument.  I used 4x1md's code to provide the a server that emulates a Siglent generator so this can be used as an external source for Bode plots (works great, by the way).   

The major difference is that I use a Raspbery-pi running ser2py to expose the USB-serial instrument to a TCP/IP network to permit streaming via TCP socket.

And, still a bit hackish, wrote some code to covert black and white graphic images from raster to vector format, and generate waveform files that can be uploaded to the instrument as X channel and Y channel wave forms that are then displayed on an XY scope.

If there is any interest, I can clean this up and put it on Github.  I would like to give 4x1md a chance to review it first as well.   Here is a screen shot of this morning's hack session:
 
The following users thanked this post: tautech, tv84, nikitasius

Offline ewaller

  • Contributor
  • Posts: 29
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #46 on: May 01, 2020, 09:51:21 pm »
Another example
 
The following users thanked this post: nikitasius, maskedviperus

Offline 4x1mdTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: il
    • 4X1MD on Github
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #47 on: May 01, 2020, 09:55:47 pm »
Yes, I'd like to see the improvements and merge them to the master branch. I think, that now, thanks to the coronavirus, I'll have free time for code maintenance.

Offline cdc3oo

  • Newbie
  • Posts: 7
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #48 on: May 25, 2020, 07:44:06 am »
Yes, I'd like to see the improvements and merge them to the master branch. I think, that now, thanks to the coronavirus, I'll have free time for code maintenance.

Hello

First time poster.

First of all, I want to warmly thank you for sharing your code.

I tried to run master on WIN and had issues with Python 2.7 or 3.7 raising errors. Also, wireshark showed oddities in some RPC replies payload.
I decided to fix these, simplified the server code a little bit and worked on the statements giving errors at runtime.

Actually connectivity test is working like a charm with 6.1.33 while protocol is OK according to wireshark
I have to check it works well end to end with the Feeltech (no other AWG here) and also to do non-regression tests on a *nix machine.

If interested, I can send you the diff once I'm done with this.

« Last Edit: May 25, 2020, 07:49:18 am by cdc3oo »
awful newbie
 

Offline acugnini

  • Newbie
  • Posts: 3
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #49 on: May 26, 2020, 05:51:34 pm »
Is it possible to upload a waveform to the SDS1202X-E?  I know downloading is possible, using either EasyScopeX or by opening an IP socket, but what about the reverse?  (I want to upload a waveform and then perform an FFT on the data.) --agc
« Last Edit: May 26, 2020, 08:37:32 pm by acugnini »
 

Offline cdc3oo

  • Newbie
  • Posts: 7
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #50 on: May 27, 2020, 06:00:57 am »
Using the bode II stimulus in units other than amplitude (eg. dBV, dBu) doesn't work. I looked at the code and those commands are not being handled. The FY6900 I have doesn't have those units either but it should be strait forward to convert from dB units to amplitude to get the desired results, although the FY6900 display will show volts. Any interest for me to do so and to post the code back to GitHub?

Hello I missed your post before writing my first one...

Unless you already did it, here is the code which should work with others AWGs:


            elif args[n] == "AMPDBM":
                 self.awg.set_amplitude(channel, 0.77459*2.82843*pow(10,float(args[n+1])/20))
                 n += 2


« Last Edit: May 27, 2020, 03:36:09 pm by cdc3oo »
awful newbie
 

Offline timkoers

  • Contributor
  • Posts: 21
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #51 on: June 29, 2020, 01:10:38 pm »
Hi all!

I am planning to buy a AWG that is supported by this awesome hack.

Is there any list with (un-)officially supported AWG's, with their development status?

At first I looked for the JDS6600 but now I'm leaning towards the FY6800 or FY6900.
 

Offline aljordan

  • Newbie
  • Posts: 1
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #52 on: July 26, 2020, 04:31:25 pm »
Thank you very much for creating this script and making it available. It works great with a Koolertron signal generator, which appears to be a re-branded jds6600 available on Amazon. I first tried running it from my laptop running Manjaro Linux, but the oscilloscope wouldn't connect. Maybe the ports were locked down. Instead I installed pip and pyserial on a Raspberry Pi running Diet Pi and had no issues connecting and running plots.

Thanks again.
 

Offline ptype

  • Newbie
  • Posts: 3
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #53 on: September 17, 2020, 04:16:46 pm »
I tried this today with a FY2300 and it worked the first attempt with no problems.  Thanks!

For those who would rather not open a port as root, there is a built-in way to do internal NAT (port forwarding) in Linux.

First open up awg_server.py

and change

  RPCBIND_PORT = 111
  VXI11_PORT = 703


to

  RPCBIND_PORT = 8000
  VXI11_PORT = 8001


next run this at the commandline to set up the port forward

  sudo iptables -t nat -A PREROUTING -p tcp --dport 111 -j REDIRECT --to-port 8000

Now you can run bode.py as an unprivileged user (no sudo needed):

  python bode.py <awg_name> <serial_port> <baud_rate>

clean up the port forward at any time with a reboot.  There are also iptables commands to delete the port forward but that seemed like TMI for this post.


 
The following users thanked this post: arvidb

Offline Archades

  • Contributor
  • Posts: 10
  • Country: au
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #54 on: September 28, 2020, 05:48:37 am »
Has anyone tried this with a Uni-T UTG962?
 

Offline puterboy

  • Regular Contributor
  • *
  • Posts: 55
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #55 on: November 11, 2020, 04:28:22 pm »
Will this work with a FeelTech 6900?
I.e. will the code for the 6800 also work for the 6900?
 

Offline puterboy

  • Regular Contributor
  • *
  • Posts: 55
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #56 on: November 11, 2020, 04:32:18 pm »
Hi Mike,
This is *really* cool.
I would love to create such a slick setup for my FeelTech 6900, but I am unsure of the details.
Would it be possible to summarize what you did, including:
1. What hardware/boards for the microcontroller as well as the UART & WiFi
2. What if any hardware hacking was needed?
3. What software version you used?
4. How you programmed the microcontroller?
5. How do I know if it's working? :)

I am a bit of Newbie here so would appreciate any help as it has been hard for me to glean the details from the various posts on this thread.
 

Offline puterboy

  • Regular Contributor
  • *
  • Posts: 55
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #57 on: November 11, 2020, 04:38:23 pm »
I figured out what was causing my communication issues. It was having the scope set to DHCP, once I set the scope to a static IP it works like a charm. Below are some photos of the final setup.


Yes, there seems to be a bug with DHCP on the Siglent 1104/1204-X-E whereby it connects/disconnects intermittently but is rock stable with static IPs.

Here is a post on eeVblog where I did some troubleshooting on when/where the error occurs.
https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-and-sds1204x-e-bode-plot-with-non-siglent-awg/
 

Offline JamesLynton

  • Contributor
  • Posts: 35
  • Country: gb
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #58 on: November 19, 2020, 02:54:00 am »
Has anyone tried this with a Uni-T UTG962?

I'd like to see it done too, got one of these on the way as well as its a nice compact source for debugging stuff on the move; and with a nice ui to boot.

Having dug abit in the pc control software manual for it, it uses the USBTMC (USB Test and Measurement Class) protocol for remote control and editing, it shouldn't be too difficult to sniff those usb packets on sending those commands from the software to see exactly what it'd expect to implement similar.

Sigrok (the bus sniffer software project) links to the documentation for this standard here:
https://sigrok.org/wiki/USBTMC
and links to code used for working with the USBTMC SCPI protocol here:
https://sigrok.org/gitweb/?p=libsigrok.git;a=blob;f=src/scpi/scpi_usbtmc_libusb.c
 

Offline jbaribeault

  • Contributor
  • Posts: 13
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #59 on: December 01, 2020, 03:40:16 am »
I just picked up a UNI-T UTG962E as well. Ready/willing to run anything required to help with the effort - this is a nice little unit and would go AWESOME with my SDS1204X-E....
 

Offline timkoers

  • Contributor
  • Posts: 21
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #60 on: December 08, 2020, 07:11:19 pm »
I updated the code of espBode to include the FY6900. I also opened a merge request but that doesn't seem to get merged any time soon.

https://github.com/timkoers/espBode
 

Offline masterx81

  • Frequent Contributor
  • **
  • Posts: 493
  • Country: it
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #61 on: December 08, 2020, 11:17:17 pm »
I updated the code of espBode to include the FY6900. I also opened a merge request but that doesn't seem to get merged any time soon.

https://github.com/timkoers/espBode
Thanks! I have ordered my 1104x-e, so now that i can connect it to my fy6900 👍👍
 

Offline jbaribeault

  • Contributor
  • Posts: 13
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #62 on: December 14, 2020, 05:19:59 pm »
How fast does the signal gen need to react to the commands from the scope? Myself and a few others managed to get python sending commands to the UNI-T 962G but the only thing they've implemented is button pushes and on a single one at a time - fastest we seem to be able to set a new waveform is about 0.85 seconds. Is this going to be fast enough or do the waveforms need to change faster than that?
 

Offline masterx81

  • Frequent Contributor
  • **
  • Posts: 493
  • Country: it
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #63 on: December 16, 2020, 12:23:28 am »
ESP-01 (espbode) + FY6900 works perfectly!
Love it!
Thanks for your work!
In past i've used microchip mcu where you had only few KB of flash and some byte of ram, it's incredible how powerful is this esp-01 little thing 😱
 

Offline masterx81

  • Frequent Contributor
  • **
  • Posts: 493
  • Country: it
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #64 on: December 16, 2020, 09:02:25 pm »
I think that there must be a bug on the esp code (both forks), I'm trying to set a sweep with center frequency 20MHz, 5MHz wide, and the esp hang, also stop responding to ping (seem stuck in a loop). I've still not attached the logic analyzer to see what's going on...
Little question, as i'm not familiar with arduino projects... How can be debugged this thing? The tx/rx pins are connected to the awg so i can't output anything   :-BROKE
 

Offline vfxsoup

  • Newbie
  • Posts: 5
  • Country: gb
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #65 on: January 30, 2021, 07:31:44 pm »
To the OP, this works with the FY6900 just fine* using the FY6600 code.

*I had to hack the second channel to turn on alongside channel 1 on the FY6900 (in fy6600.py), as the SDS1104X-E needs a direct connection from the AWG along side the output from the DUT as a reference, otherwise the Bode plot is just a mess of spurious data points. For some reason the scope wasn't requesting channel 2 to switch on, so I just told it to enable channel 2 as per channel 1 and everything worked fine (all other settings are sent to channel 2 of the FY6900).

Thanks for writing this code!
 
The following users thanked this post: 4x1md

Offline nichrist

  • Newbie
  • Posts: 6
  • Country: gr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #66 on: February 07, 2021, 09:39:52 am »
Hi
I am considering buying the SDX1204 and I would like to known if it would be possible to use it in conjunction with a Rigol AWG DG1062 which I already have, for drawing Bode plots.

Thank you in advance
 

Offline TechieTX

  • Contributor
  • Posts: 41
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #67 on: March 07, 2021, 10:15:50 pm »
I have a FY2300 coming on a slow boat from China (is it a coincidence it's called a Junk?)  ;D

I'm going to mod the FY2300 board to put switched 5V on the USB connector, and hook it to an ESP8266 D1 Mini clone board.  I'll let ya know how it goes, masterx81.  From the earlier comment by ptype, it's likely to work.  I have the programming manual for the 2300 and also for the 6600/6800/6900.  They look the same, but there may be a couple of gotchas I can fix.
"No matter where you go, there you are." ~BB
 

Offline Roman oh

  • Regular Contributor
  • *
  • Posts: 50
  • Country: au
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #68 on: March 25, 2021, 12:02:00 am »
I've been reading through this thread with interest (thank you everyone who has contributed!), having recently bought a new 1104X-E (and made it into a 1204X-E with all options - thanks also to those people!) and having ordered an FY6900.
So I have a simple question, the answer to which is clearly inferable from this thread, but not stated anywhere I can see - which suggests there may be something I am missing.
It appears from this thread that communication between the CRO and the FY6900 is via WiFi. My Siglent manual clearly states that the AWG connects via USB, and doesn't suggest any options.
What am I missing?  Where does the magic happen?
 

Offline rf-loop

  • Super Contributor
  • ***
  • Posts: 4134
  • Country: fi
  • Born in Finland with DLL21 in hand
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #69 on: March 25, 2021, 07:51:36 am »
I've been reading through this thread with interest (thank you everyone who has contributed!), having recently bought a new 1104X-E (and made it into a 1204X-E with all options - thanks also to those people!) and having ordered an FY6900.
So I have a simple question, the answer to which is clearly inferable from this thread, but not stated anywhere I can see - which suggests there may be something I am missing.
It appears from this thread that communication between the CRO and the FY6900 is via WiFi. My Siglent manual clearly states that the AWG connects via USB, and doesn't suggest any options.
What am I missing? Where does the magic happen?

What are missing. You have missed to read the User manual.

Here attached, rest you find yourself.
If you have old User manual, first update it. https://www.siglenteu.com/download/10068/




EV of course. Cars with smoke exhaust pipes - go to museum. In Finland quite all electric power is made using nuclear, wind, solar and water.

Wises must compel the mad barbarians to stop their crimes against humanity. Where have the (strong)wises gone?
 

Offline Roman oh

  • Regular Contributor
  • *
  • Posts: 50
  • Country: au
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #70 on: March 25, 2021, 08:27:09 am »
Thanks, rf-loop, the manual you pointed at UM0101E-05A is a lot more comprehensive than the one I downloaded (-03A) from the Siglent site when I received my CRO just three months ago. Never imagined that the versions would move so fast. The old version doesn’t mention this configuration function, but of course the new one does.
So now I know ...
Thanks again.
I love this site and really appreciate all the help you guys give!

EDIT: I've spent a bit of time looking more closely at both versions of the manual. The bit about WiFi connection to the AWG is indeed in the "old" manual, in the section called "Bode Plot" (replaced in the "new" manual with a more comprehensive "Bode Plot II"). In both manuals, however, the preamble to the AWG section still refers to USB only. So you were correct, I simply didn't read hard enough!
But one significant difference I did find is that the new manual drops the (OT - unrelated to AWG) statement "SDS1000X-E has full BW with all V/div settings including 500uV/div to 2mV/div." Off to look at other threads to see what this is about....

Edit#2: Ah, so I was kinda wrong and kinda right after all. It seems that WiFi connection to the AWG is only available for BodeII, and the manual is correct. The "broader" AWG functionality appears to require the AWG connection via USB, otherwise the AWG simply isn't detected and the AWG menu button is greyed out. I guess this is mentioned somewhere above...sorry for the repeat, if so.
« Last Edit: March 29, 2021, 05:57:49 am by Roman oh »
 

Offline mTron47

  • Newbie
  • Posts: 9
  • Country: ch
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #71 on: May 07, 2021, 02:47:02 pm »
This being my first post I say Hi to everyone  :)

And many thanks to all contributors to this helpful, inspiring, awesome thread.  :clap: It did help me connect my time-proven "Synthesized Function Generator" DS345 built by Stanford Research Systems some time in the Nineties to my newly acquired Siglent SDS1104X-E for doing Bode Plots.

I used an ESP32 which I am familiar with, and took BlackICE's port (post #97 - Thanks, also to MrTick!) as a starting point.  I wrote a class cds345 in which I put all the specifics of the DS345 generator. Some minor modifications to the function handleWriteMsg() in file esp_parser.cpp were necessary and the correction of a bug in function sendReadResponse() in file esp_network.cpp which led to heap corruption from time to time. So everything seems to work now and might be a starting point for other generator types beyond FX6800, FY6900 and DS345.

Usually I do controller software development using Platformio which has a much more sophisticated user interface compared to the classic Arduino IDE. The differences in code are minimal - e.g. an additional line #include <Arduino.h> is necessary. So this should not be a significant obstacle to understandability.

This said, I want to share my little contribution with you, but I don't know how.  :-[ I do not have a github account. Any suggestions?
 

Offline DEV001

  • Contributor
  • Posts: 47
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #72 on: May 07, 2021, 05:51:48 pm »
I believe Github would be the best medium to use for sharing your code and it is pretty easy to sign up. Once you sign up, you create a new 'repository' via the + in the right corner of their site and upload the files. You can use their web interface and drag and drop the files into a git repository directly.

If you don't want to upload it to Github you can attach a zip archive of the source to a post here as well.

https://docs.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository

https://github.blog/2016-02-18-upload-files-to-your-repositories/
 

Offline mTron47

  • Newbie
  • Posts: 9
  • Country: ch
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #73 on: May 08, 2021, 09:11:16 am »
@DEV001: Thank you for your help.

So here comes a zip-file to the entire project linking an SDS1*04X-E scope to an SRS signal generator DS345. Included is the file platformio.ini defining the build process under Platformio.

If you prefer the classic Arduino environment, just copy all files (without platformio.ini) from all subdirectories into a new directory esp32Bode, then rename esp32Bode.cpp into esp32Bode.ino. That's it!
 

Offline Roman oh

  • Regular Contributor
  • *
  • Posts: 50
  • Country: au
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #74 on: May 31, 2021, 02:16:07 pm »
I am struggling to get the Bode plot thing happening with  a Siglent 1104X-E and FY6900. The software is running OK on an ESP8266; CRO reports successful connection to AWG, and pumps out the messages I would expect as observed on the Serial out of the ESP8266 (although it appears to send each message twice??).
But the 6900 does not respond to the message stream when it's connected to the Rx pin on the 8 pin connector on the back panel. I can "see" the traffic with a CRO, so it's definitely there.  When I send messages manually (using PuTTY) to the 6900 via its USB connector,  it responds correctly. When I send those same messages in via the RxD and TxD pins on the back panel (using USB to serial converter) there is no response from the 6900.
 
The circuit diagram appears to show a CH340G with its RxD and TxD lines simply wire-OR'ed with the back panel connections (using limiting resistors) but does not show any connection between this circuit element and the FY6900's "processor" FPGA. Since the USB is working, I guess the CH340 is OK, and beyond that it's just a couple of resistors.

Tomorrow I'll open the box - AGAIN! - and check those resistors, but I think it's far more likely to be something trivial I've overlooked.

Can anyone help?
 

Offline UniSoft

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: kz
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #75 on: May 31, 2021, 06:20:30 pm »
But the 6900 does not respond to the message stream when it's connected to the Rx pin on the 8 pin connector on the back panel.

The circuit diagram appears to show a CH340G with its RxD and TxD lines simply wire-OR'ed with the back panel connections (using limiting resistors) but does not show any connection between this circuit element and the FY6900's "processor" FPGA. Since the USB is working, I guess the CH340 is OK, and beyond that it's just a couple of resistors.
I had the similar problem...
RxD and TxD goes to MCU (4pin cable)
Now they use CH340N  >:(, it looks like this shit IC makes LOW level (i.e. ground) on signal pins (when USB not connected)...
so you just simple get resistor divider by 2!!!
So instead of 3.3V signals there was less than 1.6V, what was not enough for MCU and therefore it not respond.



 
The following users thanked this post: Roman oh

Offline Roman oh

  • Regular Contributor
  • *
  • Posts: 50
  • Country: au
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #76 on: June 01, 2021, 12:26:38 am »
Thanks, unisoft. I didn’t get that the MCU was actually on the front panel pcb. That helps a lot. I know what to do now, I think. Did you find a fix?
 

Offline UniSoft

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: kz
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #77 on: June 02, 2021, 07:34:12 pm »
Did you find a fix?
I just reduced the resistance of the resistors coming from the TTL connector ...
 

Offline Roman oh

  • Regular Contributor
  • *
  • Posts: 50
  • Country: au
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #78 on: June 03, 2021, 12:02:24 pm »
Yes, it’s clearly a (nother!) design fault. They have a 2K2 resistor at R20 (unnecessarily) isolating the CH340 Tx pin instead of at R19 isolating the Rx pin, so the input on the TTL connector sees a 300 ohm to 300 ohm divider, instead of a 300 into 2200, which would have worked. The simplest “fix” would be to swap R19 and R20. However,  their design also feeds nominal 5V to the 3.3v MCU and appears to rely on the resistors to limit the current into the MCU pin. The MCU has had its ID ground off, so I can’t know whether the inputs are 5V tolerant; the voltage at the pin is about 3.9v which is one diode drop above the 3.3V rail. Don’t know if this is good or bad.

I went a bit more complex and made up a simple 4-transistor 3-input gate/level-shifter (I want a 3rd input because I envisage putting the 8266 inside the box, and may want to also “play” with the TTL inputs some time.

All working now.
 

Offline Geeboh

  • Newbie
  • Posts: 7
  • Country: 00
  • Audio Enthuthiast - EE Noobs
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #79 on: October 13, 2021, 09:08:05 pm »
Hi guys, After following this thread including Mr. tick's esp01 bode plot github code.

Problem :
When trying to hook up my 1104x-e to fy6900 via ESP01s, my scope will gone completely freeze while attempt connect with the ESP01 and in the same time the ESP01 also will restart in this process.

Until now i try so many things get it work even personally pm mr tick through youtube and yet seems that i cant find the solution.

Anyone here can guide me on how to connect esp01 with 1104x-e.

Thank you in advance
Just started get into Electronic engineering as a hobbyist. I'm just a noobs. Any tips or test gear donation will accept at open heart ... Just kidding
 

Offline duckman

  • Newbie
  • Posts: 2
  • Country: pl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #80 on: January 11, 2022, 08:16:12 pm »
I found the cause and solution to the problem.
You have to downgrade esp8266 boards library to 2.7.4.
I had installed the 3.0.1 library which caused erroneous writing to the esp8266 memory. Now everything works as it should😁
 
The following users thanked this post: ceut

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1308
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #81 on: January 14, 2022, 05:55:12 pm »
If I understand the architecture of the code correctly, if I wanted to add an HP GPIB device to the drivers, I would copy one of your drivers, change the serial interface (to the signal generator) to for instance, PYGPIB or VISAPY (can't remember what it is called) and then translate the commands in the class to the correct output over GPIB?

I was thinking of just coding the VXI using VISA in VB.net but this would be easier.

Thanks

Jerry
 

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1308
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #82 on: January 15, 2022, 09:09:25 am »
I read thru the code and it looks like I can use PYGPIB and/or PYVISA in the awg driver but I can't get either working on this one machine.  I have another exactly like it, in fact I cloned this one to make the other, both are dual socket with 32GB of memory, etc, and it works fine, go figure, this one wont open GPIB devices no matter how many time I reinstall, etc.  Looking at the awg driver, I wrote a function in vb.net that sends commands to the HP8904 generator through a console application.  So the awg driver will call the console app until I get PYVISA working on this machine.

I'd like to note for those following this project that the author wrote a ton of code for this application.  The OP did a very complete job, all the class functions seem clean and simple and adding the driver concept so that you can call a specific driver for each external generator makes it expandable.

Thanks!

Jerry
 

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1308
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #83 on: January 16, 2022, 01:07:40 am »
I wrote the basic driver for the hp8904.  I have a few errors, one I bypassed having to do with checking the class of the driver. I thought I set that up correctly in awg_factory.py having followed the example.

The code then sits waiting for a bind request from the scope.  When I hit run/stop or connection test, the PC code gets the request but then fails:

Code: [Select]
Incoming connection from 192.168.165.128:43969.
Traceback (most recent call last):
  File "C:\Users\user-1\Downloads\sds1004x_bode-master\sds1004x_bode-master\sds1004x_bode\bode.py", line 50, in <module>
    server.start()
  File "C:\Users\user-1\Downloads\sds1004x_bode-master\sds1004x_bode-master\sds1004x_bode\awg_server.py", line 104, in start
    self.main_loop()
  File "C:\Users\user-1\Downloads\sds1004x_bode-master\sds1004x_bode-master\sds1004x_bode\awg_server.py", line 115, in main_loop
    res = self.process_rpcbind_request()
  File "C:\Users\user-1\Downloads\sds1004x_bode-master\sds1004x_bode-master\sds1004x_bode\awg_server.py", line 135, in process_rpcbind_request
    procedure = self.bytes_to_uint(rx_data[0x18:0x1c])
  File "C:\Users\user-1\Downloads\sds1004x_bode-master\sds1004x_bode-master\sds1004x_bode\awg_server.py", line 353, in bytes_to_uint
    num = ord(bytes_seq[0])
TypeError: ord() expected string of length 1, but int found

The code looks like it is expecting a port address there.  I dumped the rx_data and it is port 3 (00000003) as expected.  I have a feeling the bytes_to_uint function might be working differently under windows.  I also looked at the next statement where it checks if the data is coming from VXI-11 Core (395183) and that data looks correct 0607af.  I changed the function instead of (ord( to ord(chr(
as in num = ord(chr(bytes_seq[0])) and got past that error and it is now trying to send the bind response and having the inverse of that problem building the reply into bytes.

I could recode it but I don't know python all that well and would hate to have to change everything when one simple config change is all it needs.

  If there is an interest in fixing this, I'll get the code running for the HP8904 and a few other HP generators that I have.  I ordered a 1032x but it would be nice to have the HP8904 running as it is a decent, multichannel generator with a relatively clean output. 

I think getting past the bind is pretty key.  This is running under windows, by the way.  I communicate to the 8904 with gpib using a console application that just funnels the translated commands to it.

Thanks

Jerry
« Last Edit: January 16, 2022, 02:35:02 am by cncjerry »
 

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1308
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #84 on: January 16, 2022, 10:08:18 am »
For those, if any, who :=\ are interested, this is a great foundation for using non Siglent generators.  The primary issue though, is using it on windows and specifically, using python3.  Python3 has a number of explicit changes, and in addition to having to change all the print statements, byte arrays and strings that were somewhat the same prior to python3 now throw errors when they are concatenated using the "+" sign.  Again, python isnt my first language, but I got it working to the point where it has to reply to the ID request. This is one of the responses that has a string embedded in byte arrays (e.g. the ID of the siglent generator it spoofs) so I have to look at it more closely or just hard code all the responses since after that they are just null.

Bottom line is that I havent given up.  I figure once i get this HP8904 working it will be a nice setup for audio work.  I've used it in the past with my distortion analyzer as they are compatible. I have 4 or 5 HP generators for which I can write gpib drivers.

But since the scope is just measuring the voltage during a sweep, one could just as easily send gpib commands to the generator, query the scope and just dump the data into excel.  I was impressed with RF-loop's bode dissertation though, enough to order a sdg1032x.

More to come.

Jerry
 

Offline 2N3055

  • Super Contributor
  • ***
  • Posts: 7182
  • Country: hr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #85 on: January 16, 2022, 10:46:43 am »
For those, if any, who :=\ are interested, this is a great foundation for using non Siglent generators.  The primary issue though, is using it on windows and specifically, using python3.  Python3 has a number of explicit changes, and in addition to having to change all the print statements, byte arrays and strings that were somewhat the same prior to python3 now throw errors when they are concatenated using the "+" sign.  Again, python isnt my first language, but I got it working to the point where it has to reply to the ID request. This is one of the responses that has a string embedded in byte arrays (e.g. the ID of the siglent generator it spoofs) so I have to look at it more closely or just hard code all the responses since after that they are just null.

Bottom line is that I havent given up.  I figure once i get this HP8904 working it will be a nice setup for audio work.  I've used it in the past with my distortion analyzer as they are compatible. I have 4 or 5 HP generators for which I can write gpib drivers.

But since the scope is just measuring the voltage during a sweep, one could just as easily send gpib commands to the generator, query the scope and just dump the data into excel.  I was impressed with RF-loop's bode dissertation though, enough to order a sdg1032x.

More to come.

Jerry

Yeah, FRA from Siglent (the one in the scope that you use with Siglent AWG) is not only measuring voltage.
It's a hell of a lot more complicated than that.
So if you can make a gateway device that will make 3rd party gen properly respond to commands from scope and make it properly emulate Siglent AWG then you're good.
Otherwise it will be easier just to buy cheapest Siglent  AWG than to write proper FRA application..
 

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1308
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #86 on: January 16, 2022, 11:38:41 pm »
so I went back and installed python2.7.18 on my windows machine after playing with linux all day.

Test connection is successful and the commands come over when I press run.  I just have to clean-up some of the HP8904 command conversions to set the amplitude and frequency.

Pretty cool.  I wish I would have just install python 2.7 prior to ordering the SDG1032x, ha!

I'll post the HP8904 code after I clean it up.  Then I am going to do my 8648D, 8350, and a couple others I have as they all use the same gpib format and the commands are close.

Jerry
 

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1308
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #87 on: January 20, 2022, 05:23:48 am »
update:

I have both the HP8648 and HP8904 working thru gpib.  It's a little tricky because I had to use a VP.Net console program to drive the GPIB until I get PYGPIB or PYVISA working on this stupid machine that just refuses to work...

I then started thinking about this little AD9910 generator I have that sits on an Arduino Mega2560 as a shield.  There are a bunch out there made by "GRA&AFCH" originally. The AD9910 is very clean for a DDS with ≤ −125 dBc/Hz @ 1 kHz offset (400 MHz carrier) and 80dB SFDR.  The nice thing about it is that it is small and can run off USB. It only has +4dBm output so it needs an amp on it.  I also had to change the code so that it took a 10Mhz reference as an input.

I have a 1032x coming and I am going to try to trace the USB setup and commands, most likely it presents as an HID compliant device and I've coded that before. But in the meantime, the AD9910 board I have can connect to the OP's code as a serial device using a VCP.  The AD9910 board didn't have serial commands until I just added them.  I only added Frequency and Amplitude, On and Off as I think that is pretty much all the scope sends of importance.

If anyone is interested in any of this, drop me a PM.

Jerry
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 29335
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #88 on: January 20, 2022, 06:38:42 am »
update:

I have both the HP8648 and HP8904 working thru gpib.  It's a little tricky because I had to use a VP.Net console program to drive the GPIB until I get PYGPIB or PYVISA working on this stupid machine that just refuses to work...

I then started thinking about this little AD9910 generator I have that sits on an Arduino Mega2560 as a shield.  There are a bunch out there made by "GRA&AFCH" originally. The AD9910 is very clean for a DDS with ≤ −125 dBc/Hz @ 1 kHz offset (400 MHz carrier) and 80dB SFDR.  The nice thing about it is that it is small and can run off USB. It only has +4dBm output so it needs an amp on it.  I also had to change the code so that it took a 10Mhz reference as an input.

I have a 1032x coming and I am going to try to trace the USB setup and commands, most likely it presents as an HID compliant device and I've coded that before. But in the meantime, the AD9910 board I have can connect to the OP's code as a serial device using a VCP.  The AD9910 board didn't have serial commands until I just added them.  I only added Frequency and Amplitude, On and Off as I think that is pretty much all the scope sends of importance.

If anyone is interested in any of this, drop me a PM.

Jerry
Looking forward to the comparison Bode plot screenshots from your 4 signal sources.  :popcorn:
Avid Rabid Hobbyist.
Some stuff seen @ Siglent HQ cannot be shared.
 

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1308
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #89 on: January 20, 2022, 08:20:38 am »
It will be interesting to see how the much source impacts the plot.  I didnt think of running a comparison.

The source I`m excited about is that little DDS board.  It generates clean signals up to at least  1Gig.   I have a few broadband amps I can use after it and then I can make the power adjustment in the driver ( for the amp).  I plan to make a box with a splitter in it to have the dual outputs for phase.  Sort of like the external box they sell.  I'm not suggesting this board as an alternative, but if you have it, I think it will, work great as a source.

Jerry
 

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1308
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #90 on: January 21, 2022, 06:28:27 pm »
Here's some interesting findings, at least to me :-DD.  I was measuring a Microchip SLP-27+ DC low pass filter used on the references for my phase noise measuring system.

The AD9910 seems to have a level issue below 10Mhz.  I have to look into that.  I know it is transformer coupled.  So in order to use it for this application it would need to have an amp and lookup table that would be written into the driver.  Then again, it only costs around $110, but it is a very clean DDS.

I also had to add a 1 second delay between frequency changes, maybe it can be reduced with faster serial settings, I was using 115200.

I then ran it using and HP8648C.  You can see the output on the low end of the amplitude scale is pretty flat.  I tried it with and without a delay in the code, without much change, if any:

And with a delay.

Sorry, the images are sequentially listed below.  Don't know why they didn't insert.


My SDS1032x comes tomorrow and I'll try that out as well.
« Last Edit: January 21, 2022, 06:31:03 pm by cncjerry »
 

Offline cncjerry

  • Supporter
  • ****
  • Posts: 1308
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #91 on: January 21, 2022, 06:45:31 pm »
Here's something I don't understand.  If you check above, the image from the 8648c is pretty flat across, slightly above 29dB.

I ran it again and now it is displaying as slightly above 26dB yet the voltage, as displayed on the line above the buttons, is roughly the same as the previous run, ~735mv.
Any idea what would be causing this?  Nothing changed, just went out and back into the Bode plot function.

 

Offline SMB784

  • Frequent Contributor
  • **
  • Posts: 421
  • Country: us
    • Tequity Surplus
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #92 on: January 21, 2022, 06:54:42 pm »
Has anyone tried to do Bode plotting with a Rigol DG811/DG992?  Is it feasible?
 
The following users thanked this post: arvidb

Offline puterboy

  • Regular Contributor
  • *
  • Posts: 55
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #93 on: February 21, 2022, 02:38:19 pm »
Wondering whether it would be possible to rewrite the code in say bash script and then run the code directly on a rooted Siglent 1104.
The reason I say bash is so as not to have to load python and all its libraries and dependencies in the Siglent flash -- and while kludgy, bash is pretty powerful as a scripting language.
If so, then presumably the code could be written to Siglent flash, triggered from a web page and then you would just need a USB cable from the Siglent to the external signal generator.

This would make it as good (presumably) as the native version that controls a Siglent AWG.
 

Offline 2N3055

  • Super Contributor
  • ***
  • Posts: 7182
  • Country: hr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #94 on: February 21, 2022, 04:27:35 pm »
Wondering whether it would be possible to rewrite the code in say bash script and then run the code directly on a rooted Siglent 1104.
The reason I say bash is so as not to have to load python and all its libraries and dependencies in the Siglent flash -- and while kludgy, bash is pretty powerful as a scripting language.
If so, then presumably the code could be written to Siglent flash, triggered from a web page and then you would just need a USB cable from the Siglent to the external signal generator.

This would make it as good (presumably) as the native version that controls a Siglent AWG.

Sounds cool but:
how do you connect from scope to that internal service? TCP/IP ?
Over loopback?  On same 111 and 5024 and 5025 ports scope is already using for itself?

Why do all that crap to the scope when RaspberyPi is so cheap? It makes no sense to me...
 

Offline puterboy

  • Regular Contributor
  • *
  • Posts: 55
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #95 on: February 22, 2022, 05:33:15 pm »
Wondering whether it would be possible to rewrite the code in say bash script and then run the code directly on a rooted Siglent 1104.
The reason I say bash is so as not to have to load python and all its libraries and dependencies in the Siglent flash -- and while kludgy, bash is pretty powerful as a scripting language.
If so, then presumably the code could be written to Siglent flash, triggered from a web page and then you would just need a USB cable from the Siglent to the external signal generator.

This would make it as good (presumably) as the native version that controls a Siglent AWG.

Sounds cool but:
how do you connect from scope to that internal service? TCP/IP ?
Over loopback?  On same 111 and 5024 and 5025 ports scope is already using for itself?

Why do all that crap to the scope when RaspberyPi is so cheap? It makes no sense to me...

I already have a Raspberry Pi Zero connected (and I power it from the my FY6900 signal generator using the pins on the back that give 5v & ground output).

Why? Because it would be a cool hack and would eliminate the need for another piece of hardware and cables.
 

Offline masterx81

  • Frequent Contributor
  • **
  • Posts: 493
  • Country: it
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #96 on: February 22, 2022, 05:48:38 pm »
I'm doing it with an esp01 module placed on the back of the FY6900, powered from the AWG. I think that a Rasp.Pi is a bit an overkill for that task.
 

Offline 2N3055

  • Super Contributor
  • ***
  • Posts: 7182
  • Country: hr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #97 on: February 22, 2022, 05:58:17 pm »
Wondering whether it would be possible to rewrite the code in say bash script and then run the code directly on a rooted Siglent 1104.
The reason I say bash is so as not to have to load python and all its libraries and dependencies in the Siglent flash -- and while kludgy, bash is pretty powerful as a scripting language.
If so, then presumably the code could be written to Siglent flash, triggered from a web page and then you would just need a USB cable from the Siglent to the external signal generator.

This would make it as good (presumably) as the native version that controls a Siglent AWG.

Sounds cool but:
how do you connect from scope to that internal service? TCP/IP ?
Over loopback?  On same 111 and 5024 and 5025 ports scope is already using for itself?

Why do all that crap to the scope when RaspberyPi is so cheap? It makes no sense to me...

I already have a Raspberry Pi Zero connected (and I power it from the my FY6900 signal generator using the pins on the back that give 5v & ground output).

Why? Because it would be a cool hack and would eliminate the need for another piece of hardware and cables.

Your scope is already using same TCP ports for scope remote control...
 

Offline puterboy

  • Regular Contributor
  • *
  • Posts: 55
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #98 on: February 23, 2022, 10:52:50 pm »
I'm doing it with an esp01 module placed on the back of the FY6900, powered from the AWG. I think that a Rasp.Pi is a bit an overkill for that task.

Well I already have a (small) RPI Zero powered off the back of my FY9600 that I use to create a USB over Ethernet -- which allows me to remote control from a distance. So I could use the same RPI to also do Bode plots...
 

Offline ceut

  • Regular Contributor
  • *
  • Posts: 158
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #99 on: April 22, 2022, 03:18:54 pm »
Hello everyone  :)

After having bought a SDS1104X-E (with some advices from Tautech I thanks  ;) )  I found this topic.
So I have bought an EPS8266 with an USB programmer.
I have never used this little card, even never heard of it  :(  (in France, I find that we are a little too late with technology, and it is getting worse :-[ )

So after flashing the ESP Bode, my ESP8266 is connected successfully  to my Asus router (merlin fw 8) ) in client mode, I have put it in DHCP and get the IP in the Asus  :-+

But I was having freezes with my brand new DSO many times, until I saw @duckman post, so I downgrade the library to 2.7.4 and no freeze at all now , thanks ! :D

The only problem is that I have a JDS6600, and I think the command translation is not for this AWG..Because my Siglent tries to do some graphics but the JDS doesn't change its output  :-\
So I would like to know if someone has modded the ESPBode to be compatible with the JDS command ?

Thanks !  :)
« Last Edit: April 22, 2022, 03:38:39 pm by ceut »
 

Offline ExHamHack

  • Newbie
  • Posts: 1
  • Country: au
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #100 on: May 12, 2022, 02:33:28 am »
Hi cent,

I have done some work getting this to work with a JDS2800. I suspect it may have a similar command structure to the JDS6600. It is not perfect and my coding ability is not great. I have it working, however I do get a few glitches occasionally. I suspect the JDS2800 gets overrun with the commands some times and misses one every so often, may be local network related too. I Let it run a couple of times and I usually get a clean sweep. 

In my situation I needed a fixed IP address and a pull up resistor on the ESP8266 module Tx pin.
If you point a web browser at the module IP address you should be able to see if it is working and what it is outputting even if its not compatible with your WaveGen

I have posted my updates to a Github fork at  https://github.com/Hamhackin/espBode/blob/master/JDS2800.md , it follow work done by others SQ6SFO and TimKoers.

 

Offline ceut

  • Regular Contributor
  • *
  • Posts: 158
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #101 on: May 15, 2022, 09:25:37 am »
Hi cent,

I have done some work getting this to work with a JDS2800. I suspect it may have a similar command structure to the JDS6600. It is not perfect and my coding ability is not great. I have it working, however I do get a few glitches occasionally. I suspect the JDS2800 gets overrun with the commands some times and misses one every so often, may be local network related too. I Let it run a couple of times and I usually get a clean sweep. 

In my situation I needed a fixed IP address and a pull up resistor on the ESP8266 module Tx pin.
If you point a web browser at the module IP address you should be able to see if it is working and what it is outputting even if its not compatible with your WaveGen

I have posted my updates to a Github fork at  https://github.com/Hamhackin/espBode/blob/master/JDS2800.md , it follow work done by others SQ6SFO and TimKoers.

Hello,
Thank you very much for your work !  :-+ :-+
I will try this later this day, as I have removed ESP and all from my JDS :-\


Edit: I have compared your "esp_jds2800.cpp" and the JDS6600 Communication Protocol PDF: it seems you have right  ;)
All commands starts with "w" and a number to, then, set the right value
Will post the result  :-+


Edit2: It works !
My JDS6600 seems to receive the good command, I have checked the voltage in Vpp and Vrms mode, and also frequency  :-+  It seems that this happens at about 1 time per second ?
Now I have to learn how to use it correctly and try to check a Focal speaker filter  :D

Also, I have not find any webserver on the ESP IP, so I don't know how to check the output ? ???
« Last Edit: May 15, 2022, 10:24:10 pm by ceut »
 

Offline ceut

  • Regular Contributor
  • *
  • Posts: 158
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #102 on: May 17, 2022, 08:38:50 pm »
Here is my integration on the back of my JDS6600.
My router is at about 4 meters, but the signal is weak, the integrated antenna is very small, I think I have to mod that now :-\

Maybe some of you have some (simple) ideas for modding this little PCB antenna ?  ???


Edit: I have switched my wifi to channel 13 and I have a lot better response from the ESP now  :-+
(from the ping cmd)
I will check but I think I don't have to mod the antenna now  8)
« Last Edit: May 17, 2022, 10:16:12 pm by ceut »
 

Offline ganevson

  • Contributor
  • !
  • Posts: 25
  • Country: bg
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #103 on: November 09, 2022, 07:40:29 pm »

Hello
Does anyone have experience with a Bode plot between the SDS1104X-E and the PSG9080?
Thanks
 

Offline NickKUK

  • Contributor
  • Posts: 10
  • Country: gb
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #104 on: November 10, 2022, 12:38:57 pm »
Hi,
I have used the 1104x-e bode plot with a standard Apple Mac mini phono jack before using a software AWG I wrote as an extension to a GitHub python project. I've dug out the python code and attached to the post. I suspect the same mechanism can be used to connect to any sound card and let the scope control the pitch (sorry no amplitude or other swanky features). On the Mac mini 2019 this worked from 5Hz to 20KHz before the active filters hit the sound.



I've since got a SDG1032X hacked to 60MHz so I've not used it for a bit.
« Last Edit: November 10, 2022, 12:40:35 pm by NickKUK »
 
The following users thanked this post: arvidb

Offline OsciX

  • Contributor
  • Posts: 16
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #105 on: January 17, 2023, 02:06:56 am »
Do you think that support for the Sony/Tektronix AWG2021 can be added? I understand this is a bit older than some of the generators here, so I'm mainly wondering if it's *technically* possible. I've done a fair bit of SCPI, and I wouldn't mind forking it to add my function generator :)
 

Offline istvan

  • Newbie
  • Posts: 3
  • Country: ro
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #106 on: April 29, 2023, 06:32:10 pm »
Hello, I read your post, I also have a jds6600 signal generator, and a siglent sds 2202x-e oscilloscope, I try to write the sketch on esp=01 (esp8266) via usb programmer, but every time a compilation error appears. can you help me, I don't know where I'm going wrong. how did you proceed step by step I'm not familiar with programming and I don't know where I'm going wrong. I followed the steps posted by Tim
here is massage: In file included from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_parser.h:5,
                 from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_network.cpp:4:
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_fy6800.h:91:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
   91 | #endif _ESP_FY6800_H_
      |        ^~~~~~~~~~~~~~
In file included from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:4:
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_fy6800.h:91:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
   91 | #endif _ESP_FY6800_H_
      |        ^~~~~~~~~~~~~~
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino: In function 'void loop()':
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:54:43: warning: 'WiFiClient WiFiServer::available(uint8_t*)' is deprecated: Renamed to accept(). [-Wdeprecated-declarations]
   54 |         rpc_client = rpc_server.available();
      |                                           ^
In file included from C:\Users\dell\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:40,
                 from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:1:
C:\Users\dell\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/WiFiServer.h:85:14: note: declared here
   85 |   WiFiClient available(uint8_t* status = NULL) __attribute__((deprecated("Renamed to accept().")));
      |              ^~~~~~~~~
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:64:43: warning: 'WiFiClient WiFiServer::available(uint8_t*)' is deprecated: Renamed to accept(). [-Wdeprecated-declarations]
   64 |         lxi_client = lxi_server.available();
      |                                           ^
In file included from C:\Users\dell\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:40,
                 from C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\espBode.ino:1:
C:\Users\dell\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/WiFiServer.h:85:14: note: declared here
   85 |   WiFiClient available(uint8_t* status = NULL) __attribute__((deprecated("Renamed to accept().")));
      |              ^~~~~~~~~
C:\Users\dell\Downloads\espBode-master (1)\espBode-master\espBode\esp_network.cpp: In function 'uint8_t handleVxi11(uint8_t*, WiFiClient)':
esp_network.cpp:222:1: error: control reaches end of non-void function [-Werror=return-type]
  222 | }
      | ^
cc1plus.exe: some warnings being treated as errors
exit status 1
control reaches end of non-void function [-Werror=return-type]
 

Offline jemarro12

  • Contributor
  • Posts: 21
  • Country: es
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #107 on: October 16, 2023, 07:26:30 pm »
As some users said previously, i'd like to use RIGOL DG911 as AWG.
I know some basic C from the programming course in University but certainly i´m really lost in pthon.
Could a more advanced programmer if it will be possible nor difficult to do that?
Thanks guys!
 

Offline switchleg

  • Newbie
  • Posts: 2
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #108 on: December 06, 2023, 12:32:37 am »
For anyone using a JDS6600 I have fixed the 0hz bug where the AWG does not take the desired frequency causing spikes in the bode plot.  Also supports ESP32 boards.

https://github.com/Switchleg1/espBode
 

Offline bigpriap

  • Newbie
  • Posts: 1
  • Country: ro
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #109 on: February 08, 2024, 08:27:09 pm »
2008274-02008280-1 [ Specified attachment is not available ] [ Specified attachment is not available ]  If you are like me, attracted by the idea of controlling FY6900-60M with Siglent,, as many succeeded, beware of the new models! bought one SDS1104X-E SW V 6.1.37R10, Uboot-OS V 8.3, FPGA V 2021-11-08 HW V 09-06 and one FeelElec FY6900-60M Version V1 .5 .5 .1. 3.I tried many versions of the espbode codes from Github, none works. Voltage settings are OK but if I set frequency, to say, 28Hz on Siglent the AWG is interpreting as 20 Mhz! So I can only run Bode plots betewwn 1 to 60 MHz., not exactly audio domain 😊
I believe is the same problem as I read about FY6900-100M, maybe a frequency digit more that its not backward compatible. I was trying to divide the frequency output on ESP sketch with no results. I am not good enough to modify the software without help but I am ready to test any ideas. Thank you.
P.S. Using the code posted in the previous post by by: switchleg  decimals works, so maybe THIS IS THE WAY. Thank U @by: switchleg!


« Last Edit: February 08, 2024, 09:02:45 pm by bigpriap »
 

Offline switchleg

  • Newbie
  • Posts: 2
  • Country: ca
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #110 on: February 28, 2024, 04:16:51 pm »
You are very welcome. Yes, I fixed multiple bugs and cleaned up the code a bit.
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1000X-E and SDS800X-HD: Bode plot with a non-Siglent AWG
« Reply #111 on: May 01, 2024, 02:02:31 pm »
The SDS800X-HD (SDS804X-HD/SDS814X-HD/SDS824X-HD) changed the initialization phase (uses UDP instead of TCP for the port mapping phase, and requires VXI port changes), and as a result, the original script does not work on that scope.
In case you "upgraded" your scope and still want to use the script, see my repo https://github.com/hb020/sds1004x_bode/

I based my fork on the work from Don Becker, and went from there. It includes the following improvements:

* Python 3 migration (Python 2 is dead)
* AD9910 Arduino Shield (thanks Don Becker)
* Rigol DG800/DG900 series AWGs over Ethernet or USB. In theory, you might even be able use this implementation to connect to other Ethernet or USB connected SCPI 1992.0 standard compatible devices.
* Unit-T Uni-Trend UTG1000x (thanks alfredfo) (since 2024-06-27)
* more Feeltech FY devices (since 2024-08-25), and support for the newer fy6900 models (since 2024-09-14)
* multiple small bug repairs
* better VISA compliance. Now this script can be used as a VISA compatible front-end to the AWGs (faking a Siglent AWG), independently from a Siglent scope
* (much) better logging control

Opened a PR into the original repo.

EDIT: updated to latest content, since I got a PR on my fork. Will keep doing so if/when they arrive, and will add dates.
« Last Edit: September 18, 2024, 10:31:21 pm by bateau020 »
 

Offline Knutselaar

  • Newbie
  • Posts: 6
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #112 on: May 25, 2024, 06:06:28 pm »
Hi All,

This is my first post of EEVblog, and I thank everybody for the real work they have done to make this possible.

I have only been shopping here, combined all and made some minor changes.

I've been struggeling with connecting FY6900 SWVersion 1.5.5.1.3 (delivered nov 2023) to my SDS1104X-E SWVersion 6.1.37R10 (delivered may 2024):

The result of my struggle:


I use the espBode-master date 08-12-2020

I had to add ESP_Telnet to my library

I use in the Arduino IDE: the library ESP8266 by ESP8266 community version 2.7.4

In SDS1104X-E Utility--page2/4--I/O--IP Set-- DHCP Disabled

I have discovered that the SDS1104X-E only remembers the first 9 charachters of the WiFi PSK after power down!

I use the TL-WN725N WiFi adapter from TP-LINK for my SDA1104X-E, the WiFi signal must be strong, otherwise you have no steady connection!

I use a 3V3 regulator in my adapter between the ESP01S and FY6900. The uP in de FY6900 has a 3V3 interface. The CH340 has also a 3V3 interface.

In my FY6900 the resistors between CH340 and TTL connector and uP are:
R30 and R32 are 300 Ohm between TTL and uP, R19 and R20 are 2k between CH340 an uP, no need to change!

In esp_config.h change:
*******************************************************************
#define WIFI_MODE_AP
//#define WIFI_MODE_CLIENT

/* WiFi credentials */
#define WIFI_SSID             "wlan_ssid"
#define WIFI_PSK              "wlan_key"

/* Comment this for DHCP. However you'll need to obtain IP somehow. */
#define STATIC_IP
*******************************************************************
 
Into

*******************************************************************
//#define WIFI_MODE_AP
#define WIFI_MODE_CLIENT

/* WiFi credentials */
#define WIFI_SSID             "Your_wlan_ssid"
#define WIFI_PSK              "Your_wlan_key"// no more than 9 charachters, otherwise you have to change your password of your network first

/* Comment this for DHCP. However you'll need to obtain IP somehow. */
//#define STATIC_IP
*******************************************************************
 

The compilerfault:
esp_network.cpp:222:1: error: control reaches end of non-void function [-Werror=return-type]
  222 | }

I inserted quick and dirty an extra line with return 0; in the file esp_network.cpp at line 222, and had no problems afterwards.

Original code: in file "esp_network.cpp" at end of function: "uint8_t handleVxi11(uint8_t *packet, WiFiClient client)"
*******************************************************************
         client.write((uint8_t*)&write_response, sizeof(rcpresp_devReadWrite));
        return 0;
        break;
    }
 }
*******************************************************************
Inserted line with return 0; at line 222:
*******************************************************************
         client.write((uint8_t*)&write_response, sizeof(rcpresp_devReadWrite));
        return 0;
        break;
    }
    return 0;
}
*******************************************************************

The problem of frequency adjustment in the new FY6900 60MHz mentioned by bigpriap a few posts back:

I have changed in esp_fy6900.cpp line 64 and 73 from

snprintf(command, 19, "WMF%08lu000000\n", frequency);

 Into

snprintf(command, 19, "WMF%08lu\n", frequency);


In order to see the IP adress of your ESP01S you have to remove the slashes on line 56 of esp_config.h
//#define DEBUG_PRINTS
becomes:
#define DEBUG_PRINTS

Compile and write to the ESP01S

Start the EPS01S an look at the Serial monitor.

After reading and writing down the IP adress (to be used in the bode plot-menu of the SDS1104X-E), put the slashes back:

//#define DEBUG_PRINTS

and compile and write to the ESP01S and the ESP01S is ready to be used.



Ik hope that this information helps others to get it working.


 

Offline Knutselaar

  • Newbie
  • Posts: 6
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #113 on: May 29, 2024, 08:38:46 pm »
Some improvements:


I have encountered loss of connection on a following day.
I checked the IP-adress of the ISP01S and it was different than the day before.

So I changed to static IP-adress in the ESP01S in "esp_config.h":
The choice for "192.168.0.155" is because the network gives IP-adresses upwards from
"192.168.0.100", so 155 is not likely to have double IP's in a home network.
****************************************************
#define STATIC_IP

/* Static ip configuration */
#ifdef STATIC_IP
  #define ESP_IP              192,168,0,155 // 192,168,0,??? is equal to your network
  #define ESP_MASK            255,255,255,0
  #define ESP_GW              192,168,0,0   // 192,168,0,??? is equal to your network
#endif
****************************************************
Above changes are implemenred in the new espBode-master.ZIP file below.

Also in the SDS1104X-E I swiched DHCP Off and set the static IP-adress to 192.168.0.150

I have the Amplitude and Frequency of CH2 coupled to CH1.

The SDS1104X-E sends every frequency command twice to CH1, I stopped the second message.

I also added the driver for the FY3224S as signal generator for the bode plot.

Here are the schematic of the ESP01S coupled to the FY3224S and the source-files espBode-master.




 

Offline Knutselaar

  • Newbie
  • Posts: 6
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #114 on: May 29, 2024, 08:43:39 pm »
Second attempt attatchment espBode-master.zip
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #115 on: August 29, 2024, 01:27:18 pm »
I realize this is a very late response, and I may be about to "teach grandma to suck eggs" as the saying goes (tell you what you already know) ... apologies if that is the case.

On choosing an IP address - Knutselaar suggests 192.168.0.155, with the idea that 155 is unlikely to be taken. This is probably going to work most of the time, assuming one's wifi router is set to start addresses at 192.168.0.100 ... but there is a better way: Most (nearly all?) wifi routers will allow you to reserve IP addresses, generally by MAC. Once reserved, you can be confident that no other device will receive that IP address from the router.

Again, I apologize if I am repeating the obvious / mansplaining / etc.!
« Last Edit: August 29, 2024, 05:07:50 pm by awakephd »
 

Offline das_strobel

  • Contributor
  • Posts: 13
  • Country: de
Re: Siglent SDS1000X-E and SDS800X-HD: Bode plot with a non-Siglent AWG
« Reply #116 on: September 06, 2024, 10:14:43 am »
The SDS800X-HD (SDS804X-HD/SDS814X-HD/SDS824X-HD) changed the initialization phase (uses UDP instead of TCP for the port mapping phase, and requires VXI port changes), and as a result, the original script does not work on that scope.
In case you "upgraded" your scope and still want to use the script, see my repo https://github.com/hb020/sds1004x_bode/

Thanks for this work. I cloned your repo and tried it with my brand new SDS1000X HD and my old Rigol DG1062Z (predecessor of the DG800 series) and it works beautifully using "dg800" for the awg parameter. So again: Great work!

I few small comments:

I'm using Ubuntu 22.04 LTS and the lates Python available from the default repos is 3.11, default is 3.10. You have a few debug strings that use the relaxed f-format syntax from 3.12. This unnecessarily breaks the script for the older versions. I fixed it on my side (it is just replacing a few double quotes with single quotes) and then everything works. I'd suggest you might want to change this to make the script more compatible. I can provide you a PR to your repo if you wish.

There is way of running this script without sudo, which enabled me to use the debugger on the script in vscode without running the whole vscode as root:
Code: [Select]
sudo setcap 'CAP_NET_BIND_SERVICE+ep' /bin/python3.10
Downside is this enables all python instances to be able to serve privileged ports... But I found this more convenient for debugging.

The final comment will probably only apply to very few people but I wanted to share my findings. Maybe it helps somebody. I got this error message when I started the script:
Code: [Select]
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  [...]
  File ".../sds1004x_bode/sds1004x_bode/awg_server.py", line 88, in create_socket
    sock.bind((host, port))
OSError: [Errno 98] Address already in use
This was due to the fact that on my Linux machine rpcbind was running which is needed by nfs.server. After temporarily stopping it using the command
Code: [Select]
sudo systemctl stop rpcbind.socket rpcbind.service
the script finally worked. Rpcbind can be started again with
Code: [Select]
sudo systemctl start rpcbind.socket rpcbind.service
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #117 on: September 06, 2024, 10:20:47 am »
...I cloned your repo
...few small comments

Thanks for the heads up. I will add the proposed changes and comments to the repo. A PR would be best, but I will try to reproduce, since it seems easy to do.
 

Offline das_strobel

  • Contributor
  • Posts: 13
  • Country: de
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #118 on: September 06, 2024, 10:52:11 am »
A PR would be best, but I will try to reproduce, since it seems easy to do.

To spare you some work here is the git diff
Code: [Select]
$ git diff
diff --git a/sds1004x_bode/awg_server.py b/sds1004x_bode/awg_server.py
index 59b1958..b8aea46 100644
--- a/sds1004x_bode/awg_server.py
+++ b/sds1004x_bode/awg_server.py
@@ -101,7 +101,7 @@ class AwgServer(object):
 
         print("Starting AWG server...")
         print(f"Listening on {self.host}")
-        print(f"RPCBIND on {"UDP" if self.portmap_on_udp else "TCP"} port {self.rpcbind_port}")
+        print(f"RPCBIND on {'UDP' if self.portmap_on_udp else 'TCP'} port {self.rpcbind_port}")
         print(f"VXI-11 on TCP port {self.vxi11_port}")
 
         print("Creating sockets...")
diff --git a/sds1004x_bode/awgdrivers/dg800.py b/sds1004x_bode/awgdrivers/dg800.py
index 0db9c19..3b60f0e 100644
--- a/sds1004x_bode/awgdrivers/dg800.py
+++ b/sds1004x_bode/awgdrivers/dg800.py
@@ -26,6 +26,7 @@ WAVEFORM_COMMANDS = {
 # Default AWG settings
 DEFAULT_LOAD = 50
 DEFAULT_OUTPUT_ON = False
+DEBUG_OUT = True
 
 
 class RigolDG800(BaseAWG):
@@ -100,7 +101,7 @@ class RigolDG800(BaseAWG):
             self.enable_output(2, on)
         else:
             self.channel_on[channel - 1] = on
-            self._send_command(f":OUTPUT{channel}:STATE {"ON" if on else "OFF"}")
+            self._send_command(f":OUTPUT{channel}:STATE {'ON' if on else 'OFF'}")
 
     def set_frequency(self, channel: int, freq: float):
         if DEBUG_OUT:
diff --git a/sds1004x_bode/awgdrivers/utg1000x.py b/sds1004x_bode/awgdrivers/utg1000x.py
index b0437be..96af648 100644
--- a/sds1004x_bode/awgdrivers/utg1000x.py
+++ b/sds1004x_bode/awgdrivers/utg1000x.py
@@ -100,7 +100,7 @@ class UTG1000x(BaseAWG):
             self.enable_output(2, on)
         else:
             self.channel_on[channel - 1] = on
-            self._send_command(f":CHAN{channel}:OUTPUT {"ON" if on else "OFF"}")
+            self._send_command(f":CHAN{channel}:OUTPUT {'ON' if on else 'OFF'}")
 
     def set_frequency(self, channel: int, freq: float):
         if DEBUG_OUT:

 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #119 on: September 06, 2024, 11:25:28 am »
Done. Added some better debugging in the port opening. Tested under Python 3.8. and later.
 
The following users thanked this post: das_strobel

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #120 on: September 11, 2024, 10:48:06 pm »
I have just gotten a FeelTech FY6900-60M (running firmware version 1.5.4), and was eager to try connecting it to my SDS804X-HD scope using either of the methods discussed in this thread. I first tried the espBode route, making a simple adapter board to connect to the TTL power and serial connector on the back. I downloaded Knutselaar's code, as it seemed to be the most recent (and has a recent success) and uploaded it to an ESP-01 using the Arduino IDE with no problems. I then connected it to the FY6900. I am getting the 3.3v power out of my regulator, and the ESP-01 is connecting to my network. I can ping it with no problems. But the scope refuses to recognize it when I set up the wifi to connect to the ESP-01.

I tried using telnet to connect to the ESP-01. The connection appeared to be successful. However, I could not generate any response from the FY6900 regardless of the command I tried to send it. I am not at all confident that this approach would work in any case ... or should it?

So, I have just now tried the python sds1004x-bode program, the version by bateau020 that adds the ability to talk with the SDS804X. I'm running on Ubuntu 24.04.

I was able to start the program, and it appears to connect to the FY6900, or thinks it does ... and the SDS804X can connect successfully. But apparently the FY6900 is not responding to the commands:

Code: [Select]
sudo python3 bode.py fy -udp
Initializing AWG...
AWG: fy
Port: /dev/ttyUSB0
IDN: fy
AWG initialized.
Starting AWG server...
Listening on 0.0.0.0
RPCBIND on UDP port 111
VXI-11 on TCP port 9010
Creating sockets...

Waiting for connection request...

Incoming connection from 192.168.0.201:809.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: IDN-SGLT-PRI?
VXI-11 DEVICE_READ, SCPI command: None
VXI-11 DESTROY_LINK, SCPI command: None
VXI-11 moving to TCP port 9011

Waiting for connection request...

Incoming connection from 192.168.0.201:809.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: IDN-SGLT-PRI?
VXI-11 DEVICE_READ, SCPI command: None
VXI-11 DESTROY_LINK, SCPI command: None
VXI-11 moving to TCP port 9012

Waiting for connection request...

Incoming connection from 192.168.0.201:809.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: C1:OUTP LOAD,50;BSWV WVTP,SINE,PHSE,0,FRQ,15000,AMP,2,OFST,0;OUTP ON
C1:OUTP LOAD,50;BSWV WVTP,SINE,PHSE,0,FRQ,15000,AMP,2,OFST,0;OUTP ON
Warning: WMF00015000000000 did not produce an expected response after 2 retries
Traceback (most recent call last):
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/bode.py", line 45, in <module>
    server.start()
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/awg_server.py", line 120, in start
    self.main_loop()
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/awg_server.py", line 140, in main_loop
    self.process_lxi_requests()
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/awg_server.py", line 244, in process_lxi_requests
    self.parser.parse_scpi_command(scpi_command)
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/command_parser.py", line 49, in parse_scpi_command
    self.parse_bswv(args, channel)
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/command_parser.py", line 80, in parse_bswv
    self.awg.set_amplitude(channel, ampl)
  File "/home/uwake/Software/FY6900/sds1004x_bode-master/sds1004x_bode/awgdrivers/base_awg.py", line 42, in set_amplitude
    raise NotImplementedError()
NotImplementedError

Some additional information in case it is relevant:

Ubuntu "sees" the scope, connecting to it as /dev/ttyUSB0. This port is in the dialout group, of which I am a member - but shouldn't matter in any case since this is being run under sudo.

I tried running the FY6900 software via wine. It runs ... but no matter what I do, I can't get it to recognize the FY6900. I tried running the software in a Windows 10 VirtualBox, enabling the USB device. And ... it runs just fine, controlling the FY6900. So apparently the FY6900 USB port is operating correctly, at least with Windows.

I thought about trying to run the python program under Windows, but the README.md file only seems to reference a Linux environment, so I was unsure whether that was possible. And in any case, I don't particularly want to have to run this through a VirtualBox instance. For that matter, my ultimate goal is to run it via the ESP-01.

Help! Does anyone have any suggestions, tricks, or helpful questions to offer?

The FY6900 is the 60M version, running version 1.5.4
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #121 on: September 11, 2024, 11:20:09 pm »
A bit more data: I was able to connect to the scope attached with USB via a terminal program (putty, gtkterm) both in Windows and in Linux - I can type in a command and see the change on the FY6900. So I do have connectivity, at least through USB. For the ESP-01, perhaps I am running into the issue of needing to adjust the resistor(s) feeding the TX and/or RX lines? Is there any way to do this on my adapter board, rather than inside the unit? I am not completely opposed to opening it up, but I would prefer to hold off until I am sure that I will keep the unit.

But that still would not explain why the sds1004x_bode program does not work. Again, any help will be most appreciated!
« Last Edit: September 11, 2024, 11:23:15 pm by awakephd »
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #122 on: September 12, 2024, 04:54:26 am »
Can you test the other fy driver: fy6600? 
That "fy" driver is really new, and I haven't been able to test it (don't have a FY AWG), and this is indeed a bug.
Also, this is better for discussions in github than here. I have created an issue in github and will do some debugging in the coming days by mocking the fy AWG.   

Can you set "VERBOSE = True" (instead of "VERBOSE = False" as it is now) in the fy or the fy6600 driver? That can help debugging.
About Windows, it should work, but that is unlikely to solve the issue. Absolutely no need for virtualbox. This is really basic, in theory it should even run in a raspi.

I avoid WiFi as much as I can in the lab, so I haven't looked at ESP-01, but I will be able to help porting it. I am just not sure which fork to get, there are multiple forks and I see nothing that regroups all efforts.

EDIT: found a stupid bug (missing one letter in a function name). The "fy" driver should be better now. Tell me if it works. Still willing to work on ESP-01, but what fork should I start from?
« Last Edit: September 12, 2024, 12:21:05 pm by bateau020 »
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #123 on: September 12, 2024, 12:45:48 pm »
bateau020, you are not only a gentleman and a scholar but also a saint to take this on! Many thanks. I am away from my "lab" (aka, desk piled with things in a corner of my house) at the moment, but will check out both the updated fy and the fy6600 drivers. I will also check on how to respond on Github.

On the ESP-01 code, I used the link provided by Knutselaar about 10 posts back in this thread. As best I can tell, his tweaks have not been ported back to Github, and I maybe shouldn't have started with that code - my thinking was that this represented a recent successful attempt.

What I missed until now is that he is using an SDS1104X, and that is what the code is set for. As I was digging through the espBode code last night I realized that 1) it does not include the UDP adjustment that you made to the python code, and 2) the code could use some improvement - at least in my ever-so-humble opinion. Currently, the code is essentially C, even though written in a C++ environment. I think it could be made much less confusing with judicious use of some C++ classes - for example, a class that "automaticaly" handles the endian-swap needed to go between the network and the ESP, rather than having to call the swap routine at various points on various pieces of the data. And don't get me started on the uint8_t **data parameter that is passed into the receiveRpcPacket function ... which then uses malloc to create a memory block without checking to see if it succeeds, which is then passed back to the calling function, which has to remember to free it ... even if it wasn't actually created. Yikes!

All that to say, I have already been thinking about taking on an update of the espBode code, both to include the SDS804X, and to make it easier to use going forward. Any interest in collaboration? I have to confess that I have never collaborated on something like this before, so I don't know how it would work, and I certainly won't be offended if you'd rather not.
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #124 on: September 12, 2024, 01:01:05 pm »
All that to say, I have already been thinking about taking on an update of the espBode code, both to include the SDS804X, and to make it easier to use going forward. Any interest in collaboration? I have to confess that I have never collaborated on something like this before, so I don't know how it would work, and I certainly won't be offended if you'd rather not.

Sure, no problem. Collaborating is easy with github.
One of the problems I have is that I cannot test all of the code, as I only have 1 AWG. Collaboration will help here.
Another problem is that I no longer have my SDS1000 (non-HD). I ported the python code when I had both scopes. Am thinking about making the code really VXI compliant (opening both UDP and TCP ports), and my lack of test subjects is really hampering. Collaboration will again help here.

I will take a look at the existing forks do an assessment of where to start from.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #125 on: September 12, 2024, 02:28:37 pm »
Excellent!
 

Offline das_strobel

  • Contributor
  • Posts: 13
  • Country: de
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #126 on: September 12, 2024, 02:49:50 pm »
I will take a look at the existing forks do an assessment of where to start from.

You have a pull request from me regarding the support of Rigol DG800/900/1000Z siggens. Let me know if it works for you. Thanks!

PS: I've sent the PR to this repo https://github.com/hb020/sds1004x_bode. I hope it is the right one?
« Last Edit: September 12, 2024, 02:53:36 pm by das_strobel »
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #127 on: September 13, 2024, 05:51:44 am »
Great! I knew there was something wrong with that correction, but hadn't taken the time yet to check it. Thanks.
Merged.
 

Offline Knutselaar

  • Newbie
  • Posts: 6
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #128 on: September 13, 2024, 05:51:05 pm »
 Best awakephd,

Did you change  on line 12 of esp_config.h:
#define AWG FY3200
in
#define AWG FY6900

The last compiling I did was with the FY3200.

Knutselaar
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #129 on: September 13, 2024, 06:46:26 pm »
@Knutselaar: the problem is that the espbode code uses TCP for both `rpc_server` and `lxi_server`. This works with the SDS1000 (non HD) series, but does not work with the newer HD series (SDS800 HD or SDS1000 HD), that awakephd has.
These newer scopes require UDP for `rpc_server`, and require dynamic changes to the port assigned to `lxi_server`. This is not really a big surprise: many other LXI/VXI devices have the RPC portmap service listening on TCP and UDP.

It however means that a rather serious adaptation of the espBode network code is needed in order to make it compatible with the HD series scopes.

Now I can help with that, the code is not that complicated. But this would need to be a group effort, as I no longer have a SDS1000 (non HD) series scope, and I do not have a serially controlled AWG (although all of that can be simulated). As a result, I really prefer to do so via github, not via zip files.
« Last Edit: September 13, 2024, 07:18:56 pm by bateau020 »
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #130 on: September 13, 2024, 09:05:38 pm »
Best awakephd,

Did you change  on line 12 of esp_config.h:
#define AWG FY3200
in
#define AWG FY6900

The last compiling I did was with the FY3200.

Knutselaar

Yes, I did change it to #define AWG FY6900, but as bateau020 says, the problem seems to be the need for the UDP connection.

However, your fix for the FY6900 in an earlier post, or something like it, seems to be needed in the sds1004x_bode python code:

 
The problem of frequency adjustment in the new FY6900 60MHz mentioned by bigpriap a few posts back:

I have changed in esp_fy6900.cpp line 64 and 73 from

snprintf(command, 19, "WMF%08lu000000\n", frequency);

 Into

snprintf(command, 19, "WMF%08lu\n", frequency);

 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #131 on: September 13, 2024, 09:21:14 pm »
Can you test the other fy driver: fy6600? 

...

EDIT: found a stupid bug (missing one letter in a function name). The "fy" driver should be better now. Tell me if it works.

bateau, the python code works better now with the fy driver, in that it does not crash, and it does attempt to respond to the settings coming from the SDS804X oscilloscope. However, as I alluded to in the post just above, the version of the FY6900-60M that I have (firmware 1.5.4) does not recognize the frequency setting as it is currently formatted:

Code: [Select]
Waiting for connection request...

Incoming connection from 192.168.0.201:810.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: C1:BSWV?
VXI-11 DEVICE_READ, SCPI command: None
VXI-11 DESTROY_LINK, SCPI command: None
VXI-11 moving to TCP port 9014

Waiting for connection request...

Incoming connection from 192.168.0.201:810.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: C1:BSWV FRQ,2234.4898
C1:BSWV FRQ,2234.4898
Warning: WMF00002234489800 did not produce an expected response after 2 retries
VXI-11 DESTROY_LINK, SCPI command: None
VXI-11 moving to TCP port 9015

If I try sending the FY6900 the command as WMF2234.4898\n it works perfectly - yes, with the decimal point, no leading or trailing zeros. When it gets something like WMF00002234489800\n it sets the frequency to 60 MHz.

I note also in the fragment above that the oscilloscope appears to be asking for some feedback - where it issues the command C1:BSWV? - I can't tell whether the program is giving it the desired feedback, or simply ignoring this, and I don't know if it matters. I forgot to run it with VERBOSE = True, so I will report back when I have a chance to do that in case that gives more information.

I also tried it with the fy6600 driver. It produced similar results, i.e, unsuccessful results - one difference being that it did not report back whether the frequency setting was successful, but as I watched the FY6900 screen, it clearly was not successful. I'm guessing it uses the same formatting as the fy driver does. Here is a bit of the output:

Code: [Select]
Waiting for connection request...

Incoming connection from 192.168.0.201:810.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: C1:BSWV?
VXI-11 DEVICE_READ, SCPI command: None
VXI-11 DESTROY_LINK, SCPI command: None
VXI-11 moving to TCP port 9018

Waiting for connection request...

Incoming connection from 192.168.0.201:810.
VXI-11 CREATE_LINK, SCPI command: inst0
VXI-11 DEVICE_WRITE, SCPI command: C1:BSWV FRQ,4295.71429
C1:BSWV FRQ,4295.71429
VXI-11 DESTROY_LINK, SCPI command: None
VXI-11 moving to TCP port 9019

I have worked my way through the espBode code, but have only begun on the sds1004x_bode code; however, I feel like the combination of UDP fix from the latter plus frequency format fix from the former may prove successful!
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #132 on: September 13, 2024, 10:14:57 pm »
Uploaded a new version with a specific fy6900 driver. Tell me how it works.

About C1:BSWV?: it is indeed not implemented right now, as it seems to be ignored by the scope.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #133 on: September 14, 2024, 12:34:33 am »
Many thanks! I may have jumped the gun - I tried making one change in the set_frequency method of the FYgenAWG class:

previous version:

"%014u" % uhz,

my change:

"%.6f" % freq,

and ... drum roll ... it works!

I was going to attach a screenshot ... but I can't seem to get it to attach. :(
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #134 on: September 14, 2024, 12:37:59 am »


Ah, got it - I was misunderstanding the way the forum handled the image attachment. Here it is! Simple low-pass RC filter (330Ω resistor, 10nF capacitor).
« Last Edit: September 14, 2024, 12:39:31 am by awakephd »
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #135 on: September 14, 2024, 12:59:07 am »
Uploaded a new version with a specific fy6900 driver. Tell me how it works.

About C1:BSWV?: it is indeed not implemented right now, as it seems to be ignored by the scope.

Haven't had a chance to try the new FY6900 driver yet, but took a quick look at it. Looks like you did something similar to what I have above. I am not overly familiar with python, but I'm curious about the format specification you used - "%08.6f" - doesn't this mean a total of 8 characters wide, with 6 digits after the decimal? What happens if the frequency is 100Hz or higher - does python "override" the width specification to allow additional digits before the decimal? Or have I totally misunderstood (highly likely given how little I know python!)?
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #136 on: September 14, 2024, 01:06:19 am »
Well, now that this is working, I have two things to work on:

#1 - get the espBode version to work, and
#2 - figure out why my plot shows the phase starting out flat at around -7° when I was expecting it to be at or close to 0°. Other than that, the plots look exactly like what I predicted based on the component values. Equipment error?? An error in the way I set it up / measured / something??

Sorry for so many posts in a row. Can you tell that I am very excited to see this working?
 

Offline tautech

  • Super Contributor
  • ***
  • Posts: 29335
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #137 on: September 14, 2024, 01:17:57 am »
Well, now that this is working, I have two things to work on:

#1 - get the espBode version to work, and
#2 - figure out why my plot shows the phase starting out flat at around -7° when I was expecting it to be at or close to 0°. Other than that, the plots look exactly like what I predicted based on the component values. Equipment error?? An error in the way I set it up / measured / something??

Sorry for so many posts in a row. Can you tell that I am very excited to see this working?
Yep, congrats.

More can be learnt here:
https://www.eevblog.com/forum/testgear/siglent-sds1x04x-e-bodeplot-ii-(sfra)-features-and-testing-(coming)/
Avid Rabid Hobbyist.
Some stuff seen @ Siglent HQ cannot be shared.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #138 on: September 14, 2024, 11:34:37 pm »
Thanks, Rob. I've started looking at that thread. Clearly the UI for the Bode plot on the 1000x-e is quite different than the one for the 804x, so that has been a bit confusing, but I shall persevere ...
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #139 on: September 15, 2024, 12:19:41 am »
A bit of progress and a request ...

---------------

First, the request: As described below, I have done some work on the espBode code ... but only on my local copy ... because I am a git / github neophyte. I have known how to do a "git clone" for years, but have never ventured beyond that. I did watch a couple of tutorials last night, but am still not entirely sure how to use it to create a fork from one of the existing github repositories - I am thinking a fork is the best approach, as what I am envisioning, and have done so far, is a pretty thorough rewrite from the current C code to take advantage of C++ classes. I'd also like to incorporate, or at least allow for, the greater functionality of the sds1004x_bode python program as updated by bateau020.

Of course, yet another question is which repository to start from - there are at least 5:

https://github.com/sq6sfo/espBode           last commit was 5 years ago; includes only FY6800; does not include telnet; only for ESP8266
https://github.com/timkoers/espBode        forked from sq6sfo; last commit was 4 years ago; adds FY6600, FY6900
https://github.com/Hamhackin/espBode     forked from timkoers; last commit was 3 years ago; adds JDS2800; adds telnet
https://github.com/hankst69/espBode       forked from Hamhackin; last commit was 1 year ago; no added features, but code cleaned up
https://github.com/Switchleg1/espBode     forked from sq6sfo; last commit was 9 months ago; adds FY6600; allows ESP32 or ESP8266

As the list above shows, sq6sfo seems to be the originator, but there are two separate "families" - the one leading to hankst69, and the one by Switchleg, which has had much more recent activity, but leaves out the additions made by timkoers, Hamhackin, and hankst69.

And then there are the tweaks that Knutselaar added, but I haven't found a github repository for those, and I can't tell which version he started from - presumably either Hamhackin or hankst69, since he includes telnet.

I propose forking from hankst69, adding in the tweaks from Knutselaar, and seeing if Switchleg caught any bugs that the others missed. Now I just need to figure out how to create the fork. I have set up a github account. I'd prefer to do the editing on my local machine. I know there is some way to link the local git directory to the github repository, but I am still confused about which variation of command(s) to use. If anyone has a simple, 1-2-3 guide to point me to, I would be most, most appreciative!

----------------

Now, the progress: Before I get too far down the road of re-writing the espBode code to use UDP, I wanted to be sure that my ESP-01 plus the adapter I made (to regulate the 5v to 3.3v and route the serial lines) were actually communicating with the FY6900. I reworked the .ino file of the espBode project to add a selectable "passthrough" mode via the telnet connection. In the process, I reworked the loop function to use a simple state variable, thus allowing the telnet processing to continue to work even while it is waiting for a connection from the scope. I have attached the result to this post.

I compiled and uploaded this (along with the rest of the existing espBode project), and after a few rounds of debugging, it works beautifully - and more importantly, I can now verify that the ESP-01 is successfully communicating with the FY6900. I connect to the ESP-01 via telnet, enter passthrough mode by sending the word passthrough, and then I can issue the various commands, such as WMF1000 or RMF or so on. It seems to work flawlessly! Sending the word passthrough again turns off passthrough mode, and it is ready to listen for the oscilloscope. But of course, before it can "hear" the SDS804X, I need to implement a UDP option. And that leads back to the request above ...

-------------

On edit: I've made a fork from hankst69 in github: https://github.com/awakephd/espBode. Now if I can just figure out how to coordinate that with my local editing ...
« Last Edit: September 15, 2024, 12:38:53 am by awakephd »
 
The following users thanked this post: egonotto

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #140 on: September 15, 2024, 05:13:11 am »
Now if I can just figure out how to coordinate that with my local editing ...

Easy. github is just a remote repo with a web interface added. But it remains a regular git repo.

Steps:
* add your ssh public key to your github profile setting (https://github.com/settings/keys)
* clone the repo to your PC: git clone git@github.com:awakephd/espBode.git  (from the green "code" button top right in your repo)
* edit and test locally
* when done, git commit and git push, as usual. If you've never done git, sorry, the learning curve is steep, but there are loads of tutorials.
* If you use vscode with platformio (recommended) an extension like "Git History" can be helpful.
« Last Edit: September 15, 2024, 07:42:32 am by bateau020 »
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #141 on: September 16, 2024, 12:42:44 pm »
Knutselaar, where did you get the code base you started from?

The question comes from re-thinking my plan. I more-or-less have github and git sorted out, at least enough to get going. But I am still puzzled by the various forks and revisions of code. I had wanted to start with the code base that Knutselaar used. Why? Because his report of success is the most recent I've seen. However, I can't find the repo from which it seems to have been drawn. None of the ones listed in my recent post above include the FY3200, but the code that Knutselaar used did include that. Obviously there's some other code out there, either not in the github repos, or (equally likely) I haven't figured out how to find it.

I did find one other repo: https://github.com/AgentLintZeal/espBode - this repo does not indicate the origin from which it forked, but appears to stem from the same starting point as all the rest. However, it has shifted to platform.io, and seems to be targeting only the jds8000.

Meanwhile, my re-thinking has led me to the conclusion that it makes more sense to do a start-over rather than attempting to edit and update the existing code. Obviously the start-over would depend on both espBode and sds1004x_bode, but the former is in C and the latter is in python, and my goal is to write a C++ version ... mostly because that is where I am most comfortable. (Though it has been 40 years since I wrote software for a living, in the years since I have occasionally taken on an in-house, single-developer project, and nearly all of that has been C++.)

So, now I have a question about etiquette. If I do a complete do-over, essentially starting from scratch even while drawing on the insights from the former versions ... what is the best way to represent that in github? Should I start a new repo, with a title such as espBode2.0 or something like that, and refer back to the earlier efforts in the README without actually forking from any of them? Or is it better to stay with the espBode name, fork from a previous repo, and then create a new branch? Yes, clearly I am still learning my way around github and so on. As I said, all of my coding up to now has been single-developer - me! - and not something that could or should be shared.

Another part of the puzzle: before I do the start-over version 2, I am greatly inclined to see if I can tweak Knutselaar's version just enough to get the UDP communication working. That would definitely seem to be best done in the context of a forked version of espBode ... but once again, I can't figure out where Knutselaar's version was forked from. Knutselaar, any help you can give to point me in the right direction will be most appreciated!

 

Offline shabaz

  • Frequent Contributor
  • **
  • Posts: 381
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #142 on: September 16, 2024, 12:53:26 pm »
Unless you're using that feature every day wouldn't it be easier/cleaner to simply use a PC and automate if from there? This is what SCPI programmability is intended for. Then you can precisely tailor the behavior and the output to the task at hand, and tweak as required.
I don't understand how programming an ESP to act as a sort of translator (if my understanding is correct) is more flexible or convenient.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #143 on: September 16, 2024, 01:52:56 pm »
Shabaz, a fair question. Here is my understanding, which may be flawed, as I am still new to both the Siglent SDS804X and to the FY6900 AWG.

1) The Siglent does not recognize the FY6900, and the FY6900 does not speak SCPI. Therefore, though it would be possible to connect them physically via USB cable, it is not natively possible to have the Siglent generate an automatic Bode plot.

2) The FY6900 does not have any wifi or LAN connection. It can be connected to a PC or other device via USB, and will respond to a fairly simple text-based command set sent via a terminal program such as PuTTY. While this works flawlessly, it is not particularly convenient to have yet another cable to organize; simply for the sake of controlling the AWG from the PC, it would be far more convenient to have a wifi connection.

3) The FY6900 includes a connector with TTL-level serial plus 5V and GND; connecting to this bypasses the USB but allows the same communication with the AWG. This begins to answer your question - at the most basic level, use of an inexpensive ESP-01 board plus a small interface board (to convert the 5V to the 3.3V needed by the ESP8266) allows one to outfit the FY6900 with a wireless interface. That's a nice upgrade, for the grand cost of about $2!

4) Some years ago, work began on the sds1004x_bode project. This is a python program intended to run on a PC, which will connect to a Siglent scope via wifi, then connect to any of several inexpensive AWGs including the FY600 via USB (more strictly speaking, via a serial connection). This program is indeed, just as you suggest, a translator. It listens for connection requests from the Siglent scope and responds to its ID request in such a way that the Siglent thinks it has connected to a Siglent AWG. The Siglent then can send out the SCPI commands to control the AWG in order to generate a Bode plot; the sds1004x_bode program translates these commands into the commands that the FY6900 (or other AWG) can understand. Voila! Now the Siglent scope can generate a Bode plot using a non-Siglent AWG.

5) Put 3 and 4 together: while the sds1004x_bode program works beautifully, it is not particularly convenient - not only must one (once again) use a USB cable, but now one must also find a place for the PC. Surely the relatively simple task of translation could be handled by a small microcontroller? Yes indeed - and now we get to the espBode project. This will allow the Siglent to connect to the FY6900 (or other) via wifi, thinking it has connected to a Siglent AWG, and it can generate a Bode plot without having to manage an additional cable (for the USB) or find a place for the PC.
« Last Edit: September 16, 2024, 04:24:42 pm by awakephd »
 

Offline shabaz

  • Frequent Contributor
  • **
  • Posts: 381
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #144 on: September 16, 2024, 02:14:36 pm »
I see.. I think I understand now. I didn't realize the sig-gen didn't natively support SCPI.
If the sig-gen were to look like a SCPI device (e.g. via an ESP32 configured to have SCPI one side, and appropriate UART protocol on the other end), then both the 'scope and the sig-gen (through that SCPI adapter) could be controlled via (say) labVIEW, or Python, and then a bode-plot program could be executed on the PC, i.e. no need for messages to pass through the 'scope to a sig-gen.
Example screenshot below was created using a different 'scope and sig-gen, both of which support SCPI, just to show an example of the benefit of that. Since it is entirely under PC control, I could tweak the script to meet exact needs (e.g. only test at specific frequencies, or display with larger text and so on).
However if the ESP is required anyway to do the conversion to SCPI, then I can also see why one may as well try to set it so that the 'scope handles the communication and leave the PC out.
 
The following users thanked this post: awakephd

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #145 on: September 16, 2024, 04:23:56 pm »
Ah, that makes sense. If / as this revision develops, it would be interesting to see how far we could go to offer generic SCPI control.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #146 on: September 16, 2024, 07:46:35 pm »
Quick update: I have moved forward with the github repo (https://github.com/awakephd/espBode). I went back and forked it from the Hamhackin version, rather than the newer hankst69 - I concluded that it would be easier to proceed down the path I have planned starting from there. I have now updated that code base with a new commit, incorporating the changes that Knutselaar made (and the FY3200 code that his version included) as well as my own updates. Most of what I have done is to add a passthrough command to the telnet interface, and in the process reorganize the logic of the loop() function. Some other minor tweaks and updates as well. At this point, I will try to do a quick-and-dirty implementatiion of the UDP connection needed for the SDS804X and verify that it works. Once that is done, I will create a new development branch and start work on a complete rewrite.
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #147 on: September 17, 2024, 04:46:16 am »
In order to make espbode (or the python script) into a siglent emulating SCPI frontend for any AWG, that respects at least some of the standards, 3 loops/threads/processes are needed:
  • 1 that does portmap on UDP (this part is used for broadcasts/discovery and by the HD scopes)
  • 1 that does portmap on TCP (this part is used by direct VISA communication, as with the non-HD scopes
  • 1 that does the VXI-11 communication (on TCP)
The latter should switch to a new port after every LINK_DESTROY, and communicate the new port to the port mappers.

Made this work in the python version, in today's commit. Previously it only ran 1 of those loops at a time, which messed up communication with other SCPI tools.
Haven't really looked yet at how espbode does it.
« Last Edit: September 17, 2024, 08:56:59 am by bateau020 »
 

Offline Knutselaar

  • Newbie
  • Posts: 6
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #148 on: September 17, 2024, 08:44:48 am »
Hi  awakephd,

Before my first post I have searched all corners of the internet and found a espbode-master with date 8 december 2020, I think from Github.

I am sorry, I did search today, and I can not repoduce the origin of espbode-master I have used.
I think I have used Youtube:


Text under this video:
************************************
Vastgezet door Tim's Electronics Lab
@TimsElectronicsLab
3 jaar geleden (translation: 3 years ago)
I have created a pull-request on GitHub (https://github.com/sq6sfo/espBode/pull/4) that enables the full FY6900 instruction set. It hasn't been merged yet, so feel free to clone my repo (https://github.com/timkoers/espBode) until it is merged.
************************************
I think that I used one of these links, but they dont exist any more.


I took the espbode-master that worked with the old FY6900.

In my first post reply #112 I explained the path I followed.

Because I also own a FY3224S I took the working driver of the FY6900 and adapt it for my FY3224S.

In the espbode-master attached at  reply #113 I made a different solution of the frequency send to the FY6900 than described in post #112.



Maybe it is best, to be complete, to include also the driver for the old version of the FY6900 for those who have the old FY6900.
attatchment: old FY6900 driver:

 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #149 on: September 17, 2024, 01:45:41 pm »
Thank you, Knutselaar. I think I have generated a repository that does a reasonable job of incorporating the elements that were in the base you used, along with your updates plus mine. I agree that we should have the old FY6900 as an option; thanks for sending it! timkoer's repository is one of those that I looked at, but as best I recall it does not include the FY3200 as an option. At this point I can't determine where that code came from. :(
« Last Edit: September 17, 2024, 01:57:14 pm by awakephd »
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #150 on: September 17, 2024, 01:54:42 pm »
In order to make espbode (or the python script) into a siglent emulating SCPI frontend for any AWG, that respects at least some of the standards, 3 loops/threads/processes are needed:
  • 1 that does portmap on UDP (this part is used for broadcasts/discovery and by the HD scopes)
  • 1 that does portmap on TCP (this part is used by direct VISA communication, as with the non-HD scopes
  • 1 that does the VXI-11 communication (on TCP)
The latter should switch to a new port after every LINK_DESTROY, and communicate the new port to the port mappers.

Made this work in the python version, in today's commit. Previously it only ran 1 of those loops at a time, which messed up communication with other SCPI tools.
Haven't really looked yet at how espbode does it.

Thanks, bateau. The espBode code assumes a sequential process, and of course at the moment, does not correctly respond to the HD scopes. It does not change ports, and it does not check the AWG to be sure the command succeeded. (At least for the FY6900 driver, it checks only for the newline character that is returned whenever a command is issued.) There is an interesting quirk in the code where it sends some commands twice, "because the AWG doesn't always respond the first time," and yet at the same time it also has some code to avoid repeating the same command when it has been issued by the scope - a comment says that the 1000-series scopes repeat some commands. All of this, and much, much more, is why this code is overdue for a complete rewrite.

I did have a chance last night to do a q&d test of UPD communication, just enough to verify that I can receive the expected 56-bye packet. Hopefully later today I'll have time to work up the rest of code to respond, change ports, etc.

I look forward to reviewing the changes you've made to the python code to allow the various loops to occur in tandem, rather than sequentially - and again, thank you for your tremendous help and work on this project!
 

Offline Knutselaar

  • Newbie
  • Posts: 6
  • Country: nl
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #151 on: September 17, 2024, 07:40:42 pm »
Hi awakephd,

I made the driver for the FY3200.
 
The following users thanked this post: awakephd

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #152 on: September 18, 2024, 03:30:09 pm »
Thanks! I will include that in my "history" of the program.
 

Offline awakephd

  • Regular Contributor
  • *
  • Posts: 127
  • Country: us
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #153 on: September 19, 2024, 12:29:33 am »
bateau,

I have been working on a q&d implementation of the espBode code that will handle a UDP bind request. I think I am almost there, using your python code as a reference. But I am not understanding the next-to-last line of your process_rpcbind_request_udp method:

self.rpcbind_socket.sendto(resp_data, address)

Does this send back to the originating IP and port? How does it get the data length? I would have thought the format would be sendto(buffer, length) - but "address" doesn't sound like a length.

For that matter, I am confused by the line near the start of the method where you set address as follows:

address = bytesAddressPair[1]

This would seem to set address to equal the address of the buffer + 1 byte (maybe??).

As is probably obvious, some of my confusion has to do with minimal knowledge of python. Any help you can give will be most appreciated!

By the way, I tried to figure out if there was a way to contact you via the github repository, but I could not figure out how to do that. :(
 

Offline bateau020

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: fr
Re: Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG
« Reply #154 on: September 19, 2024, 05:25:54 am »
PM sent.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf