Standard library
Find the modules and built-in functions that every Arc automation can use.
The Arc standard library has modules and built-in functions. To use a module, import it
at the top of the file, then call its functions by their qualified name. A qualified
name without an import is an error.
import time
time.interval{period=1s} -> heartbeatModules
Built-in functions
Built-in functions need no import.
on and write are the nodes that the graph editor shows as Telemetry source and
Telemetry sink. In text, a channel name does the same work:
on{channel=tank_pt} -> tank_pt_copy
tank_pt -> write{channel=tank_pt_copy}on and write cannot be in the same flow. The compiler cannot find a type for them
and stops with on_0_T: unresolved type variable: constraints.
The comparison functions take two numeric values, a and b, of the same type. A flow
input fills a, and {} sets b:
tank_pt -> gt{b=300.0} -> tank_highand, or, and not are keywords, so text code cannot call them as functions. Use the
operators.
Deprecated names
The names avg, min, max, derivative, interval, wait, now, set_authority,
and stable_for without a module still compile, with warning
ARC4003. Use the qualified
names, such as math.avg and stable.for.