LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using scope trigger to time VI

Hi,

 

The question is similar to this one. To be more specific, I need help with the "end loop when "trigger condition" is met" part.

 

I have an oscilloscope connected to my computer. I'm able to control the scope from the VI and present, analyze and save data from the scope.

 

A 20 Hz (repetition rate) laser is used to trigger the entire experiment. The laser sends an electrical pulse, which triggers the scope. I'd like to start data acquisition as soon as the first trigger arrives. So, how can I check that the triggering event occurs and use that to start the downstream events?

 

Thanks!

0 Kudos
Message 1 of 7
(1,229 Views)

"end loop when "trigger condition" is met" means to wire True to the stop condition on the while loop when the condition is met. So for you, that probably means monitoring the laser signal in a while loop and ending that loop when you see the 20 Hz signal. Data Acquisition should begin after that loop is done.

A state machine would probably work for you here (Monitor Laser state, Data Acq state, and End state) but without seeing the code I'm not going to suggest you re-architect it.

Message 2 of 7
(1,206 Views)

@Michael_Muzika wrote:

 

A 20 Hz (repetition rate) laser is used to trigger the entire experiment. The laser sends an electrical pulse, which triggers the scope. I'd like to start data acquisition as soon as the first trigger arrives. So, how can I check that the triggering event occurs and use that to start the downstream events?

 

Thanks!


Assuming that scope has an external trigger input like any other scope.

  1. Connect the laser trigger output to the scope trigger input
  2. There should be a vi or SCPI command to check the scope trigger status
  3. Change your program to use and wait for the external trigger

 

 

========================
=== Engineer Ambiguously ===
========================
Message 3 of 7
(1,188 Views)

@RTSLVU wrote:

@Telldunkin wrote:

 

A 20 Hz (repetition rate) laser is used to trigger the entire experiment. The laser sends an electrical pulse, which triggers the scope. I'd like to start data acquisition as soon as the first trigger arrives. So, how can I check that the triggering event occurs and use that to start the downstream events?

 

Thanks!


Assuming that scope has an external trigger input like any other scope.

  1. Connect the laser trigger output to the scope trigger input
  2. There should be a vi or SCPI command to check the scope trigger status
  3. Change your program to use and wait for the external trigger

 

 


This is a very informative blog for me. I am very much benefited after reading this blog. Keep sharing.

0 Kudos
Message 4 of 7
(1,158 Views)

Thanks for the answer.

 

I'm attaching that program and a screenshot, so you don't need to get the drivers for the instrument (Tektronix TDS 2024B if you're interested).

 

The part in the red rectangle is the initial setup conditions. Trigger, timeout etc. are first configured when the VI is run. Note that I configured continuous acquisition. Then the part in the blue rectangle kicks in - this is a while loop which takes the waveform from the scope and analyzes the data.

 

What Tektronix's driver has is a low level VI called "Wait for Trigger" which is practically what I need, but it's only meant for a single acquisition mode. not continuous. I've tried making a "manual" continuous acquisition, by switching to single acquisition mode and adding "the wait for trigger" VI into the while loop - for some reason it doesn't work well.

 

Is there a different way to check that the laser signal is active and use that as the stop condition for the while loop?

 

Thanks,

Michael

Download All
0 Kudos
Message 5 of 7
(1,145 Views)

Thanks for the suggestion. You've hit the nail on the head.

 

2. The only VI that I found that checks the trigger status is the "Wait for Trigger" VI that comes with the Tektronix driver (the instrument is Tektronix TDS 2024B, in case you're wondering). It's exactly what I need, except it only works with single acquisition mode, qhile I need continuous acquisition.

 

Is there a different way to check for trigger status?

 

Thanks,

Michael

0 Kudos
Message 6 of 7
(1,140 Views)

Why can't you use single acquisition mode?

 

We use Lecroy scopes here and these are the steps I take

  1. Configure horizontal, vertical, and trigger
  2. Arm the trigger
  3. Poll the trigger until acquisition complete 
    1. Lecroy trigger has three states armed, triggered, acquisition complete
  4. Save the waveform and/or take the measurements 
  5. Goto 2
========================
=== Engineer Ambiguously ===
========================
Message 7 of 7
(1,133 Views)