Test and Measurement Forum

ps2000_run_block

Post general discussions on using our drivers to write your own software here

ps2000_run_block

Postby KennyM » Thu Oct 01, 2009 10:34 am

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.
User avatar
KennyM
Active User
Active User
 
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm

Postby ziko » Thu Oct 01, 2009 4:11 pm

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

Kind regards
Ziko

Technical Specialist
ziko
Zen Master
Zen Master
 
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Postby KennyM » Thu Oct 01, 2009 8:23 pm

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.
User avatar
KennyM
Active User
Active User
 
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm

Postby Robin » Fri Oct 02, 2009 8:00 am

Hi Kenny

Are you using the correct return type (short)?

This is often the cause of unexpected return values.

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Postby KennyM » Fri Oct 02, 2009 9:09 am

Robin wrote:Hi Kenny
Are you using the correct return type (short)?


Yip, checked and double checked!
-Kenny M.
User avatar
KennyM
Active User
Active User
 
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm

Postby Robin » Fri Oct 02, 2009 9:18 am

It could be a bug in the driver. I will look in to it and get back to you.
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Postby KennyM » Fri Oct 02, 2009 9:44 am

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.
User avatar
KennyM
Active User
Active User
 
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm

Postby Robin » Mon Oct 05, 2009 2:23 pm

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
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Postby KennyM » Mon Oct 05, 2009 2:39 pm

Brill :-)

I'm glad that's clear.

Thanks :-)
-Kenny M.
User avatar
KennyM
Active User
Active User
 
Posts: 19
Joined: Mon Sep 15, 2008 5:51 pm


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests