Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| en:python-usbtmc:readme [2013/08/08 05:05] – [Installation] alex | en:python-usbtmc:readme [2013/12/17 07:22] (current) – alex | ||
|---|---|---|---|
| Line 38: | Line 38: | ||
| KERNEL==" | KERNEL==" | ||
| </ | </ | ||
| + | |||
| + | ===== Windows setup ===== | ||
| + | |||
| + | To use Python USBTMC in Windows, PyUSB and libusb are required. | ||
| + | |||
| + | * http:// | ||
| + | * http:// | ||
| + | |||
| + | An INF file will also need to be created in order to use devices with libusb. Without a properly set up INF file, Python USBTMC will not be able to locate the device. | ||
| ===== Usage examples ===== | ===== Usage examples ===== | ||
| Line 46: | Line 55: | ||
| import usbtmc | import usbtmc | ||
| instr = usbtmc.Instrument(2391, | instr = usbtmc.Instrument(2391, | ||
| + | print(instr.ask(" | ||
| + | # returns ' | ||
| + | </ | ||
| + | |||
| + | When multiple instruments are connected they can be identified by serial number: | ||
| + | |||
| + | <code python> | ||
| + | import usbtmc | ||
| + | instr = usbtmc.Instrument(2391, | ||
| + | print(instr.ask(" | ||
| + | # returns ' | ||
| + | </ | ||
| + | |||
| + | It is also possible to connect with VISA resource strings like so: | ||
| + | |||
| + | <code python> | ||
| + | import usbtmc | ||
| + | instr = usbtmc.Instrument(" | ||
| + | print(instr.ask(" | ||
| + | # returns ' | ||
| + | </ | ||
| + | |||
| + | and: | ||
| + | |||
| + | <code python> | ||
| + | import usbtmc | ||
| + | instr = usbtmc.Instrument(" | ||
| print(instr.ask(" | print(instr.ask(" | ||
| # returns ' | # returns ' | ||