Test and Measurement Forum

Incorrect parameter type for ps2000aRunBlock segmentIndex

Post your Linux discussions here

Incorrect parameter type for ps2000aRunBlock segmentIndex

Postby element » Tue Aug 22, 2017 12:49 am

I think I may have discovered an issue with the ps2000aRunBlock() API function and the segmentIndex parameter. I've been utilizing the pico-python project which provides a Python interface to the PicoScope C API. The wrapper function which calls ps2000aRunBlock was failing with PICO_SEGMENT_OUT_OF_RANGE. Changes I made to the Python code was inexplicably causing things to work. After doing some debugging and comparing working cases to non-working cases I found that the segmentIndex is the 7th function parameter and therefore is on the stack and padded to 64 bits. For the non-working cases, bits 17-31 would have uninitialized data in them, which seems to be utilized by this function for the segmentIndex, although it is documented as being an unsigned short in the programmers guide. I think either the documentation needs to be changed or the function definition changed.

More details on this issue can be found here:
Posts: 0
Joined: Sat Jan 31, 2015 9:13 pm

Re: Incorrect parameter type for ps2000aRunBlock segmentInde

Postby Hitesh » Tue Aug 22, 2017 7:30 am

Hi element,

Thank you for this.

The Programmer's Guide, although updated, has yet to be published to our website, so I have made our Technical Publications team aware of this. Please use the function definitions from the header file e.g. for ps2000aRunBlock():

Code: Select all
      int16_t                           handle,
      int32_t                           noOfPreTriggerSamples,
      int32_t                           noOfPostTriggerSamples,
      uint32_t               timebase,
      int16_t                           oversample,
      int32_t                        * timeIndisposedMs,
      uint32_t            segmentIndex,
      ps2000aBlockReady         lpReady,
      void                        * pParameter


Technical Support Engineer
Site Admin
Site Admin
Posts: 2791
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Return to Linux

Who is online

Users browsing this forum: No registered users and 0 guests