Manual Trigger Question in Matlab

Post your MATLAB discussions here
Post Reply
Nat
Newbie
Posts: 0
Joined: Tue Apr 11, 2017 10:37 pm

Manual Trigger Question in Matlab

Post by Nat »

Hello,

I am trying to use a PicoScope 3403 in some software I originally wrote for a NI high-speed digitizer.

With the National Instruments board, I tell it to wait for a trigger, and then with Matlab I can execute commands to send a trigger (via an Agilent AWG). While the NI board is waiting for a trigger, it does it in the background and I can execute commands with Matlab.

However, with the PicoScope, when it is waiting for a trigger, I cannot execute any commands with Matlab.

Is there any way to have the PicoScope wait for a trigger in the background?

I have been working in Block Mode...perhaps there is a way in Streaming mode?

Thanks,
Nathan

Hitesh

Re: Manual Trigger Question in Matlab

Post by Hitesh »

Hi Nathan,

If your script is calling the runBlock() function then it will block the application until the device has collected some data.

Instead you can do the following:
  • Call the ps3000aRunBlock() function from the Instrument Driver to start the data collection
  • Call your other code
  • Poll the Instrument Driver's ps3000aIsReady() function in a while loop until the device indicates that data is available
The ps3000aRunBlock() and ps3000aIsReady() functions are members of the Instrument Driver's Block group.

Hope this helps,

Nat
Newbie
Posts: 0
Joined: Tue Apr 11, 2017 10:37 pm

Re: Manual Trigger Question in Matlab

Post by Nat »

Perfect - that worked.

Thank you!

Hitesh

Re: Manual Trigger Question in Matlab

Post by Hitesh »

Hi Nathan,

Good to hear that worked! :D

Regards,

joejk
User
User
Posts: 4
Joined: Thu Mar 30, 2017 5:11 am

Re: Manual Trigger Question in Matlab

Post by joejk »

Hi,
I am a bit confused by the solution. What is the difference between "calling the runBlock() function" and "calling ps3000aRunBlock" ? I'm not sure what "calling the runBlock function" is refering to, if not the ps3000aRunBlock function.
Cheers
Joe

Hitesh

Re: Manual Trigger Question in Matlab

Post by Hitesh »

Hi Joe,

The 'runBlock' function combines the calls to 'ps3000aRunBlock()' and 'ps3000aIsReady()' into a single function call. This is fine if you just want to start the data collection and wait for the device to complete the data collection.

If you wish to execute other code while waiting for the device to complete collection, then you can use the 'ps3000aRunBlock()' function, call some other code and then poll the 'ps3000aIsReady()' function in a while loop.

Hope this helps,

Post Reply