Download USB Data Logger User Manual

Transcript
The following header objects are defined:
Syntax:
execMode
Effect:
set this to override the default execution mode of the script, which
restarts automatically if it halts, possible values include: #defaultExecMode,
#execModeNoRestart
Syntax:
execPriority
Effect:
set this to override the default execution priority of the script
(the higher the number, the more priority), the default is: #defaultPriority.
String Constants
String
Constants
are
specified
with
double
quotes
“”.
Comments
Single line comments begin with two '/' characters.
Using Strings
While most variables are 32 bit floating point numbers, you can also declare and use string
variables. Strings are '\0' (NULL) terminated sequences of 8 bit characters (ASCII) which are stored
in memory. Local string variables' names begin with a single '*' character, which is supposed to be
reminiscent of the dereferencing operator in C. In analogy with variables and functions, global
string variables' names begin with two '*' characters (although there are none defined at this version
stage). For example, the following script shows how local string variables can be used, they are
assigned using comma separated lists (same as with the PRINT/print command).
START CUSTOM SCRIPT
HEADER counter
{
// A simple script showing how to use local string variables...
// And a counter...
// By Mauro Grassi...
}
SCRIPT counter
{
// The following is a local string variable...
*U=" events...";
// Open a counter on input #D0, it counts falling edges...
// Opening the counter also clears it, ie. sets it to 0...
@@openFallingCounter(#D0);
// Remember the last count...
while(1)
{
*A=”The Counter is up to “, @@readCounter(#D0);
print *A, *U, newline;
sleep(1);
}
}
END CUSTOM SCRIPT
Typical output would be: