python - Reading data from a Tenma 72-7732 multimeter using PyUSB -
i'm trying read voltages tenma 72-7732 multimeter hid usb connection using pyusb , libusb. code far:
def main(): import usb.core import usb.util import usb.backend import sys #find device dev = usb.core.find(idvendor=0x1a86, idproduct=0xe008) # did find it? if dev none: raise valueerror('device not found') else: print "device found" dev.set_configuration() endpoint = dev[0][(0,0)][0] data = dev.read(endpoint.bendpointaddress, endpoint.wmaxpacketsize, 0, 100000) print data main()
this finds device, when tries read data, gives timeout error. multimeter has bad documentation , support, can't go there help. how can read device successfully?
i use simple ir rs232 adapter consists of ir detector strapped anode pin 4 , cathode pin 2 (rx data). when hooked pc simple terminal set 2400 baud, 7 data 1 stop, no parity, no handshake produces following string
013651211
which repeats every 400 ms. first 5 digits read on meter, digit 6 decimal point location, digit 8 function position
vdc = 1 ampdc = 9
last digit seems auto/manual mixed sign; rest don't need (yet).
Comments
Post a Comment