PS2000 ps2000_overview_buffer_status return value

Post your .Net discussions here
Post Reply
tmm
Newbie
Posts: 0
Joined: Sat Jun 09, 2018 12:39 pm

PS2000 ps2000_overview_buffer_status return value

Post by tmm » Thu Aug 23, 2018 5:50 pm

Hi,

Please help me with this issue,
I am trying to use function "ps2000_overview_buffer_status"
and the return value is always 1

While the documentation states that 1 means "failed due to an invalid handle"

ps2000_overview_buffer_status
Returns
0: if the function was successful.
1: if the function failed due to an invalid handle.

Everything is working normally, but why the return value is 1?

Thank you.

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

Re: PS2000 ps2000_overview_buffer_status return value

Post by Martyn » Fri Aug 24, 2018 12:09 pm

It would help to see the full code you are using. You can send this to support@picotech.com
Martyn
Technical Support Manager

tmm
Newbie
Posts: 0
Joined: Sat Jun 09, 2018 12:39 pm

Re: PS2000 ps2000_overview_buffer_status return value

Post by tmm » Sat Aug 25, 2018 6:20 pm

Thank you for your reply,

the code is simple, and you can do it easily.

1- Download the PS2000CSExamples from github.
2- Define ps2000_overview_buffer_status inside imports

[DllImport(_DRIVER_FILENAME, CharSet = CharSet.Auto, SetLastError = false)]
public unsafe static extern short ps2000_overview_buffer_status(
short handle,
short* prev);

3- add the following lines:

short prev;
short ret2 = Imports.ps2000_overview_buffer_status(_handle, &prev);

exactly after:

Imports.ps2000_get_streaming_last_values(_handle, StreamingCallback);


Please advice if the steps are not clear.

If i am using the function "ps2000_overview_buffer_status" incorrectly, please send me an example how to use it.

Hitesh
PICO STAFF
PICO STAFF
Posts: 2855
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: PS2000 ps2000_overview_buffer_status return value

Post by Hitesh » Wed Sep 05, 2018 4:54 pm

Hi tmm,

It looks as though there is an error in the Programmer's Guide which I will report - 0 indicates an error, and 1 indicates that the function executed successfully.

The PS2000Imports.cs and example file have been updated to use this function - you can obtain these from our GitHub repository.

Regards,
Hitesh

Software Dev. Engineer

imgreen
User
User
Posts: 2
Joined: Fri Mar 08, 2019 2:28 pm

Re: PS2000 ps2000_overview_buffer_status return value

Post by imgreen » Mon Mar 11, 2019 2:17 pm

I am yet another who has now been caught out by the inverted return logic of the ps2000_overview_buffer_status function, or rather by its documentation. Can I point out that the 2000 series programmer's guide, that I downloaded last week as part of the 64-bit SDK, is still in error. It was only when coming here to report the problem that I found the posts in this thread.

Post Reply