09-09-2020 08:32 AM
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!
09-09-2020 12:05 PM
"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.
09-09-2020 03:25 PM - edited 09-09-2020 03:26 PM
@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.
09-10-2020 02:26 AM
@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.
- Connect the laser trigger output to the scope trigger input
- There should be a vi or SCPI command to check the scope trigger status
- 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.
09-10-2020 08:19 AM
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
09-10-2020 08:22 AM
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
09-10-2020 09:12 AM - edited 09-10-2020 09:15 AM
Why can't you use single acquisition mode?
We use Lecroy scopes here and these are the steps I take