Test and Measurement Forum

Manual Trigger Question in Matlab

Post your MATLAB discussions here

Manual Trigger Question in Matlab

Postby Nat » Tue Apr 11, 2017 10:52 pm

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
Nat
Newbie
 
Posts: 0
Joined: Tue Apr 11, 2017 10:37 pm

Re: Manual Trigger Question in Matlab

Postby Hitesh » Wed Apr 12, 2017 8:33 am

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

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2389
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Manual Trigger Question in Matlab

Postby Nat » Wed Apr 12, 2017 2:23 pm

Perfect - that worked.

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

Re: Manual Trigger Question in Matlab

Postby Hitesh » Wed Apr 19, 2017 8:13 am

Hi Nathan,

Good to hear that worked! :D

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2389
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Manual Trigger Question in Matlab

Postby joejk » Mon Apr 24, 2017 6:12 am

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
joejk
User
User
 
Posts: 4
Joined: Thu Mar 30, 2017 5:11 am

Re: Manual Trigger Question in Matlab

Postby Hitesh » Mon Apr 24, 2017 10:34 am

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

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2389
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