No Entry Point for ps4000OpenUnitEx

Post your .Net discussions here
Post Reply
Scott
Newbie
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

No Entry Point for ps4000OpenUnitEx

Post by Scott »

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.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Post by Martyn »

I have notified the development team of these issues and will update this thread when I have a response
Martyn
Technical Support Manager

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Post by Martyn »

I have checked the ps4000EnumerateUnits function and it does work although you need to declare it correctly and also set up values before calling

Code: Select all

    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.
Martyn
Technical Support Manager

Scott
Newbie
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Post by Scott »

Martyn,

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?

Thanks again for all of the help,
Scott.

Scott
Newbie
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Post by Scott »

Martyn,

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?

Thanks for your time,
Scott.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Post by Martyn »

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.
Martyn
Technical Support Manager

Scott
Newbie
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Post by Scott »

Martyn,

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 your time,
Scott.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Post by Martyn »

Can you check this out
Attachments
ps4000.zip
Latest dll
(480.69 KiB) Downloaded 625 times
Martyn
Technical Support Manager

Scott
Newbie
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Post by Scott »

Martyn,

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.

Thanks again,
Scott.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Post by Martyn »

With one unit connected the following should work

Code: Select all

    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)
Martyn
Technical Support Manager

Scott
Newbie
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Post by Scott »

Martyn,

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.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Post by Martyn »

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

Code: Select all

serialstring = "                                       "
Martyn
Technical Support Manager

Post Reply