Different Use of PS4000 Series Matlab Functions in Programming Examples compared to the Programmers Guide

Having problems ? let us know the details here
Post Reply
student
User
User
Posts: 2
Joined: Fri Dec 04, 2020 11:14 am

Different Use of PS4000 Series Matlab Functions in Programming Examples compared to the Programmers Guide

Post by student »

Hi,

as part of my job as a research assistant in university, I have to write Matlab Code for two PicoScope 4224 units. So far I've tried to modify the given example for the Rapid Block Mode. The example itself runs without any issue.

My problem is that the documented functions in the PicoScope 4000 Series Programmers Guide seem to differ from the ones used in the example. E.g.:

Code: Select all

[status.setChA] = invoke(ps4000DeviceObj, 'ps4000SetChannel', 0, 1, 1, 8, 0.0,0);
In this line 'ps4000setChannel' uses 6 input arguments whereas the programmers guide (p.67) suggests that the function uses 5 input arguments, with one of them being the handle identifiying the scope device. I do not know what the last two input arguments stand for. Is there another document which explains this difference in using the function? I also have issues understanding other lines of code using the invoke-function due to similar observations.

Another problem is that I am not familiar with objects like the 'triggerGroupObj' or the 'RapidBlockObj'. Is there a list of the properties (like 'setSimpleTrigger' and 'autoTriggerMs' in the example) one can change/ use?

Code: Select all

triggerGroupObj = get(ps4000DeviceObj, 'Trigger');
triggerGroupObj = triggerGroupObj(1);
set(triggerGroupObj, 'autoTriggerMs', 0);
[status.setSimpleTrigger] = invoke(triggerGroupObj, 'setSimpleTrigger', 0, 500, 2);
Any help is greatly appreciated!

Kind regards,
student

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

Re: Different Use of PS4000 Series Matlab Functions in Programming Examples compared to the Programmers Guide

Post by NeilH »

Hi

It looks like the last two inputs to SetChannel are not needed and are potentially carry overs from copying and pasting between sets of driver examples. The DriverObject in this acts as the handle as it contains this information.

In MATLAB there is a mdd file which is where the main set up of the instrument driver addon occurs which has all the functions from the driver plus some additional ones which don't have the ps4000 prefix. These extra functions wrap one or more driver functions into an easier to use single function. In the mdd file the functions and properties are divided between the main driver object group and several sub groups for functions specific to operations such as block mode, streaming mode or the signal generator. These are fully defined in the mdd file which you can open and browse to look the exact definitions of these and there are also help files which detail these as well accessible through MATLAB.

Neil
Neil
Technical Support Engineer

student
User
User
Posts: 2
Joined: Fri Dec 04, 2020 11:14 am

Re: Different Use of PS4000 Series Matlab Functions in Programming Examples compared to the Programmers Guide

Post by student »

Hi Neil,

thank you very much, this helped me a lot.

Kind regards,
student

Post Reply