PS5000aOpenUnitAsync documentation typo??

Post your C and C++ discussions here
Post Reply
hmaarrfk
Newbie
Posts: 0
Joined: Sun Jun 24, 2012 11:41 pm

PS5000aOpenUnitAsync documentation typo??

Post by hmaarrfk »

Hi,

I wanted to report a possible typo PS5000aOpenUnitAsync documentation.

I'm using the PS5000Asdk10.5.0.28 version of the SDK.

This is the relevant snippet of the code (it may be missing some variable declarations)

Code: Select all

  short progressPercent = 0;
  short complete = 0;
  resolution = PS5000A_DR_8BIT;

  openStatus = ps5000aOpenUnitAsync(&async_status, NULL, resolution);

  
  while (complete != 1)
  {
    status = ps5000aOpenUnitProgress(&handle, &progressPercent, &complete);
    if (progressPercent != previousProgress || complete == 1)    {
      std::cout << "Handle " << handle << " Progress " << progressPercent <<  " complete " << complete << std::endl;
      previousProgress = progressPercent;
    }
  }
These are the first calls to the PS5000a.dll

openStatus returns PICO_OK (0), while async_status also returns 0 <- async_status should be set to 1.
According to the programming guide,
async_status means
0 if the open operation was disallowed because another open
operation is in progress
1 if the open operation was successfully started

After the while loop, that polls ps5000aOpenUnitProgress, everything seems to be OK though.

I think that either the documentation should be updated or this may be a valid bug in the dll.


Also note, that the documentation for ps5000aOpenUnitProgress is misleading.
Arguments:
* progressPercent, on exit, the percentage progress towards
opening the scope. 100% implies that the open operation is
complete.
* complete, set to 1 when the open operation has finished
progressPercent gets to 100, before complete is set to 1 and the dll has not yet set handle to the correct value.



Regards,

Mark

Karunen
Advanced User
Advanced User
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: PS5000aOpenUnitAsync documentation typo??

Post by Karunen »

Hi hmaarfk,

I have replicated the issues,
I have submit a bug report to the development team for further investigations,
I will post when when the I receive further information.

Thanks,
Karunen
Karunen

Technical Specialist
Pico Technology

Post Reply