Skip to content

ps6000a driver assumes that every channel gets the same number of samples #14

@mtnpke

Description

@mtnpke

Hi!

I'm writing a C++ wrapper/driver for PicoSDK and browsed through your repository to see how others handled the very poorly documented API around continuous streaming. Especially the buffer management is quite mysterious in the PDF and the header files, unfortunately ...

I noticed that you assume that ps6000aGetStreamingLatestValues will give the same noOfSamples_ in the streaming data info for every queried channel, so you use the value of the first structure: https://github.com/meatysolutions/pico-sdk/blob/d6c72a0ebdbd04f1bc2072a7a396b43bec2338c2/driver/src/ps6000a.rs#L290

Unfortunately, I can tell you from experience that this is definitely not the case :-( It is most of the time, but not always. I don't know the exact conditions that trigger this, but it's probably related to some buffer wraparound in the SDK. You'll then get a smaller number of samples in the first call for the second channel (in case you have 2 enabled channels), but they'll catch up again on the second call or so (i.e., you get a higher number of samples).

I'm not using this library myself, but I thought it might be useful for you to know about this quirk. Feel free to close this issue if you don't see this in your usage scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions