Trellis
Write a short program that runs your test on live channels. It reads sensors, sets stop conditions and safety limits, and lays out a live page. Then you Deploy it. If a limit trips, Phloem drives outputs safe on its own, within milliseconds.
Two views: Code (the editor) and Panel (the live page it builds).
setup("heater")
ch = channels()
ch.read("/demo/temperature", unit="degC", range={"min": 0, "max": 100},
limits=limits(hihi=80), checks=True)
ch.write("/demo/heater_on", dtype="bool", safe=False)
interlock(
name="overtemp",
when=lambda: ch["/demo/temperature"] > 90,
then=[set(ch["/demo/heater_on"], False)],
)
page("Heater test",
layout=col(row(gauge(ch["/demo/temperature"]), toggle(ch["/demo/heater_on"])),
row(alarms(), log())))
Deploy arms it. Stop (or Shift+Esc) drives every output to its safe value. After a trip, press Reset to re-arm.
Three kinds of document
The first statement sets the kind. The kind decides what the document can do.
| First statement | Kind | Can |
|---|---|---|
setup("name") | Setup: your test setup. One is deployed at a time | declare channels, stop conditions, interlocks, safe values, procedures, the page |
recipe("name", setup="…", unit="…") | Recipe: judges one unit, running on the deployed setup | steps, measurements, bounds. Never an interlock |
| none | Notebook: analysis on live data | compute and chart. It can never drive an output |
Parts
Declare reads and writesRead sensors, write commandsStop conditionsBounds that stop the testInterlocksSafety limits that actAlertsNotify Slack, Teams or emailProceduresOne-click test profilesUser pageGauges, controls, logsPeersTest across two machinesAcceptance recipesJudge a unit: steps, measurements, verdictsRun your own scriptsexec a script; it publishes, the recipe judgesNotebooksWork out a number on live data
Updated