ps2000_run_block

Post general discussions on using our drivers to write your own software here
Post Reply
User avatar
KennyM
Active User
Active User
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm

ps2000_run_block

Post by KennyM »

OK, my next question.

The documentation for ps2000_run_block gives the return values as:
Returns 0: if one of the parameters is out of range.
1: if successful.


However when I run my unit tests, I am getting back the value of 4 from this method.

I find that if I just treat !=0 as OK, then my tests all pass, but being a good little programmer I should not be ignoring unexpected return codes!

Can anyone tell me what a return value of 4 means, or is it just safe to check for !=0 ?

It does not seem to tie in with any of the error codes in the header file, as 4 would be :
PS2000_FW_FAIL, //unabled to download firmware

Thanks again,
Kenny.
-Kenny M.

ziko
Advanced User
Advanced User
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Post by ziko »

Hi it shouldn't be returning 4, what product are you using? also what is the driver version?

Kind regards
Ziko

Technical Specialist

User avatar
KennyM
Active User
Active User
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm

Post by KennyM »

ziko wrote:Hi it shouldn't be returning 4, what product are you using? also what is the driver version?

Kind regards
Hi Ziko,

The 'scope is a Pico 2105 handheld.
PS2000.dll is version 2.0.8.3
PicoPP.sys is version 1.13.2
The SDK is version 6.2.14.0

I hope this is helpful....

-Kenny
-Kenny M.

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

Hi Kenny

Are you using the correct return type (short)?

This is often the cause of unexpected return values.

Robin

User avatar
KennyM
Active User
Active User
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm

Post by KennyM »

Robin wrote:Hi Kenny
Are you using the correct return type (short)?
Yip, checked and double checked!
-Kenny M.

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

It could be a bug in the driver. I will look in to it and get back to you.

User avatar
KennyM
Active User
Active User
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm

Post by KennyM »

Thanks Robin,

It's not causing me any trouble, I just check for !=0 at the moment, but it would be nice to know for sure.

Thanks again for the very quick replies - you are putting other companies to shame in the speed of your support replies.
-Kenny M.

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

Hi Kenny

Having looked at the driver, it is written to return a non-zero value on success, which is not necessarily 1. So it is the documentation that is erroneous rather than the driver. I will make sure the manual is updated.

Keep checking for !=0

Robin

User avatar
KennyM
Active User
Active User
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm

Post by KennyM »

Brill :-)

I'm glad that's clear.

Thanks :-)
-Kenny M.

Post Reply