Other features of execute script – YSI Data Scout Advanced User Manual

Page 111

Advertising
background image

There is also an SDI-12 protocol-specific form of Wait called WaitSR which also accepts the same delay period argument as Wait.
Since it is a conditional wait, it is much more responsive than waiting a fixed amount of time. For example:

WaitSR PrvRspSec

Wait till transducer returns a Service Request (SR) response indicating that its data is ready. The PrvRspSec
argument is used as an ultimate timeout if the expected SR is not received.

The above meta command always times-out for SDI-12 commands that do not generated a timely Service Request response.

The Script file may contain special looping commands to repeat single commands or groups of commands and meta-commands. A
maximum of eight (8) loops may be used in a script.

Any loop in the script must begin with a do loop[x] meta-command on a line by itself, and end with a loop[x] meta-command on a
line by itself. The optional loop index [x] must be 1-8. If [x] is missing, loop #1 is assumed. Any other commands or meta-
commands on lines between these two special begin/end loop meta-commands will be repeated indefinitely (if the loop specifies no
repetition <count> parameter) or will be repeated a finite number of times that you specify. The <count> parameter may appear
optionally on either the beginning meta-command as: do loop[x] [<count>] or on the ending meta-command as: loop[x] [<count>].
If the <count> parameter appears on both meta-commands that define the loop the Execute Script program will yield unpredictable
results. If neither meta-command includes a <count> parameter the loop will repeat “forever” (or until the user presses the Abort
Script
button on the form). The <count> parameter may be assigned a direct numerical value, or may refer to a named script
constant
(e.g., NumXdcrs) or to a script variable (A-Z). The following excerpt from a Script file (using Loop #2) is an example of a
repeated SDI-12 command sequence with the repetition <count>=NumXdcrs, specified here at the end of the loop:

:

Set x 1

Initialize Loop to start with Xdcr #1

Do

Loop2 Loop

begins

(#x)M0

Send Read Pressure Measurement

Wait PrvRspSec

Wait for time specified by M0 response

(#x)

Read special Service Request in input buffer

(#x)D0

Read Pressure Data from Xdcr

Loop2

NumXdcrs

Loop ends, Repeat this loop for each Xdcr

:

A single script may, at most, employ only eight (8) such loops. However, these loops may be employed sequentially, nested, or as a
combination of both. The script program checks for such anomalies in a pre-compile stage before the script is executed. Thus, if you
“re-use” a particular numbered loop, or fail to properly match up the beginning and ending of each used loop, the script will self-abort
before any command is executed. In this case no Log file is ever written. Such a pre-compile error is indicated by turning the
background color of the status box bright orange.

The Script form turns its normally pale yellow status box bright yellow when it starts executing a script. A normal completion of the
script turns the box bright green. An abnormal abort of the script (manually or due to errors detected by the script itself) turns the box
bright red
. The message displayed inside the box will either indicate the reason for that particular “colored” status, on will indicate
where you can find that information. For example, specific errors message may be found only in the Log file itself after a script has
aborted with errors. Such error messages will begin with two asterisks (**), so you can use the Find function of your text editor to find
them.

OTHER FEATURES OF EXECUTE SCRIPT

The script program expects one response from the transducer after each transducer base command is executed, and will not advance
the script unless this condition is met. If the transducer does not return a valid response, or returns no response at all, a Data Scout
Advanced error message may eventually appear (after a suitable timeout period) to prevent hanging the script forever. However, while
a script is running, a Skip Cmd. button is enabled that may be useful should a very long “timeout” delay or “hang” occur due to a bad

YSI Incorporated

Data Scout Advanced

107

Advertising