User manual

Table Of Contents
Part 2: Automation Programming Reference
lecroy.write(r"""vbs 'app.measure.showmeasure = true ' """)
lecroy.write(r"""vbs 'app.measure.statson = true ' """)
lecroy.write(r"""vbs 'app.measure.p1.view = true ' """)
lecroy.write(r"""vbs 'app.measure.p1.paramengine = "<value>" ' """)
lecroy.write(r"""vbs 'app.measure.p1.source1 = "C1" ' """)
Acquire
Now write code to arm the acquisition. Again, timing is important: this example takes 10 acquisitions,
forcing a trigger if none occurs after 0.1 seconds (the second and first arguments, respectively, of
'app.acquisition.acquire'), then uses the 'app.WaitUnitIdle' method to wait for 5 seconds after all
acquisition processing is complete before measuring.
for i in range(0,10):
r = lecroy.query(r"""vbs? 'return=app.acquisition.acquire( 0.1 , True )' """)
r = lecroy.query(r"""vbs? 'return=app.WaitUntilIdle(5)' """)
if r==0:
print "Time out from WaitUntilIdle, return = {0}".format(r)
Read Back Measurement Results
Read the Out.Result object of the P1 parameter into a variable of your choosing, and print the value.
Just as the Automation commands were sent within the VBS command wrapper, the Automation query is
sent within the VBS? query wrapper. For <var>, you can substitute the name of the measurement you
choose earlier.
<var> = lecroy.query(r"""vbs? 'return=app.measure.p1.out.result.value' """)
print "<var> = {0}".format(<var>)
Disconnect
Finally, close the remote connections to the scope and to VISA, in the reverse of the order in which you
opened them:
lecroy.close()
rm.close()
Execute
Save the file as Exercise4.py. Navigate to the file on your PC and execute it.
If these steps were followed correctly, you should observe the oscilloscope resume the Default Setup. The
Measure table should appear below the waveform, showing the results of the measurement you set in P1.
Meanwhile, the following should appear in your console:
Time out from WaitUntilIdle = <value>
<var> = <value>
2-23