Test and Measurement Forum

adding channel to PS4000A_IC_Generic_Driver_Block

Post your MATLAB discussions here

adding channel to PS4000A_IC_Generic_Driver_Block

Postby whydoes » Wed Nov 04, 2015 6:21 am

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.
whydoes
Newbie
 
Posts: 0
Joined: Wed Nov 04, 2015 6:18 am

Re: adding channel to PS4000A_IC_Generic_Driver_Block

Postby Bilal » Wed Nov 04, 2015 4:12 pm

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
Bilal
PICO STAFF
PICO STAFF
 
Posts: 33
Joined: Mon Oct 05, 2015 12:19 pm

Re: adding channel to PS4000A_IC_Generic_Driver_Block

Postby whydoes » Fri Nov 06, 2015 11:58 am

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

Postby whydoes » Sun Nov 08, 2015 4:54 pm

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
whydoes
Newbie
 
Posts: 0
Joined: Wed Nov 04, 2015 6:18 am

Re: adding channel to PS4000A_IC_Generic_Driver_Block

Postby Hitesh » Fri Nov 13, 2015 3:41 pm

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,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests