Simple Trigger + Max Continuous Streaming

Post your MATLAB discussions here
Post Reply
Wilfred_Mason
Newbie
Posts: 0
Joined: Tue Aug 20, 2019 7:17 pm

Simple Trigger + Max Continuous Streaming

Post by Wilfred_Mason »

Hello,

I would like to continuously stream ad store data at the max sampling rate on channel A of my PicoScope 5242D using the MATLAB SDK. I would like the streaming to begin when the the signal being read in channel B reaches a threshold voltage (3000 mV). I need to stream and store for 5s.

Will the example, "PS5000A_ID_Streaming_Example.m" do this?

Here is what I have modified to achieve my result:

1) Change the threshold voltage

Code: Select all

[status.setSimpleTrigger] = invoke(triggerGroupObj, 'setSimpleTrigger', 0, 3000, 2);
2) Modify the sampling rate to get the max specified by the specification sheet (62.5 MS/s) for continuous streaming.

Code: Select all

set(streamingGroupObj, 'streamingInterval', 5e-6);
3) Update number of samples to acquire before stopping

Code: Select all

set(ps5000aDeviceObj, 'numPreTriggerSamples', 0);
set(ps5000aDeviceObj, 'numPostTriggerSamples', 5*62500000);
4) Allow for continous streaming

Code: Select all

set(streamingGroupObj, 'autoStop', 0);
In addition I would like to change the input voltage range for my channels, how can this be done? I assume it is done in this line;

Code: Select all

channelSettings(1).range = ps5000aEnuminfo.enPS5000ARange.PS5000A_2V;
Can I change 2V to 250mV for example?

Hopefully that is all that needs to be done. Please let me know if my assumptions are correct, if anything remains to be done and if the example will do what I need.

NeilH
PICO STAFF
PICO STAFF
Posts: 267
Joined: Tue Jul 18, 2017 8:28 am

Re: Simple Trigger + Max Continuous Streaming

Post by NeilH »

Hi

If you are wanting to use a trigger to initiate capture you will need to be using the block capture mode, as in streaming the data capture will start immediately upon calling RunStreaming. The trigger in streaming ca be used to mark a point within the streamed data and/or to work with the autostop to stop the streaming capture.

The input ranges that can be set can be found within the programmer's guide for your device which can be found here
https://www.picotech.com/download/manuals/picoscope-5000-series-a-api-programmers-guide.pdf

Neil
Neil
Technical Support Engineer

Post Reply