Products > Test Equipment

UNI-T UTG932/UTG962 200MSa/s Function Arbitrary Waveform Generator

<< < (85/96) > >>

aix:
I've been trying to get pyvisa going with my UTG962E.  It's mostly working, except for grabbing a screenshot with Display:Data?.  The scripit hangs when trying to read the bitmap.

I'd love some help troubleshooting this.  This is on Ubuntu 24.04, python 3.12.3, pyvisa 1.14.1 with the pyvisa_py backend (0.7.2).

Here's the code:

import pyvisa
pyvisa.log_to_screen()
ADDR = "USB0::26198::2100::AWG1523500244::0::INSTR"
rm = pyvisa.ResourceManager()
sgen = rm.open_resource(ADDR)
sgen.write("*IDN?")
print(sgen.read())
sgen.write("Display:Data?")
disp = sgen.read_raw()[15:]  # <<< HANGS HERE

There's nothing especially interesting in the pyvisa logs:

2024-10-03 12:50:28,848 - pyvisa - DEBUG - No visa library specified, trying to find alternatives.
2024-10-03 12:50:28,848 - pyvisa - DEBUG - Environment variable PYVISA_LIBRARY is unset.
2024-10-03 12:50:28,869 - pyvisa - DEBUG - Not loading dll_extra_paths because we are not on Windows or Python < 3.8
2024-10-03 12:50:29,440 - pyvisa - DEBUG - Automatically found library files: [None, None, None, None, None]
2024-10-03 12:50:29,441 - pyvisa - DEBUG - No user defined library files
2024-10-03 12:50:29,441 - pyvisa - DEBUG - Did not find IVI binary
2024-10-03 12:50:29,453 - pyvisa - DEBUG - SerialSession was not imported No module named 'serial'.
2024-10-03 12:50:29,522 - pyvisa - DEBUG - USBSession and USBRawSession were correctly imported.
2024-10-03 12:50:29,538 - pyvisa - DEBUG - TCPIPSession was correctly imported.
2024-10-03 12:50:29,541 - pyvisa - DEBUG - GPIBSession was not imported No module named 'gpib'.
2024-10-03 12:50:29,541 - pyvisa - DEBUG - pyvisa-py is available.
2024-10-03 12:50:29,541 - pyvisa - DEBUG - Created library wrapper for py
2024-10-03 12:50:29,542 - pyvisa - DEBUG - Created ResourceManager with session 8035761
2024-10-03 12:36:55,882 - pyvisa - DEBUG - USB0::26198::2100::AWG1523500244::0::INSTR - opening ...
2024-10-03 12:36:55,906 - pyvisa - DEBUG - USB0::26198::2100::AWG1523500244::0::INSTR - is open with session 8719109
2024-10-03 12:36:55,908 - pyvisa - DEBUG - USB0::26198::2100::AWG1523500244::0::INSTR - reading 20480 bytes (last status <StatusCode.success_max_count_read: 1073676294>)
UNI-T Technologies,UTG900E,AWG1523500244,3.06
2024-10-03 12:36:55,911 - pyvisa - DEBUG - USB0::26198::2100::AWG1523500244::0::INSTR - reading 20480 bytes (last status <StatusCode.success_max_count_read: 1073676294>)

Given that some of you got this working earlier in the thread, I'd love to understand the diff between your environment and mine.

Edit 1: forgot to mention that this is on aarch64 (Raspberry Pi).

Edit 2: I've been playing with other SCPI commands.  It appears that some commands consistently work while other consistently fail, and this seems to correlate with the length of the response.  I wonder if exceeding the USB device's wMaxPacketSize (64 bytes) might be what's triggering the issue.  Or something along those lines.  Thoughts?

Edit 3: I saw this commit from two days, but it didn't help.  I also added a bunch of logging throughout the stack, which suggested it's not a packet reconstruction isssue: for a broken command, the very first read from the libusb1 endpoint seems to block forever.

eTobey:
Try adding 100ms delay before and after "sgen.write("Display:Data?")"

aix:

--- Quote from: eTobey on October 03, 2024, 11:07:00 pm ---Try adding 100ms delay before and after "sgen.write("Display:Data?")"

--- End quote ---

Thanks for the suggestion.  I tried it, but it didn't fix the issue.

One interesting observation is that I saw SYSTem:INFo? work, but only just once.  It's one of those commands that I couldn't get to work before, I suspect because of its long output (70 chars).  When I saw it work, I re-ran the exact same script a bunch of times but it was back to locking up on read().

All of this does seem to hint at a timing issue of some sort.

Would love to hear other ideas or suggestions.

eTobey:
Try adding 500ms.

Try sockets like i do here:
https://www.eevblog.com/forum/testgear/scpi-virtual-feature-fixed-measurement-gates-siglent-sds800x-hd-and-the-like/msg5660515/#msg5660515

aix:
I tried various timings, but to no avail.

The device doesn't have Ethernet, only USB.  (In fact, I plan to make a USB-to-Ethernet bridge but for that I obviously need to get USB comms working.)

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