I have been having multiple issues with the SDK for the ps4000 series.
The code I am writing is in VB.Net using VS2010.
I have been using the VBA, VB.NetCon, C#Con, and any other examples I can find to fix the issues
but since they all use the same small subset of possible functions they are not all that helpful beyond
what has already been written.
We recently purchased 2 PS4226 models and 4 PS4424 models which will all be run by the same ATP.
Since this is the case I need to be able identify each unit via serial number, which I have managed
by parsing them out the device info. The EnumerateUnits function does not work, as far as I can tell either.
The ps4000OpenUnitEx is the only way I can find to open a specific unit once I know the serial number
but this function appears to be missing from the dll.
I tried both the ps4000.dll and ps4000wrap.dll to no avail.
If I am just plain missing something please point me in the correct direction.
Thanks for your time,
Scott.
BTW: The Flash Led works on the 4424 but not on the 4226. I found the post on the 4227 model.
Declare Function ps4000EnumerateUnits Lib "ps4000.dll" (ByRef count As Short, ByVal serials As String, ByRef SerialLen As Short) As Integer
Dim count As Short
Dim serialstring As String
Dim seriallen As Short
seriallen = 255
serialstring = " "
status = ps4000EnumerateUnits(count, serialstring, seriallen)
The developers have identified the omission of ps4000OpenUnitEx and this will be updated in the next release.
Thank you for the response. I have been out of town.
The information on the Enumerate command fixed the problem. I had a "ByVal" instead of "ByRef" for the
count. I am still seeing some slight inconsistencies when I run my code. Sometimes when I set a break point
after the enumerate command I see "0" units returned, as well as nothing in the string and a length of 0. If
I re-execute just the seriallen assignment, serialstring assignment, and the enumerate command it will
fix it. I will have to look into that further.
I experimented with opening all of the units first and that did not seem to work.
Is there a recommended sequence when using the enumerate command?
As far as the no entry point for the Open Unit command and the new release, is there a timetable for when
the new release will be issued?
I have not seen anything on when the next update will be released that will include the
ps4000OpenUnitEx fix. Do you have any information?
I need a way to scan for all of the PicoScopes connected and determine their serial numbers.
At that point I need to be able to open a given unit. Each will be used for different testing
and the correlation between serial number and unit I am opening is critical.
The method we are using for all of our equipment is based upon the GPIB address or serial number.
After assigning a unit to a given task then we open the required unit if/when we need it.
If we have to re-assign the unit to the serial number connection every time we run the program
it defeats the purpose of automation.
Any thoughts on how to do this with the current software capability?
If you downloaded the latest release candidate for Picoscope6, R6.6.37(RC), it includes the updated driver ps4000.dll it will appear in an sdk download soon.
I have finally got a chance to look into this again. I downloaded the latest version of the software and the version you listed and the ps4000OpenUnitEx still shows no entry point.
Can you provide a simple example of this where it is actually working? Preferably using VB.net.
I have managed to make other commands work correctly but this one still appears to be missing from the dll.
Thanks for the prompt response. I tried the one you sent in the zip and it still was complaining so I did some more digging. Apparently, from when I was trying to get the VBA example to run, I had copied a version of PS4000.dll into the Windows System directory. Once I removed that copy I no longer get the No Entry Point error. Sorry about the confusion.
I still do not have a given serial number unit opening correctly but I am just getting going on it again. Do you have or are you aware of a simple VB.Net example that opens a specific serial numbered unit. It might help.
Declare Function ps4000EnumerateUnits Lib "ps4000.dll" (ByRef count As Short, ByVal serials As String, ByRef SerialLen As Short) As Integer
Declare Function ps4000OpenUnitEx Lib "ps4000.dll" (ByRef handle As Short, ByVal serialno As String) As Integer
Dim count As Short
Dim serialstring As String
Dim seriallen As Short
seriallen = 255
serialstring = " "
status = ps4000EnumerateUnits(count, serialstring, seriallen)
status = ps4000OpenUnitEx(UnitModel.handle, serialstring)
Thanks once again for the prompt response.
I will give the code you posted a try as well but I found the main part of the issue.
In the documentation for the ps4000OpenUnitEx command it is shown as:
PICO_STATUS ps4000OpenUnitEx
(
short * handle,
char * serial
)
I was taking this literally that both should be by reference. By changing the serial number
to by value it works.
Here is the declaration I have that seems to work.
Declare Function ps4000OpenUnitEx Lib "ps4000.dll" (ByRef handle As Short, ByVal serialNumber As String) As Integer
Hopefully I can get this stuff rolling now.
Thanks, Scott.
Yes that is what my declaration statement is, I had missed it from the code above but have added it in.
Strings are passed as ByVal in VB even if used for a return value, they need to be populated before passing with a string of sufficient size to take the return hence