AUX trigger with matlab for 6402c Oscilloscope

Having problems ? let us know the details here
Post Reply
mehrtak
User
User
Posts: 2
Joined: Fri Feb 16, 2018 10:58 am

AUX trigger with matlab for 6402c Oscilloscope

Post by mehrtak »

Hey,
I am using Picoscope 6402c and control it with matlab. I have a problem with triggering on AUX port.
I use below commands for triggering on channel D and it works. But I don't know how I should change it to trigger on AUX port.

%% Set Simple Trigger
triggerGroupObj = get(ps6000DeviceObj, 'Trigger');
triggerGroupObj = triggerGroupObj(1);
set(triggerGroupObj, 'autoTriggerMs', 1000);
thresholdVoltage = 2000; % 2Volts
[status.setSimpleTrigger] = invoke(triggerGroupObj, 'setSimpleTrigger', 3, thresholdVoltage, 2);


Could anyone please help me with this?
Thanks.

Hitesh

Re: AUX trigger with matlab for 6402c Oscilloscope

Post by Hitesh »

Hi mehrtak,

To use the Aux input, you need to set the channel value to the correct enumeration value as you have done for channel D (3).

The ps6000Enuminfo struct which is created when the PS6000Config script is run can be used to query the available enumeration types available. For channels, you require the ps6000Enuminfo.enPS6000Channel range.

If you type:

Code: Select all

ps6000Enuminfo.enPS6000Channel
at the MATLAB Command Prompt, you should find the following values:

Code: Select all

ans = 

  struct with fields:

              PS6000_CHANNEL_A: 0
              PS6000_CHANNEL_B: 1
              PS6000_CHANNEL_C: 2
              PS6000_CHANNEL_D: 3
               PS6000_EXTERNAL: 4
           PS6000_MAX_CHANNELS: 4
            PS6000_TRIGGER_AUX: 5
    PS6000_MAX_TRIGGER_SOURCES: 6
From the above list, you can see that the value to use for the Auxiliary input is 5.

Hope this helps,

mehrtak
User
User
Posts: 2
Joined: Fri Feb 16, 2018 10:58 am

Re: AUX trigger with matlab for 6402c Oscilloscope

Post by mehrtak »

Thanks Hitesh for your respond. I tried ps6000Enuminfo.enPS6000Channel and I got the values but when I implement the number '5' in the code it gives me an error.
I use below lines for triggering :
triggerGroupObj = get(ps6000DeviceObj, 'Trigger');
triggerGroupObj = triggerGroupObj(1);
set(triggerGroupObj, 'autoTriggerMs', 1000);
thresholdVoltage = 2000; % 2Volts
[status.setSimpleTrigger] = invoke(triggerGroupObj, 'setSimpleTrigger', 5, thresholdVoltage, 2);

and the error is:
Error using icgroup/invoke (line 92)
setSimpleTrigger: Status code: 13. Please refer to the PicoStatus.m file.

I checked the PicoStatus.m file and there number 13 is :
PICO_NO_SIGNAL_GENERATOR = hex2dec('00000013');
I don't use my Picoscope as a signal generator. I just want to use all 4 channels to record data.

Hitesh

Re: AUX trigger with matlab for 6402c Oscilloscope

Post by Hitesh »

Hi mehrtak,

The Instrument Driver returns the status codes as integer values which should then be converted to a hexadecimal value (you can use dec2hex() for this in MATLAB).

An integer value of 13 is 0xD which is PICO_INVALID_PARAMETER.

Looking at the settings for the simple trigger, the threshold value is 2000 mV. The input range of the AUX I/O connector is ±1 V as shown in the specifications.

Please ensure that the trigger threshold level is within the required range.

Hope this helps,

Post Reply