Products > Test Equipment

Siglent SDS1104X-E and SDS1204X-E: Bode plot with a non-Siglent AWG

<< < (17/35) > >>

duckman:
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😁

cncjerry:
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

cncjerry:
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

cncjerry:
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: ---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

--- End code ---

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

cncjerry:
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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod