Code: Select all
import ctypes
# Cargar la biblioteca DLL
dll_path1 = 'C:\Program Files\Pico Technology\SDK\lib/ps3000a.dll'
dll_path2 = 'C:\Program Files\Pico Technology\SDK\lib/picoipp.dll'
ps3000a_lib = ctypes.CDLL(dll_path1)
picoipp_lib = ctypes.CDLL(dll_path2)
# Para usar funciones de la biblioteca DLL
# ps3000a_lib.nombre_de_la_funcion()
handle = ctypes.c_int16()
serial = ctypes.create_string_buffer(b"", 8)
count = ctypes.c_int16()
serials = ctypes.create_string_buffer(b"", 8)
serialLth = ctypes.c_int16()
print("Running EnumerateUnits. Outputs:")
txt = ps3000a_lib.ps3000aEnumerateUnits(ctypes.byref(count), ctypes.byref(serials), ctypes.byref(serialLth))
print("Status code: ", txt,)
print("Nº of ps3000a: ", count.value)
print("Serials: ", serials.value.decode(),"\n")
print("Running OpenUnit. Outputs:")
txt = ps3000a_lib.ps3000aOpenUnit(ctypes.byref(handle),ctypes.byref(serial))
print("Status code: ", txt,"\n")
print("Handle: ", handle.value,)
print("Serial: ", serial.value.decode())
Code: Select all
Running EnumerateUnits. Outputs:
Status code: 0
Nº of ps3000a: 1
Serials:
Running OpenUnit. Outputs:
Status code: 3
Handle: 0
Serial:
Thanks in advance.