Page
218
of
248
20
Scripts
For further customization, XLink supports scripts written in the Python programming language. Not all
XLink models have this feature. These scripts may be used to
Collect data from sensors that are otherwise unsupported, such as an RS-232 sensor
Do custom measurement processing
Perform control operations
Allow for custom transmission formatting
And much more
…
This manual provides an overview on Python scripts and how they integrate into station setup. Further
documentation is located on the Sutron website. It includes the Python API, development environment
setup, Python resources, additional libraries, and example code.
To load a script file into the station, please read the section
. Please note that
Every script file must include the sl3 module. To the top of each script, add
from sl3 import *
The station handles Python scripts in conjunction with the standard setup. There are three main interface
points:
Measurements, via the
Use Script
and
Script Function
settings.
Transmissions, via the
Custom Script Format
and
Format Function
settings.
Script Tasks, which are a new concept; each task runs a script at the customer designated time.
20.1
Measurements and Scripts
Measurement scripts work in the following fashion:
A value is read from the sensor using the standard setup
The sensor value is further processed by the script
This is similar to how measurement equations work.
Scripts do not have direct access to analog and digital sensor inputs. Instead, measurements need to be
setup to collect data from those sensors. Python scripts then do processing on the measurement results.
Two settings are relevant when using measurements and scripts:
Use Script
Script Function
Содержание SUTRON XLINK 100
Страница 1: ...Operations Maintenance Manual SUTRON XLINK 100 500 Part No 8800 1217 Rev 8 44 4 January 14 2022...
Страница 230: ...Page 230 of 248...
Страница 247: ...Page 247 of 248...