Unable to set channel resolution/some other settings

Post your MATLAB discussions here
Post Reply
VladimirChe
Newbie
Posts: 0
Joined: Fri May 05, 2017 5:35 pm

Unable to set channel resolution/some other settings

Post by VladimirChe »

Hi! Im running Matlab 2016b and a picoscope 5444B. i installed the driver, and running the simple "get block data" example seems to work fine. However, channel setup commands seem to have no effect in my script. i want to run just 2 channels, in 15bit + signal generator. to set up the channels i use:

Code: Select all

[status]=invoke(ps5000aDeviceObj,'ps5000aSetChannel','PS5000A_CHANNEL_A',1,'PS5000A_DC','PS5000A_500MV',0);
[status]=invoke(ps5000aDeviceObj,'ps5000aSetChannel','PS5000A_CHANNEL_B',1,'PS5000A_DC','PS5000A_500MV',0);
[status]=invoke(ps5000aDeviceObj,'ps5000aSetChannel', 'PS5000A_CHANNEL_C',0,'PS5000A_DC','PS5000A_5V',0);
[status]=invoke(ps5000aDeviceObj,'ps5000aSetChannel', 'PS5000A_CHANNEL_D',0,'PS5000A_DC','PS5000A_5V',0);
followed by

Code: Select all

[status, resolution] = invoke(ps5000aDeviceObj, 'ps5000aSetDeviceResolution',15);
However, the value returned in "resultion" is always 14 bits, cant seem to set it higher (i can set it lower. 12 and 8 bit modes work fine).
The signal generator works fine, as far as i can tell.

What is the correct way to set up the channels pre-capture in matlab?

Thanks in advance
Vlad.

Hitesh

Re: Unable to set channel resolution/some other settings

Post by Hitesh »

Hi Vlad,

Rather than passing the enumeration by name, please use the ps5000aEnuminfo struct that is loaded into the base workspace when the PS5000aConfig.m file is run to access the enumeration values.

If you call

Code: Select all

ps5000aEnuminfo
at the MATLAB Command Prompt, this should list all the enumeration ranges available.

You can then use the dot notation to access the individual members of each enumeration range e.g.:

Code: Select all

channelA = ps5000aEnuminfo.enPS5000AChannel.PS5000A_CHANNEL_A;
coupling = ps5000aEnuminfo.enPS5000ACoupling.PS5000A_DC;
range = ps5000aEnuminfo.enPS5000ARange.PS5000A_2V;

You can obtain the latest Instrument Driver files from our GitHub repository.

Hope this helps.

VladimirChe
Newbie
Posts: 0
Joined: Fri May 05, 2017 5:35 pm

Re: Unable to set channel resolution/some other settings

Post by VladimirChe »

Hi Hitesh, sorry for the rather late reply. Thanks, using the enums worked, rather than calling them by name. i am getting another problem however. When trying to run the AWG examples, i am getting a "method not found" error when trying to run the sections using either the "setSigGenArbitrarySimple" or "setSigGenArbitrary" methods. anything using "setSigGenBuiltInSimple" or anything else works. feels like its specifically the methods relating to the AWG. i am using the 5444B with AWG, so it should work....

Hitesh

Re: Unable to set channel resolution/some other settings

Post by Hitesh »

Hi Vladimir,

I would suggest updating the core Instrument Driver files from our File Exchange entry which links to a GitHub repository.

If you install it via the Add-Ons Explorer in MATLAB that would be the preferred method. You can keep your scripts elsewhere.

Regards,

Post Reply