Streaming Mode trigger reset

Post your LabVIEW discussions here
Post Reply
arzam20ee
Newbie
Posts: 0
Joined: Sat Oct 24, 2020 3:39 am

Streaming Mode trigger reset

Post by arzam20ee »

I am currently modifying the PicoScope4000aExampleStreaming.vi example VI for a 4824 series to perform data acquisition and have a few questions.

As of right now I am using streaming mode for the faster transfer speeds and no memory limitation (besides the PC). Also continuous data streaming is important to the project. My goal is that when the trigger is activated, the captured waveform is saved to a text file for later processing. Once the trigger has been set, I want the VI to wait for the next trigger and capture its waveform. The user will be able to set the number of waveforms captured. If I understand correctly, block mode does this but requires downtime while data transfers. So I'm wondering what is the best way to make streaming act like block mode, if possible. Or the best way to go about doing it. If I'm correct, picolog will switch between these two modes when necessary, but I would like to do it all in streaming.

Another question I have is how do you specify the number of samples in each waveform capture. I try changing Buffer Overview Size and that doesn't work. Also when I set pre-trigger samples they do not show up in my data, only post trigger. When I try to change the sample interval to 0 or nanoseconds, I get an error saying out of range but the API Programmers Guide says this should be possible.

Finally, how to convert the 16-bit ADC counts to numbers (for voltage reading). I see that the range of the channel affects the result and haven't been able to figure out a way to output the correct voltage.

Thanks for the help and I attached a photo of what my modified VI currently looks like.
Attachments
forum photo.png

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

Re: Streaming Mode trigger reset

Post by AndrewA »

Hi,
Continuous streaming is limited to 80 MS/s per channel using the API, or 160 MS/s total shared across all channels.
So for all 8 channels that only 20MS/s. Slower than block mode at the fastest time base.
You may get PICO_STATUS code returned if set the sample interval above this transfer rate for your number of channels.
But these error codes are now been removed in some Pico API's to support burst streaming.
In stream mode there are no waveforms or blocks/segments. Data is returned to DataBuffers and Overview buffers which size set in your code.
The number of samples returned in these buffers is not always the same, due to USB latency and OS not being real time.
And the buffer should not be full or close to full as this indicates it has or about to overflow, so data will be lost. Note there no feature to indicate you have lost data in streaming mode.
This doesn't stop you saving the same number samples to multiple files.

In streaming mode with the trigger armed, once triggered it cannot be rearmed. The only option would create your own software trigger code to do this.
Pre and post trigger sample values serve no purpose unless you have a trigger set or auto stop flag is set.
Without auto stop set the scope will continually stream data.

I would try avoiding saving to text files over binary formats as these require more bytes to written to the file and therefore the hard drive. And will impact disk performance.

To convert the 16-bit ADC counts to actual channel voltages, you can use PicoScope.llb\PicoScopeAdcToVolts.vi.
You need to pass the 'Range' from the related channel cluster, and the MAX_ADC count. See this streaming example for the 5000a API- https://github.com/picotech/picosdk-ni- ... mingMSO.vi

Note, Picolog 6 software uses streaming mode for all devices.
Regards Andrew
Technical Specialist

arzam20ee
Newbie
Posts: 0
Joined: Sat Oct 24, 2020 3:39 am

Re: Streaming Mode trigger reset

Post by arzam20ee »

Thanks for the reply.
After going through the streaming mode example I'm still not exactly clear on a few things, mostly concerning where to get the data I want.
My understanding is that in streaming mode if I set Trigger and Auto Stop to True then stream will be stopped after the number of post-trigger samples have been collected. If this happens then my question is where in LabVIEW should I get the data from if I just want to save the pre- and post-trigger samples? Is there a buffer that contains every sample so I can just get the triggered samples?
In the example, the data for the waveform graphs is being indexed from each Channels output in GetStreaming. Can I get the values I want from here once the function is AutoStopped?
Also you mentioned about the the Overview buller overflowing. Is there a way to clear is of samples that are not needed so it will not fill up before trigger?
Thanks for any help.

Post Reply