adding channel to PS4000A_IC_Generic_Driver_Block

Post your MATLAB discussions here
Post Reply
whydoes
Newbie
Posts: 0
Joined: Wed Nov 04, 2015 6:18 am

adding channel to PS4000A_IC_Generic_Driver_Block

Post by whydoes »

Hello, I am using example in picoscope sdk for PS4000. PS4000A_IC_Generic_Driver_Block.m Everithing is working fine but I dont understand how to capture data not only from channel A (channel 0) but allso from channel B. I understand that information goes from here: [numSamples, overflow, chA] = invoke(blockGroupObj, 'getBlockData', 0, 0, 1, 0); Can some one help me? Thank you.

Bilal
Active User
Active User
Posts: 27
Joined: Mon Oct 05, 2015 12:19 pm

Re: adding channel to PS4000A_IC_Generic_Driver_Block

Post by Bilal »

Hello,

1. To use additional channels in this script, you must first enable channel B by passing a 1 to the Enabled parameter:

[status.setChB] = invoke(ps4000aDeviceObj, 'ps4000aSetChannel', 1, 1, 1, 8, 0.0);

2. Next you will need to add in a variable to pass the data from channel B:

[numSamples, overflow, chA, chB] = invoke(blockGroupObj, 'getBlockData', 0, 0, 1, 0);

Your data will be available for you to use in the chB variable.
Bilal Patel
Technical Support Engineer
Pico Technology

whydoes
Newbie
Posts: 0
Joined: Wed Nov 04, 2015 6:18 am

Re: adding channel to PS4000A_IC_Generic_Driver_Block

Post by whydoes »

Thank you. its working

whydoes
Newbie
Posts: 0
Joined: Wed Nov 04, 2015 6:18 am

Re: adding channel to PS4000A_IC_Generic_Driver_Block

Post by whydoes »

One more question, how to edit this line to get trigger not only from channel A but all so from channel B, and all so not only from rising but and from rising and from falling?

[status.SimpleTrigger] = invoke(triggerGroupObj, 'setSimpleTrigger', 0, 500, 2);

If I add second line like this and change it it to 0>>>1

[status.SimpleTrigger] = invoke(triggerGroupObj, 'setSimpleTrigger', 1, 500, 2);

then it triger only from channel B.

Maybe somewhere is manual document for matlab possible commands? Thanks

Hitesh

Re: adding channel to PS4000A_IC_Generic_Driver_Block

Post by Hitesh »

Hi whydoes,

The setSimpleTrigger (and the underlying ps4000aSetSimpleTrigger) function can only be used to set a trigger for one channel at a time.

You will need to use the Advanced Trigger functions provided by the Instrument Driver - there is an example (PS4000A_ID_Block_Adv_Trigger_PWQ_Example.m) in the current package available via MATLAB Central File Exchange, which has a corresponding html file showing an example data capture.

The advanced trigger functions are located in the Trigger group of the Instrument Driver and are based on the functions defined in the Programmer's Guide.

Once the Trigger group object has been created in the MATLAB Environment, you can view the available functions by calling:

Code: Select all

methods(triggerGroupObj);
You can then display Help text for the function you are interested in e.g.

Code: Select all

instrhelp(triggerGroupObj, 'setAdvancedTrigger');
Please note that Pico Technology is not responsible for the content of third party sites.

Hope this helps,

Post Reply