Hi,
attached is a lib for reading out the Metrahit 30M in python3
sample usage:
from lib.Metrahit30M import Metrahit30M
from time import sleep, time
a = Metrahit30M()
a.set_baudrate(9600)
a.set_device("/dev/ttyUSB0")
a.connect()
a.set_range(a.RANGES['VDC']['10V'])
while True:
sleep(1)
tmp = a.get_measurement()
csv_data = str(time())+", "+tmp[0]+", "+tmp[1]+", "+tmp[2]
with open("test.txt", "a") as file:
file.write(csv_data+"\n")
print(csv_data)
sample output:
1486926880.095561, +04.99996, V VDC, 10V VDC
1486926881.1968956, +04.99996, V VDC, 10V VDC
1486926882.2983227, +04.99996, V VDC, 10V VDC
1486926883.3987503, +04.99997, V VDC, 10V VDC
1486926884.5000813, +04.99997, V VDC, 10V VDC
1486926885.601423, +04.99997, V VDC, 10V VDC
1486926886.7028775, +04.99997, V VDC, 10V VDC
1486926887.8032846, +04.99996, V VDC, 10V VDC
1486926888.9046874, +04.99996, V VDC, 10V VDC
1486926890.0051658, +04.99996, V VDC, 10V VDC
1486926891.106339, +04.99996, V VDC, 10V VDC
1486926892.2070792, +04.99996, V VDC, 10V VDC