elektronik:lcr_meter_applent_at826
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungNächste ÜberarbeitungBeide Seiten der Revision | ||
elektronik:lcr_meter_applent_at826 [2016/05/15 19:38] – [PC Software] gpipperr | elektronik:lcr_meter_applent_at826 [2016/05/15 19:44] – [Ein HDI Device mit Python abfragen] gpipperr | ||
---|---|---|---|
Zeile 104: | Zeile 104: | ||
- | === Selber | + | ====Ein HDI Device mit Python |
Zeile 117: | Zeile 117: | ||
| | ||
</ | </ | ||
+ | |||
Abfragen ob das Gerät erkannt werden kann: | Abfragen ob das Gerät erkannt werden kann: | ||
- | <code python> | + | <code python |
import pywinusb.hid as hid | import pywinusb.hid as hid | ||
import sys | import sys | ||
+ | # --------------------------------------------------------- | ||
# Print the data | # Print the data | ||
def readRX_handler(data): | def readRX_handler(data): | ||
Zeile 130: | Zeile 133: | ||
print(" | print(" | ||
+ | # --------------------------------------------------------- | ||
# Get the data from the LCR MEter | # Get the data from the LCR MEter | ||
def getAT826(at826_vendor_id): | def getAT826(at826_vendor_id): | ||
+ | | ||
# Find the AT826 devices of the vendor id | # Find the AT826 devices of the vendor id | ||
all_devices = hid.HidDeviceFilter(vendor_id=at826_vendor_id).get_devices() | all_devices = hid.HidDeviceFilter(vendor_id=at826_vendor_id).get_devices() | ||
Zeile 139: | Zeile 143: | ||
print(" | print(" | ||
else: | else: | ||
+ | | ||
# search for the AT826 | # search for the AT826 | ||
# Open | # Open | ||
Zeile 185: | Zeile 190: | ||
# print(len(out_buffer)) | # print(len(out_buffer)) | ||
# print(out_buffer) | # print(out_buffer) | ||
- | # must be 1 | + | # May be must be 1 ?? to trigger the send process of the api??? |
+ | | ||
out_buffer[0] = 0x00 | out_buffer[0] = 0x00 | ||
out_buffer[1] = 0x00 | out_buffer[1] = 0x00 | ||
out_buffer[2] = 0x00 | out_buffer[2] = 0x00 | ||
out_buffer[3] = 0x40 | out_buffer[3] = 0x40 | ||
+ | | ||
+ | #get the Device information | ||
out_buffer[4] = ord(' | out_buffer[4] = ord(' | ||
Zeile 236: | Zeile 244: | ||
print(' | print(' | ||
at826device.close() | at826device.close() | ||
+ | |||
+ | # --------------------------------------------------------- | ||
# list all devices on the maschine for the HID USB Interface | # list all devices on the maschine for the HID USB Interface | ||
def showAllHDIDef(): | def showAllHDIDef(): | ||
Zeile 247: | Zeile 257: | ||
if __name__ == ' | if __name__ == ' | ||
+ | # Debug, get all informations about all devices | ||
# if sys.version_info < (3,): | # if sys.version_info < (3,): | ||
# | # | ||
- | # | + | # |
# | # | ||
# else: | # else: | ||
Zeile 258: | Zeile 269: | ||
# except UnicodeEncodeError: | # except UnicodeEncodeError: | ||
# | # | ||
- | # | + | # |
- | # Vendor ID of the device | + | |
+ | # Vendor ID of the device | ||
at826_vendor_id = 0x0825 | at826_vendor_id = 0x0825 | ||
- | # at826_vendor_id = 0x1244 | + | |
- | # at826_vendor_id =0x046d | + | |
# Read all devices | # Read all devices | ||
showAllHDIDef() | showAllHDIDef() | ||
+ | | ||
# Get the LCR | # Get the LCR | ||
getAT826(at826_vendor_id) | getAT826(at826_vendor_id) | ||
Zeile 271: | Zeile 283: | ||
</ | </ | ||
- | Der LCR Meter wird erkannt, Packet zum Senden wie im Handbuch beschrieben aufgebaut, im nächsten Schritt müssen | + | Der LCR Meter wird erkannt. |
+ | |||
+ | Packet zum Senden wie im Handbuch beschrieben aufgebaut | ||
+ | |||
+ | Im nächsten Schritt müssen | ||
demnächst mehr ... | demnächst mehr ... | ||
+ | |||
Um zu testen ob es einfach funktioniert mit diesem Beispiel arbeiten: https:// | Um zu testen ob es einfach funktioniert mit diesem Beispiel arbeiten: https:// | ||
- | Mit meinen Multimeter BXM240 ( bzw. [[http:// | + | Mit meinen Multimeter BXM240 ( bzw. [[http:// |
+ | |||
+ | |||
+ | ---- | ||
=== Stoffsammlung zu HID === | === Stoffsammlung zu HID === |
elektronik/lcr_meter_applent_at826.txt · Zuletzt geändert: 2018/10/23 20:06 von gpipperr