Test and Measurement Forum

ps5000aGetNoOfProcessedCaptures and ps5000aFlashLed

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

ps5000aGetNoOfProcessedCaptures and ps5000aFlashLed

Postby dfergenson » Thu May 12, 2016 7:24 am

I've been having trouble getting calls to two functions in the .dll to work.

In the case of ps5000aGetNoOfProcessedCaptures, the .DLL doesn't seem to recognize the call. ps5000aGetNoOfCaptures is recognized. I couldn't tell from the SDK manual if there was a difference between the two.

In the case of ps5000aFlashLed, it's recognized and returns enPicoStatusCode=PICO_OK but the LED doesn't flash.

Has anyone had better luck on an PS5000a? Or any other scope? On any platform? I see that the FlashLed has had some problems on other products.

Thanks.

-David
dfergenson
Newbie
 
Posts: 0
Joined: Fri Mar 04, 2016 8:58 am

Re: ps5000aGetNoOfProcessedCaptures and ps5000aFlashLed

Postby AndrewA » Thu May 12, 2016 12:33 pm

Yes there is a different between ps5000aGetNoOfProcessedCaptures and ps5000aGetNoOfCaptures.
There is mistake in the programmers guide, which I will get corrected.

ps5000aGetNoOfCaptures returns the number captures the device has captured.
ps5000aGetNoOfProcessedCaptures returns the number captures the driver has processed.

These normally these return the same value. As for normal Block and rapidblock capture modes the driver does not transfer any of the data from the scope.
You have call GetValues/GetValuesBulk function to transfer the data.

Using the scope with the GetValuesOverlapped (block mode) and ps5000aGetValuesOverlappedBulk (rapid block mode) functions; the driver is set to transfer data from the scope automatically.
The steps below describe how to use these functions-

Using the GetValuesOverlapped functions
1. Open the oscilloscope using ps5000aOpenUnit.
2. Select channel ranges and AC/DC coupling using ps5000aSetChannel.
3. Using ps5000aGetTimebase, select timebases until the required nanoseconds per sample is located.
4. Use the trigger setup functions ps5000aSetTriggerChannelDirections and ps5000aSetTriggerChannelProperties to set up the trigger if required.
5. Use ps5000aSetDataBuffer to tell the driver where your memory buffer is.
6. Set up the transfer of the block of data from the oscilloscope using ps5000aGetValuesOverlapped.
7. Start the oscilloscope running using ps5000aRunBlock.
8. Wait until the oscilloscope is ready using the ps5000aBlockReady callback (or poll using ps5000aIsReady).
9. Display the data.
10. Repeat steps 7 and 9 if needed.
11. Stop the oscilloscope.

A similar procedure can be used with rapid block mode using the
ps5000aGetValuesOverlappedBulk function.

I tried calling ps5000aGetNoOfProcessedCaptures and ps5000aGetNoOfCaptures with a GetValuesOverlapped (block mode) and both returned 1 for the signal capture.
Also I had no issue calling the ps5000aFlashLed function.

What driver version are you using? I used the current 32-bit windows driver version- 1.1.5.15 from the SDK.
Regards Andrew
Technical Specialist
AndrewA
Zen Master
Zen Master
 
Posts: 178
Joined: Tue Oct 21, 2014 3:07 pm

Re: ps5000aGetNoOfProcessedCaptures and ps5000aFlashLed

Postby dfergenson » Fri May 13, 2016 7:37 am

Andrew, thanks. I've been hung up on allocating the buffers and transferring the acquisitions in bulk. I just can't figure out the syntax. Do you have example code showing rapid block mode in action? Or can you see what's wrong with my code here?

Code: Select all
        status = ps5000aRunBlock(handle, numPreTriggerSamples, numPostTriggerSamples, timebase, timeIndisposedMs, segmentIndex, ps5000aBlockCallback, IntPtr.Zero)

        While deviceReady = False

            Sleep(10)

        End While

        ' Stop the device

        status = ps5000aStop(handle)

        ' Setup data buffers

        'DAVIO
        'Declaration attempt A
        'Dim valuesChA(numCaptures - 1)() As Short

        'For I = 0 To numCaptures - 1
        'ReDim valuesChA(I)(totalSamples - 1)
        'Next I

        'Using Declaration attempt A
        'For I = 0 To numCaptures - 1
        'status = ps5000aSetDataBuffer(handle, Channel.PS5000A_CHANNEL_A, valuesChA(I)(0), CInt(totalSamples), segmentIndex, RatioMode.PS5000A_RATIO_MODE_NONE)
        'Next I
        'Didn't work. Only working buffer was the last one.

        'status = ps5000aSetDataBuffer(handle, Channel.PS5000A_CHANNEL_A, valuesChA(0)(0), CInt(totalSamples), segmentIndex, RatioMode.PS5000A_RATIO_MODE_NONE)
        'Didn't work. Only valuesChA(9) had legitimate values.




        'Declaration attempt B
        'Dim valuesChA(numCaptures - 1, totalSamples - 1)

        'status = ps5000aSetDataBuffer(handle, Channel.PS5000A_CHANNEL_A, valuesChA(0, 0), CInt(totalSamples), segmentIndex, RatioMode.PS5000A_RATIO_MODE_NONE)
        'Didn't work. valuesChA was empty.




        'Declaration attempt C
        'Dim valuesChA((numCaptures * totalSamples) - 1)
        'status = ps5000aSetDataBuffer(handle, Channel.PS5000A_CHANNEL_A, valuesChA(0), CInt(totalSamples), segmentIndex, RatioMode.PS5000A_RATIO_MODE_NONE)
        'Didn't work. valuesChA was empty.




        ' Retrieve values

        Dim startIndex As UInteger
        Dim downSampleRatio As UInteger
        Dim overflow(9) As Short

        startIndex = 0
        downSampleRatio = 1
        'overflow = 0

        status = ps5000aGetValuesBulk(handle, totalSamples, 0, numCaptures - 1, 1, RatioMode.PS5000A_RATIO_MODE_NONE, overflow)


Also, I've tried GetNoOfProcessedCaptures and FlashLed. The bottom line is the FlashLed works but I still can't get GeNoOfProcessedCaptures to respond using any of the six .DLLs available.

I tried to post my example code but the site keeps blocking me. I can send it to you by an alternate route if that would help.

Thanks again.

-David
dfergenson
Newbie
 
Posts: 0
Joined: Fri Mar 04, 2016 8:58 am


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests