[Python][PS3206D MSO] measurements with digital channels

Post general discussions on using our drivers to write your own software here
Post Reply
marcAC
Newbie
Posts: 0
Joined: Tue Sep 17, 2019 8:00 am

[Python][PS3206D MSO] measurements with digital channels

Post by marcAC » Tue Sep 17, 2019 8:04 am

Hello everyone,

we are currently trying to figure out how to set triggers and take measurement values with the digital channels of the PicoScope 3206D MSO after we already did it with the analog channels.

Are there any working examples for doing this?

Kind regards
Marc

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

Re: [Python][PS3206D MSO] measurements with digital channels

Post by NeilH » Tue Sep 17, 2019 8:15 am

Hi Marc

We don't currently have any examples showing triggering on a digital channel in python for the 3000a driver but there is a example using the 2000a driver, ps2000aMSOBlockExample.py, and the commands are nearly identical between the two drivers.

To trigger with a digital channel, the advance trigger functions need to be used, these are detailed in the programmer's guide https://www.picotech.com/download/manuals/picoscope-3000-series-a-api-programmers-guide.pdf

Neil
Neil
Technical Support Engineer

marcAC
Newbie
Posts: 0
Joined: Tue Sep 17, 2019 8:00 am

Re: [Python][PS3206D MSO] measurements with digital channels

Post by marcAC » Tue Sep 17, 2019 8:49 am

Hey Neil,

thanks for your fast reply.

Do you mean this example? If not where can I find the one you mean, if yes what about this example, it seems to be for the PicoScope 3000?

Marc

marcAC
Newbie
Posts: 0
Joined: Tue Sep 17, 2019 8:00 am

Re: [Python][PS3206D MSO] measurements with digital channels

Post by marcAC » Wed Sep 18, 2019 7:35 am

marcAC wrote:
Tue Sep 17, 2019 8:49 am
Hey Neil,

thanks for your fast reply.

Do you mean this example? If not where can I find the one you mean, if yes what about this example, it seems to be for the PicoScope 3000?

Marc
So I took the second mentioned example and copied the part of the digital trigger from the PS2000-example into it, after that I copied the missing classes and enums out of ps2000a.py to ps3000a.py and I don't get any errors any more. But when I try to run it, the programm doesn't wait for the trigger and instead just collects the data directly.

Does someone know why it doesn't work this way?

Kind regards
Marc

Anders_Eriksson
Newbie
Posts: 0
Joined: Fri Nov 15, 2019 10:09 am

Re: [Python][PS3206D MSO] measurements with digital channels

Post by Anders_Eriksson » Fri Jan 10, 2020 11:21 am

Hi I am also trying to get a digital trig to work in the ps3000aBlockMSOExample

I have copied and pasted the example code for the ps2000a example, but now I get

---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~\PythonTool\ps3000aBlockMSOExample.py in
69 # nConditions = 1
70
---> 71 dont_care = ps.PS3000A_TRIGGER_STATE['PS3000A_CONDITION_DONT_CARE']
72 trigger_true = ps.PS3000A_TRIGGER_STATE['PS3000A_CONDITION_TRUE']
73 nConditions = 1

AttributeError: 'Ps3000alib' object has no attribute 'PS3000A_TRIGGER_STATE'

Please can you update the code on github, so it runs and works also for the ps3000a?

Anders_Eriksson
Newbie
Posts: 0
Joined: Fri Nov 15, 2019 10:09 am

Re: [Python][PS3206D MSO] measurements with digital channels

Post by Anders_Eriksson » Fri Jan 10, 2020 12:43 pm

Hello again!

After alot of copy and pasting from ps2000a.py to ps3000a.py and updating the lib by "python setup.py install"

and comparing the VisualStudio c++ project examples, I found the problem!

Perhaps you have had the same problem Marc?

I called ps3000aSetTriggerChannelConditions, but with the digital channel the V2 version is needed.

dont_care = ps.PS3000A_TRIGGER_STATE['PS3000A_CONDITION_DONT_CARE']
trigger_true = ps.PS3000A_TRIGGER_STATE['PS3000A_CONDITION_TRUE']
nConditions = 1

triggerConditions = PS3000A_TRIGGER_CONDITIONS(dont_care,
dont_care,
dont_care,
dont_care,
dont_care,
dont_care,
dont_care,
trigger_true)

status["setTriggerChannelConditionsV2"] = ps.ps3000aSetTriggerChannelConditionsV2(chandle,
ctypes.byref(triggerConditions),
nConditions)
assert_pico_ok(status["setTriggerChannelConditionsV2"])

Regards,
Anders

Post Reply