Page
225
of
248
@TASK
def trigger_sampler():
"""Checks last readings of M1 and M2. If readings meet
conditions, sampler is triggered via a digital output"""
if (measure(1).value > 32.5):
if (measure(2).value < 13.9):
# trigger sampler by pulsing output for 500ms
output_control('OUTPUT1', True)
utime.sleep(0.5)
output_control('OUTPUT1', False)
# write a log entry
reading = Reading(label="Triggered", time=utime.time())
reading.write_log()
20.4
Scripts Management
Please us
e LinkComm to send a new script file to the station. LinkComm’s Script tab provides all the
needed features to manage the script file.
Please note that the station holds only one script file. That file may have any number of functions.
Every script file must include the sl3 module. To the top of each script, add
from sl3 import *
The traditional workflow to setup scripts in:
Run LinkComm and connect to the station
Go to LinkComm’s Script tab
Open an existing script file or paste in the script
Verify that the expected functions are listed by LinkComm
Press the Test Script button and verify the script works
Setup a measurement that will use the script:
Go to the measurement tab
Proceed to setup the measurement(s) to interface to the sensors
Enable Measurement setting
Use Script
Set Measurement setting
Script Function
to one of the provided script functions. LinkComm
will automatically list all compatible functions found in the script file.
Send setup to the unit
Press the Force button to verify that the measurement works as expected.
Setup a transmission that will use custom formatting:
Go to the telemetry tab
Setup the transmission
Enable Custom Script Format
Choose the appropriate
Script Format Function.
LinkComm will automatically list all
compatible functions found in the script file.
Summary of Contents for SUTRON XLINK 100
Page 230: ...Page 230 of 248...
Page 247: ...Page 247 of 248...