
SR1 Operation
245
© 2014 Stanford Research Systems
complex functions which can return values and take multiple arguments. In general, double clicking on
any item in the SR1 Basic interface window inserts that text at the cursor location in the main script
window.
Properties
Properties are either integer, floating point or "unit-ed" quantities. Integer quantities are read and set as
follows:
dim intVal
intVal = SR1.AnlgInputs.HiResSampleRate 'read the hi-res sample rate
SR1.AnlgInputs.HiResSampleRate = intVal ' set the hi-res sample rate
Some integer properties have "enumerations" associated with them. Enumerations are short mnemonic
text strings which can be used in place of integer values. Any enumerations associated with a property
are shown underneath the property with the
icon. So for instance the two lines below are
interchangeable.
SR1.AnlgInputs.HiResSampleRate = 1 ' set to an explicit integer value
SR1.AnlgInputs.HiResSampleRate = srHz128k ' set to the equivalent enumeration
These enumerations exist in the SR1 internal scripting environment. To specifiy these enumerations in
VisualBasic, MS Office, or other scripting environments, they must be referred to as "SR1.enumtype.
enum" e.g.:
SR1.HRSR.srHz128k
Enumeration types are found in the file SR1.tlb (SR1 type library)
Unit-ed properties require an additional argument to specify the units the property should be expressed
in. For instance:
x = SR1.AnlgGen.AGenChA.Gain("db")
assigns to the variable x the value of the Analog Generator (channel A) gain in units of db. To set the
corresponding property:
SR1.AnlgGen.AGenChA.Gain("db") = -10.0
To read the value of a unit-ed property in "current units", simply use an empty string for the unit specifier.
x = SR1.AnlgGen.AGenChA.Gain("")
Unit-ed properties typically have an associated property which reads the current units of the property.
For instance:
stringvar = SR1.AnlgGen.AGenChA.GainUnit
assigns to the variable stringvar the unit-string for the Gain property.
When setting a unit-ed property, the specified units become the current units. For instance
SR1.AnlgGen.AGenChA.Gain("%") = 50.0
sets percent (%) as the current units of the gain property.
An object can be assigned to a variable using the "set" keyword:
Summary of Contents for SR1
Page 5: ...Part I Getting Started Audio...
Page 7: ...Getting Started 7 2014 Stanford Research Systems...
Page 12: ...SR1 Operation Manual 12 2014 Stanford Research Systems...
Page 27: ...Part II SR1 Operation Audio...
Page 258: ...SR1 Operation Manual 258 2014 Stanford Research Systems...
Page 272: ...SR1 Operation Manual 272 2014 Stanford Research Systems on the amplitude sweep...
Page 289: ...SR1 Operation 289 2014 Stanford Research Systems...
Page 290: ...Part III SR1 Reference Audio...