| Examples of Methods |
| PC : spike\scripts\toolmake.s2s | Mac : spike2:scripts:toolmake.scr |
This utility script lets you design and test a toolbar, then writes the equivalent script. This can be very useful as toolbars are used as the basis of most scripts. Careful use of this script and the dlgmake.s2s script can save a lot of time when writing your own scripts.
| PC: dlgdesign.ZIP 202,461 |
This script allows you to create complex Spike2 script dialogs without writing code. You can add, delete, move and edit dialog items interactively by pressing toolbar buttons and using keyboard shortcuts. You can create dialogs with up to 20 user-defined buttons, up to 40 items of other types and up to 200 text prompts. When you have finished designing your dialog, the script prints out the required code so that you can copy and paste it into your script.
This script requires Spike2 version 5 or higher.
| PC : spike\scripts\dlgmake.s2s | Mac : spike2:scripts:dlgmake.scr |
This script is a utility that writes a script to generate simple dialogs. It illustrates the use of the toolbar for selecting options and can add dialog fields of any type. It also gives examples of creating complex dialogs with user-defined positions of dialog elements.
| PC : spike\scripts\automeas.s2s | Mac : spike2:scripts:automeas.scr |
This script shows how to use a memory channel to mark peaks and troughs in a data channel and how to make measurements and write results to the log window. It also demonstrates custom cursor labels and advanced toolbar use.
| PC : restvar.zip 4,132 | Mac : restvar.sit 5,738 |
This script illustrates the use of external text files in Spike2 to save and restore the values of script variables. When the script is terminated, a text file is created holding the value of the script variables. When you run the script again (possibly switching off your machine in-between), the variable values are loaded back into the script so it is as if you had not left.
| PC : nesttool.zip 1,885 | Mac : nesttool.sit 3,261 |
This is an example of a script using nested toolbars. It is designed for people who are already writing scripts and wish to be able to call one toolbar from another. It is a skeletal script with very little functionality, but serves as a good demonstration of the techniques involved.
This script has a main toolbar which can call another toolbar which, in turn, can call another one. Then, as you leave each toolbar, the script returns to the one which called it.
| PC: autodac.zip 1,760 |
An example of running a sequenceer from a Spike2 script, including the use of sequencer variables. It requires that the sequencer file autopump.pls is placed in the Spike2\sequence directory. To see the effect, you should set up a sampling configuration with two waveform channels and connect DAC outputs 0 and 1 to ADC inputs 0 and 1.
| PC: onskel.zip 1,434 | Mac: onskel.sit 1,962 |
This is an empty script that doesn't do anything much, but is a framework upon which you can build your own script for online analysis. It provides controls for the sampling via a toolbar plus a customisable idle function to carry out analysis.
| PC: skel2.zip 963 | Mac: skel2.sit 1,182 |
This is an empty script that doesn't do anything much, but is a framework upon which you can build your own script. It provides a loop that repeatedly opens a single data file for analysis until the user stops.
| PC: skeleton.zip 1,866 | Mac: skeleton.sit 2,535 |
This is an empty script that doesn't do anything much, but is a framework upon which you can build your own script. It provides handling of a list of open data files including opening more files, plus selection of a file for analysis.
| PC: BatchProcess.zip 905 |
This is a skeleton script that can be easily modified to do the same thing to all smr files (or a subset of smr files) in a selected directory - for example setting up active cursors.
These scripts are stored as WinZip files, myscript.zip, except where they are shown as spike\scripts\myscript.s2s. Those latter files were installed with Spike2 and spike stands for the directory in which you installed Spike2. See the summaries by clicking on the description line, below. Then you can down-load them by clicking on the filename; please check the size received.
![]()