Test and Measurement Forum

No Entry Point for ps4000OpenUnitEx

Post your .Net discussions here

No Entry Point for ps4000OpenUnitEx

Postby Scott » Thu May 17, 2012 9:09 pm

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.
Scott
Newbie
 
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Postby Martyn » Mon May 21, 2012 2:12 pm

I have notified the development team of these issues and will update this thread when I have a response
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Postby Martyn » Wed May 23, 2012 9:36 am

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 Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Postby Scott » Tue May 29, 2012 8:04 pm

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

Postby Scott » Thu Jun 21, 2012 7:20 pm

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.
Scott
Newbie
 
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Postby Martyn » Fri Jun 22, 2012 7:21 am

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 Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Postby Scott » Mon Aug 13, 2012 6:28 pm

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.
Scott
Newbie
 
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Postby Martyn » Tue Aug 14, 2012 10:18 am

Can you check this out
Attachments
ps4000.zip
Latest dll
(480.69 KiB) Downloaded 202 times
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Postby Scott » Tue Aug 14, 2012 2:16 pm

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.
Scott
Newbie
 
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Postby Martyn » Tue Aug 14, 2012 2:49 pm

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 Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: No Entry Point for ps4000OpenUnitEx

Postby Scott » Tue Aug 14, 2012 3:38 pm

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.
Scott
Newbie
 
Posts: 0
Joined: Wed May 16, 2012 6:45 pm

Re: No Entry Point for ps4000OpenUnitEx

Postby Martyn » Wed Aug 15, 2012 6:27 am

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 Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2287
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 1 guest