Documentation Error: ps5000aOpenUnit

Post general discussions on using our drivers to write your own software here
Post Reply
dfergenson
User
User
Posts: 2
Joined: Fri Mar 04, 2016 8:58 am

Documentation Error: ps5000aOpenUnit

Post by dfergenson »

I've identified an error in the latest version of picoscope-5000-series-a-api-programmers-guide.pdf that is minor but serious. I'm working from the latest version, ps5000apg.en.r4.

The description of ps5000aOpenUnit shows the argument serial as being by reference. Calling it by reference, even with a null input, reliably results in picoNotFound being returned by the function. Changing the declaration to call this by value results in the scope being found reliably.

In the supplied example code in both VB.net and C#, that argument is called by value.

If you verify that this is, indeed, a documentation error, could you please have someone check all of the other functions against the .DLL source code to verify the accuracy of those calls? And could you please post any other errors to this thread?

I realize that this may not be a problem for most people who simply use the supplied header files but it's a show stopper it you're writing your own (as I am for reasons that I'll explain in a different thread that I'm working on for the .NET area of the forum).

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

Re: Documentation Error: ps5000aOpenUnit

Post by Martyn »

The entry point in the driver code is

Code: Select all

PICO_STATUS PREF2 ps5000aOpenUnit(int16_t* handle, int8_t* serial, PS5000A_DEVICE_RESOLUTION resolution)
as reflected in the ps5000aApi.h header file.

For .Net string is a reference type and it behaves as a reference, so passing by value is correct.
Martyn
Technical Support Manager

dfergenson
User
User
Posts: 2
Joined: Fri Mar 04, 2016 8:58 am

Re: Documentation Error: ps5000aOpenUnit

Post by dfergenson »

Thank you. I've gone through and checked all of my other string arguments to ensure that I've converted all ByRef statements to ByVals in my code.

-David

Post Reply