XLINK 500/100 Operations & Maintenance Manual page # 185
Script will run when the system turns on. It does not matter if recording is
on; script will run at bootup.
Digital 1
Digital 2
Script will trigger when the appropriate digital input changes. System must
be recording.
Alarm In Only
Alarm In And Out
Alarm Out Only
These triggers are associated with alarms; they only happen if recording is
on.
Recording On
Recording Off
Script runs when recording is turned on or off.
On User Connect
This happens whenever the customer connects to the station via Wi-Fi, RS-
232, USB cable, Cell Modem (SMS and TCP/IP), Iridium Message, Front Panel
Button Press
This trigger will never happen more frequently than once a minute. System
does not need to be recording.
On Button press
Whenever the front panel button is pressed, the script will run, regardless
of whether the system is recording. Please note that
On User Connect
also
happens when the button is pressed.
19.3.2.
Rules for Script Task Functions
These rules must be followed when writing a script task function:
The @TASK decorator must be on the line preceding the Python function. The
decorator is case sensitive.
The function does not take in any parameters.
The functions does not return any parameters.
The function may call into any other functions in the script. Those other functions do
not need to have the @TASK decorator.
19.3.3.
RS-232 Output Script Example
The following example uses a script task to send data out the RS-232 port. The example will read
the last value of measurement M1 and output it on the RS-232 port. It is expected that the
script will run on a schedule. Such a script could be used to drive a RS-232 display or to pass
data to another logger.
@TASK
def rs232_last_meas():
with serial.Serial("RS232", 9600) as output:
output.write(str(measure(1, READING_LAST)) + "\r\n")
output.flush()
19.3.4.
Setup Change Script Example
This script increases the measurement and transmission intervals, which results in more frequent
data collection and transmissions. It is meant to be run when the system goes into alarm. That
means the Script Task’s
Trigger
should be set to
Alarm In Only
.