| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8dece66 commit 6b75caa
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -753,6 +753,40 @@ def help(obj=None, itm=None, complete=False, indent=0): | |||
| 753 | 753 | """)) | |
| 754 | 754 | ||
| 755 | 755 | ||
| 756 | + def list_devices(): | ||
| 757 | + devs = [] | ||
| 758 | + | ||
| 759 | + if 'vxi11' in globals(): | ||
| 760 | + # search for VXI11 devices | ||
| 761 | + try: | ||
| 762 | + devs.extend(["TCPIP::%s::INSTR" % h for h in vxi11.list_devices()]) | ||
| 763 | + except: | ||
| 764 | + pass | ||
| 765 | + | ||
| 766 | + if 'usbtmc' in globals(): | ||
| 767 | + # search for USBTMC devices | ||
| 768 | + try: | ||
| 769 | + for dev in usbtmc.list_devices(): | ||
| 770 | + idVendor = dev.idVendor | ||
| 771 | + idProduct = dev.idProduct | ||
| 772 | + iSerial = None | ||
| 773 | + # attempt to read serial number | ||
| 774 | + try: | ||
| 775 | + iSerial = dev.serial_number | ||
| 776 | + except: | ||
| 777 | + pass | ||
| 778 | + # append formatted resource string to list | ||
| 779 | + if iSerial is None: | ||
| 780 | + devs.append("USB::%d::%d::INSTR" % (idVendor, idProduct)) | ||
| 781 | + else: | ||
| 782 | + devs.append("USB::%d::%d::%s::INSTR" % (idVendor, idProduct, iSerial)) | ||
| 783 | + pass | ||
| 784 | + except: | ||
| 785 | + pass | ||
| 786 | + | ||
| 787 | + return devs | ||
| 788 | + | ||
| 789 | + | ||
| 756 | 790 | class DriverOperation(IviContainer): | |
| 757 | 791 | "Inherent IVI methods for driver operation" | |
| 758 | 792 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments