I'm trying to get a list of all available devices connected to my computer. Currently I am only intrested in PS5000 devices but this may change in the future to include other ranges.
Is there an easy way to do this? I have found the ps5000aEnumerateUnits command in the programmers manual, this command however does not seem to be included in the PS500AImports.cs file. I have tried adding the following to the file
[DllImport(_DRIVER_FILENAME, EntryPoint = "ps5000aEnumerateUnits")]
public static extern DataAqu_PicoScope.PicoStatus EnumerateUnits(out short Count, out StringBuilder SerialCSV, out short SerialCSV_Length);
short deviceCount;
StringBuilder serialCSV = new StringBuilder();
short stringLength;
MyImports.EnumerateUnits(out deviceCount, out serialCSV, out stringLength);
I'm getting an access violation exception when calling EnumerateUnits
Thanks for any help
Simon
Last edited by Simon on Wed Aug 05, 2015 1:58 pm, edited 1 time in total.
[DllImport(_DRIVER_FILENAME, EntryPoint = "ps5000aEnumerateUnits")]
public static extern DataAqu_PicoScope.PicoStatus EnumerateUnits(out short Count, out StringBuilder SerialCSV, ref short SerialCSV_Length);
Just ran some tests here - the StringBuilder object needs to be passed as is once you have allocated a size i.e. without an 'out' or a 'ref' keyword prefix.
[DllImport(_DRIVER_FILENAME, EntryPoint = "ps5000aEnumerateUnits")]
public static extern uint EnumerateUnits(
out short count,
StringBuilder serials,
ref short serialLength);
Sorry to resurrect a really old post but I am having to update my app from a few years ago and the ps5000aEnumerateUnits call is giving me problems again.
I'm having to update the picoscope drivers that I'm using as the new versions of the PS5000 with USB3 have started coming through.
The drivers that I was previously using were:-
PS5000a.dll version 1.1.4.39
Picolpp.dll version 1.1.2.52
I have swapped these out for the following versions
PS5000a.dll version 2.1.27.184
Picolpp.dll version 1.3.0.29
When I call ps5000aEnumerateUnits it returns the correct number of connected devices but the string that contains the serial numbers of the devices is always empty..