Synchronization, Overview – Teledyne LeCroy WaveExpert series Automation Manual User Manual
Page 29
C
HAPTER
O
NE
Overview
916435 RevA
1-17
SYNCHRONIZATION
Synchronization or, more specifically, knowing when to read results, is critical when working with a digital
oscilloscope by remote control (it is just as important by IEEE488.2 control as by Automation). This is especially
true when working with an oscilloscope that uses a multithreaded architecture.
A classic problem seen in the majority of custom applications that control LeCroy (or other) DSOs is that the
scope is left to free-run in Auto-trigger mode while simultaneously (and asynchronously) results are queried.
While working with the instrument via the Automation interface, there are a few techniques that can be used to
guarantee the synchronization and consistency of results, whether they be waveform or parameter
measurements.
The following example demonstrates a useful technique for ensuring synchronization. This example runs as an
Excel macro:
Sub
Button1_Click()
' Connect to the DSO
Set
app = CreateObject("LeCroy.XStreamDSO")
' Enable Standard Vertical parameters
app.Measure.MeasureMode = "StdVertical"
' Stop the free-running trigger and take a single acquisition
' Use a 10 second timeout in the case that the acquisition is not complete.
app.Acquisition.TriggerMode = "Stopped"
app.Acquisition.Acquire (10,
True
)
' Read the first parameter value and transfer into the spreadsheet
Cells(1, 3).Value = app.Measure.P1.Out.Result.Value
End
Sub
The Acquire method arms the acquisition system and waits for a user-specified time for a trigger. The second
argument, a Boolean, specifies whether or not to force a trigger before returning if a trigger doesn’t arrive within
the allotted time period. The method also returns a Boolean value signifying whether or not a trigger arrived. See
the reference section for more information on this useful method.
Another scenario where synchronization is necessary is between changing settings and reading results, even
when no acquisition took place. For this the WaitUntilIdle method is used. This method is “blocking” and will not
return control until the setup request has completed.
Note that the Acquire method is equivalent to setting the Trigger Mode to “Single”, then executing WaitUntilIdle.