Using Simple Trigger for ps4000a in MATLAB

Post your MATLAB discussions here
Post Reply
kenjikaru
Newbie
Posts: 0
Joined: Fri Mar 29, 2019 2:54 am

Using Simple Trigger for ps4000a in MATLAB

Post by kenjikaru » Fri Mar 29, 2019 3:13 am

Hi,

I am having trouble using the 'setSimpleTrigger' command in MATLAB. I am able to stream data from the picoscope but I would like to set triggers that indicate the beginning and end of my waveform. All I need to do is have the picoscope start/end recording with a trigger where the amplitude rises above 1.5V.

I am using the line below to set the trigger value at 1500mV.

Code: Select all

[simpleTriggerStatus] = invoke(PS4000aDeviceObj, 'setSimpleTrigger', 0, 1500, ABOVE, 0, 0);


Thanks!

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

Re: Using Simple Trigger for ps4000a in MATLAB

Post by NeilH » Fri Mar 29, 2019 12:02 pm

Hi

In streaming mode the scope will collect data from when the runStreaming command is called, the trigger can't be used to start this type of data capture, it can indicate a single point where the trigger condition was met.

If you provide more information about what exactly you're trying to do with the scope I may be able to provide advise about how to achieve it in matlab.

Neil
Neil
Technical Support Engineer

kenjikaru
Newbie
Posts: 0
Joined: Fri Mar 29, 2019 2:54 am

Re: Using Simple Trigger for ps4000a in MATLAB

Post by kenjikaru » Fri Mar 29, 2019 6:34 pm

Thanks for the quick reply!

I have a signal which is periodic but I apply a large spike to trigger (acts as a marker) the start/end of my recording. I was originally recording the data using Picoscope and then saving the waveform in a csv. but I would like to automate the recording process using MATLAB. I guess I can use runStreaming to record and then cut the data that I don't need.

I was hoping that there was a way to set a trigger and only store the data I needed based on trigger location.

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

Re: Using Simple Trigger for ps4000a in MATLAB

Post by NeilH » Mon Apr 01, 2019 8:01 am

You could do that with streaming mode but have you considered using the rapid block mode? This allows the scope memory to be segmented and then for it to trigger that number of times without requiring a trigger rearm command from the PC between each capture so that way you could collect multiple captures without needing to store excess data to discard later with minimal time between buffers as the scope is rearmed.
A good place to start would be to look at the rapid block example in your MATLAB driver add-on for your device.
Neil
Technical Support Engineer

Post Reply