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