Hints And Tips For Vbscripting - LeCroy WaveRunner Xi series Operator's Manual

Oscilloscopes
Hide thumbs Also See for WaveRunner Xi series:
Table of Contents

Advertisement

Int
Cint (A) calculates the integer value next below A, which can be any acceptable VBS number.
Int (-7.4) = -8.
Log
Log (A) calculates the natural log
zero. A negative number or zero will crea
To calculate Log (A), use Log (A) = Log(A)
Mod
A Mod (B) calculates the m
34 Mod 8 = 2. 34 Mo
Rand
om
ize
Calculates a new se
Randomize Timer uses the real-time clock fo
Sin
Sin (A) calculates the sine of any integer or real number, giving an output that is never greater
than +1 or less than -1.
Sqr
Sqr (A) calculates the square root of any integer or a real number that is not negative. If A is
negative, an error will occur.
Timer
Time since the previous midnight in whole seconds.
Hints and Tips
for VBScripting
Set the trigger to Single or
Before sta
rtin
g a script, re
scrip
t will giv
e yo
u error messa
a fault if you chan
ge the setup. For example, you might change the ve
overflo
w if you did not gua
When
startin
g a script, ma
very fr
ustrati
ng p
roblems if you are in the wrong
this er
ror.
If your calculation
requires a long memory
trace a
t first.
Note that the pse
udo-random number generator is r
pseud
o-rand
oms
every time, put Randomize Timer in the progra
are gene
rate
d. You can u
Do not put the final statem
chang
es. No
outp
ut will be seen on the screen of the instrument un
quitted, so only th
e final result will appear. If the loop runs many
hung u
p.
If you
want a
For
loop, end it with "Next" and not "Next X".
If you make a scr
ipt that takes a long time to run, go back to t
you will have a lo
ng wait next time you power up.
Alw
ays use a r
ec
ursive calculation when this will speed
Keep everything
outside a loop
Make
your s
cripts
clear, not only by indenting and
Somet
imes
it mig
ht be easier to develop you
so tha
t you
can d
isplay intermediate results.
sta
tements like
th
ese:
A = Worksheets(
"Sheet1").Cells(Ro
Work
sheets(
"She
et1").Cells(Row, Column).Value = B
WRXi-OM-E Rev C
10
10
odulus of A, which is the remainder after A has been divided by B.
d 55 = 0. -34 Mod 13 = -8. 21 Mod -8 = 5.
ed for the pseudo-random number generator.
Stopped if you need to do a lot of editing: it is faster.
move any existing scripts t
ges, even if your current script is perfect. And an existing good script may develop
rd against it in the script.
ke sure that you have chosen the right kind: function o
mode. You can cut and paste the VBS statements if you discover
, development might be quicker if you test the principles on a shorter
se this instruction to re-seed the gene
ent in a loop, hoping that you can see a pro
that does not have to be inside, to speed things up.
r script in Excel VBA (remembering that VBA is not identical to VBS),
If you do this, note that you can read from a cell or write to it using
w, Column).Value
arithm (to base e), of any acceptable VBS number greater than
te an error.
/ Log(10)
r this purpose.
hat you do not need. This is because errors in an existing
rtical scale or the memory length and get an
eset at the start of a script. If you want a different set of
m, to be run once, before any pseudo-randoms
rator at any time during execution.
gressive result as some parameter
til the script has been completely run and
times, you will think that the oscilloscope has
he default setup before quitting or powering down, or
things up.
commenting, but by structuring neatly as well.
O
'
M
PERATOR
S
r parameter. You can get some
ANUAL
201

Advertisement

Table of Contents
loading

Table of Contents