Section 6: Instrument programming
2606B System SourceMeter® Instrument Reference Manual
6-44
2606B-901-01 Rev. B / May 2018
To completely remove a script:
1.
Remove the script from the run-time environment.
Set any variables that refer to the script to
nil
or assign the variables a different value. For example, to remove the script
"beepTwoSec"
from the run-time environment, send the following code:
beepTwoSec = nil
2.
Remove the script from the script.user.scripts table.
Set the name attribute to an empty
string (
""
). This makes the script nameless, but does not make the script become the anonymous
script. For example, to remove the script named
"beepTwoSec"
, send the following code:
script.user.scripts.beepTwoSec.name = ""
3.
Remove the script from nonvolatile memory.
To delete the script from nonvolatile memory,
send the command:
script.delete("
name
")
Where
name
is the name that the script was saved as. For example, to delete
"beepTwoSec"
,
you would send:
script.delete("beepTwoSec")
Restore a script to the run-time environment
You can retrieve a script that was removed from the run-time environment but is still saved in
nonvolatile memory.
To restore a script from nonvolatile memory into the run-time environment, you can use
script.restore("
scriptName
")
, where
scriptName
is the user-defined name of the script to
be restored.
For example, to restore a user script named
"test9"
from nonvolatile memory:
script.restore("test9")
Memory considerations for the run-time environment
The 2606B reserves 32 MB of memory for dynamic run-time use. Approximate allocation of this
memory is shown below:
5 MB
Firmware general operation
1 MB
Reserve for instrument internal operation
2 MB
Reserve for future firmware updates
24 MB
Run-time environment, user-created reading buffers, and active sweep
configuration
Note that the run-time environment, user-created reading buffers, and active sweep configuration
must fit in the 24 MB of memory that is available. The amount of memory used by a reading buffer is
approximately 15 bytes for each entry requested.
Reading buffers also use a small amount of memory for reading buffer management, which is not
significant when making memory utilization calculations. For example, assume two reading buffers
were created. One of them was created to store up to 1,000 readings and the other to store up to
2,500 readings. The memory reserved for the reading buffers is calculated as follows:
(1000 * 15) + (2500 * 15) = 52,500 bytes or 52.5 kilobytes