Streaming mode & segments

Post your LabVIEW discussions here
Post Reply
spflanze
User
User
Posts: 4
Joined: Wed Jul 11, 2018 11:36 pm

Streaming mode & segments

Post by spflanze » Thu Oct 18, 2018 5:34 am

Is streaming mode anything like the circular buffer I am familiar with where the microprocessor's DMA would fill half the buffer with A to D data while the other half, which has already been filled with data, is uploaded on the a serial bus, and when DMA is finished with its current half, it moves on the to the second half, and data uploading begins on the first half?

In my application I will need to continuously upload data from two channels that is collected after triggers that occur at a 20Hz rate. Typically its something like 2000 data points on each channel collected over a several microseconds.

I see in the example PicoScope3000FastStreaming.vi that it does not set segments. It uses a version of SetDataBuffer() from the ps3000wrap.dll that does not have a segment index argument. I do not see a place in this example VI where the total number of segments is set. How are segments managed in this case where the functions used to not have arguments regarding segments?

When segments are used, such as in function ps3000aSetDataBuffer() in ps3000.dll, are segment index numbers zero based ( start at zero)? Or are they one based (start at one)?

It appears to me that the function ps3000aGetStreamingLatestValues() has to be polled in a loop while waiting for data. Is there a way to collect data using a function that will block until the data is received after a USB interrupt, or it times out, instead of having to spend processor time polling?

My device is a 3205D.

Martyn
Site Admin
Site Admin
Posts: 3661
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Streaming mode & segments

Post by Martyn » Mon Oct 22, 2018 12:41 pm

Segment Index is zero based and applies to block captures where you are collecting data to the memory of the scope, before pulling down blocks at a time to the PC.

Streaming uses the onboard memory of the scope as a FIFO buffer to prevent data loss, with this data being passed to the drivers circular buffer. The application must read data from this circular buffer at a sufficient rate to prevent data loss. The circular buffer does not lap itself, instead when full the FIFO buffer on the scope will start to fill. It is only when the FIFO buffer is full that you will lose data.

The application timing and flow needs to be aware of the speed of data collection, but does not have to poll continuously, it can sleep for periods making use of the buffering within the driver and device to prevent data loss.
Martyn
Technical Support Manager

Post Reply