usbtmc | Go library to communicate with a USB Test | Test Automation library
kandi X-RAY | usbtmc Summary
kandi X-RAY | usbtmc Summary
USBTMC is a USB device class specification for test equiment and instrumentation devices, such as oscilloscopes, digital multimeters, and function generators. USBTMC requires three endpoints:. Additionally, the USBTMC subclass USB488 has an Interrupt-IN endpoint.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a visa resource
- encodeMsgInBulkOutHeader encodes a BulkInBulkOut header .
- encodeBulkOutHeader encodes BulkOut header .
- exitBootMode terminates the boot mode
- NewContext returns a new libusb context
- NewDeviceByVIDPID returns a new device .
- encodeBulkHeaderPrefix encodes a Bulk header prefix .
- defaultDevice returns the default device
- nextbTag returns the next b tag .
- invert b tag
usbtmc Key Features
usbtmc Examples and Code Snippets
Community Discussions
Trending Discussions on usbtmc
QUESTION
I am trying to communicate with a LeCroy WaveRunner 640Zi oscilloscope from a Raspberry Pi, they are connected with a USB cable. I have already done this under Windows, but now I am not able to make it work in Linux.
If I run lsusb
I see this:
ANSWER
Answered 2021-Mar-04 at 17:59I managed to find a solution which I share for the sake of future generations to come. I had just to add a line to the file /etc/udev/rules.d/99-com.rules
with the content SUBSYSTEM=="usb", MODE="0666", GROUP="usbusers"
(or append this line in case the file already exists). This can be done first running
QUESTION
ANSWER
Answered 2021-Mar-02 at 13:02The scope you are using "Rigol DS1104Z" has different SCPI commands to the "Rigol DS1052E" in your example code.
The command ":WAV:POIN:MODE RAW" will work on the Rigol DS1052E but not on the Rigol DS1104Z
You can check if the instrument has an error by querying ":SYSTem:ERRor?"
QUESTION
I want to read out a USB measurement device in python. For this I use the usbtmc module. It requires Pyusb and libusb-win32. I installed both and it seems that they are running fine. In the device manager I can find my USB device. And in python too. For example:
...ANSWER
Answered 2019-Feb-18 at 14:29The Keysight support helped me out: I had to install the Keysight drivers (connection expert) and the pyvisa and pyvisa-py module. It is now working!
QUESTION
I have a problem where the objects holding imported python modules are being corrupted, but only after sys.exit()
is explicitly called. This is also intermittent. I have stripped out a large portion of the code except for the "standard" pyusb
module (I have used the very latest version of that). Very little actually happens.
If the program calls sys.exit() then some object IDs get changed to garbage values. If I leave that out then there are no errors!
Is this really a bug in Python? That seems unlikely. What did I do wrong?
===== main program "bug_happens.py"
...ANSWER
Answered 2018-May-28 at 23:26When the Python interpreter exits, the runtime is being torn down and the ordering of object deletion is not something you can rely on. In fact, it is not even guaranteed that __del__()
methods are called at all when the interpreter exits.
The objects a custom __del__
needs to access (including other modules) may already have been deleted or set to None
, which would cause exactly the exceptions you're seeing here ('NoneType' object has no attribute...)
That's not really a "memory corruption", it's just poor code written for the Instrument
class. Any necessary setup/teardown context should be managed with __enter__
and __exit__
, since __del__
is unsuitable for this purpose. So, this issue is more or less a bug in Instrument
. This code could possibly be improved by taking advantage of a datamodel guarantee documented here:
Python guarantees that globals whose name begins with a single underscore are deleted from their module before other globals are deleted; if no other references to such globals exist, this may help in assuring that imported modules are still available at the time when the
__del__()
method is called.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install usbtmc
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page