GetUnitInfo for PS2000a on Python

Post general discussions on using our drivers to write your own software here
Post Reply
Posts: 0
Joined: Mon Mar 11, 2019 10:23 am

GetUnitInfo for PS2000a on Python

Post by ksalem » Mon Mar 11, 2019 10:33 am

Good morning,
I am trying to get any type of information from my PicoScope.
Here is the code:

class iScopeWrapper():
def __init__(self):
self.handle = c_int16()
ps.ps2000aOpenUnit(byref(self.handle), None)

def get_unit_info(self):
info_string = create_string_buffer(256)
info_len = c_short(256)
req_len = c_short() #I tried this with 0, 8 and 256 and had the same result
return ps.ps2000aGetUnitInfo(self.handle, info_string, info_len, byref(req_len), 0)

if __name__ == "__main__":
scope = iScopeWrapper()

The last digit (0) stands for the driver version according to the dictionary PICO_INFO. But it doesn't matter which information I am trying to extract from the PicoScope the output is always 0 or for the MAC address some number where I couldn't make sense of.

Am I doing something wrong here?
Thanks in advance

Post Reply