def info(): print("------- einzelne Werte -------------------------") print("16 Bit Value: " + str(rl.cbAIn(0,0,1))) print("Voltage Value: " + str(rl.cbVIn(0,0,1))) print("------- Messreihe -------------------------") #print("Messreihe: " + str(rl.cbAInScan(0,0,0,300,100,1))) #print("Messreihe: " + str(rl.cbVInScan(0,0,0,300,100,1))) print("------- Ausgabe -------------------------") print("Voltage Value: " + str(rl.cbVOut(0,0,101,2.5))) #aIn = np.array(rl.cbAInScan(0,0,0,300,100,1)); wIn = np.array(rl.cbVInScan(0,0,0,4000,8000,1)); np.savetxt("2000.csv", wIn)
def write(): while True: value = float(input("Volt?")) rl.cbVOut(0,0,101, value); print("Set to value " + str(value)) print("Voltage Value: " + str(rl.cbVIn(0,0,1)))
# -*- coding: utf-8 -*- """ Created on Mon Jan 7 14:05:21 2019 @author: ds-03 """ import redlab as rl #print("-------einzelneWerte-------------------------") #print("16BitValue:" + str(rl.cbAIn(0,0,1))) print("VoltageValue:" + str(rl.cbVIn(0, 0, 1))) #print("-------Messreihe-------------------------") #print("Messreihe:" + str(rl.cbAInScan(0,0,0,300,8000,1))) #print("Messreihe:" + str(rl.cbVInScan(0,0,0,300,8000,1))) #print("Samplerate:" + str(rl.cbInScanRate(0,0,0,8000))) #print("-------Ausgabe-------------------------") print("VoltageValue:" + str(rl.cbVOut(0, 0, 101, 5.0)))
# -*- coding: utf-8 -*- """ Created on Mon Jan 7 15:32:36 2019 @author: ds-03 """ import redlab as rl import numpy as np from time import sleep x = np.arange(30) sin = [np.sin(2 * np.pi * 2 * (i / 30)) for i in x] while (True): for i in sin: rl.cbVOut(0, 0, 101, i + 2.0) sleep(0.01)
import redlab as rl from time import sleep import numpy as np import matplotlib.pyplot as plt print("-------einzelneWerte-------------------------") print("16BitValue:" + str(rl.cbAIn(0, 0, 1))) print("VoltageValue:" + str(rl.cbVIn(0, 0, 1))) print("-------Messreihe-------------------------") print("Messreihe:" + str(rl.cbAInScan(0, 0, 0, 300, 8000, 1))) print("Messreihe:" + str(rl.cbVInScan(0, 0, 0, 300, 8000, 1))) print("Samplerate:" + str(rl.cbInScanRate(0, 0, 0, 8000))) print("Nyquist:" + str(rl.cbInScanRate(0, 0, 0, 8000) / 2)) print("-------Ausgabe-------------------------") sin = [np.sin(2 * np.pi * 2 * (i / 30)) for i in range(0, 30)] while True: for x in range(0, 30): rl.cbVOut(0, 0, 101, sin[x] + 2) sleep(1 / 30 * 8021 / 4) vec = np.zeros((8000)) data = rl.cbVInScan(0, 0, 0, 300, 8000, 1) plt.plot(data) plt.show()