How to release captured waveforms from buffer?

Post your LabVIEW discussions here
Post Reply
makeezii
Newbie
Posts: 1
Joined: Wed Jun 21, 2023 11:38 am

How to release captured waveforms from buffer?

Post by makeezii »

Hi,

I use the rapid block example to capture multiple waveforms in a single measurement. I have set the number of segments, which determines the number of waveforms captured. Now if nSegments = 16, then 16 waveforms will be captured.

Each waveform is moved to the buffer of channel A before they are released. The channel A buffer releases a cluster of type 1D column vectors for each waveform. I would like to release each waveform, and store them in a TDMS file for further processing.

Is it possible to store the waveforms only inside the loop or are there other (faster) ways to do it?

There is a picture of my code at the moment.

-Markus
Attachments
test_code.png

AndrewA
PICO STAFF
PICO STAFF
Posts: 409
Joined: Tue Oct 21, 2014 3:07 pm

Re: How to release captured waveforms from buffer?

Post by AndrewA »

Hi Markus,

For the the while loop in your code you change this to a for loop and set it up to write a different file for each buffer of ChannelA, as pictured below-
Parallel_for_loop.png
This won't be any faster, but if you right on the edge of the for loop an choose "Configure Iteration Parallelism", and tick the box, it should set for 8, click ok.(I think this may depend on your CPU)
You will see the addition "P" terminal appear next to "N" terminal. See above image.
I have not run this code I have no idea if will work correctly. I don't know if the TDMS file function supports parallel execution.

The other thing you could do is create another version of the \shared\PicoReadPicoMultiBuffers.vi and add file writing into this directly.
And set the outer for loop to do "Parallelism" option above.

I would also set the Call function Library Function - LabVIEW:MoveBlock to "Run in any thread" which is in \shared\ReadBuffer.vi.
Regards Andrew
Technical Specialist

makeezii
Newbie
Posts: 1
Joined: Wed Jun 21, 2023 11:38 am

Re: How to release captured waveforms from buffer?

Post by makeezii »

This do not quite work how it should. There is still problem with writing TDMS file cause we have 1D array of TDMS file and TDMS write sink is only the file (not 1D array of TDMS file).

If I use the ps5000aGetValuesBulk.vi should I get the number of waveforms indicated by nSegments? So is it an array whose dimension is length of signal times the nSegments? Since the dimension of the array I get is now just the length of the signal times one (1D column vector). Which does not make sense because I should get, for example n x 16 array where n is signal length.

Maybe it's better that I share the whole code for further explanation.
Attachments
PicoScope5000aRapidBlock_oma.vi
(41.27 KiB) Downloaded 133 times

Post Reply