1. Home
  2. Docs
  3. SmartConfig2.1
  4. 5. Sampler Modes
  5. 5.1 User defined/ User Pr...
  6. 5.1.2 Functions

5.1.2 Functions

F1 – End Program

Ends the user-defined sequence. Typically used as the last step in your program.

  • Params: None required

F2 – Loop to Line

Loops execution back to specifed line number, can be used to loop over

  • T: Target line to loop to.
  • P: Optional sup program
  • ExampleF2,T3 (jump to line 3 unconditionally), F2,T3,P1 (only if sub program P1 is active)

F3 – Delay

Waits for a fixed period before executing the next instruction.

  • T: Duration to wait (in milliseconds or seconds depending on system configuration).
  • P (optional): Sub-program this delay belongs to (e.g., P1P2).

Use this when you need to add a pause between operations — for example, to wait before reading a sensor or switching an output.


F4 – Wait for Next Alarm

Halts execution until the next scheduled wakeup alarm.

  • No time parameter — this command waits until the next internal or external wakeup source becomes active.

Useful for regular sampling intervals or deep-sleep energy-saving setups.


F5 – Switch Module

Turns a hardware module ON or OFF for a defined duration.

  • T: Duration to stay in the specified state.
  • S: State to switch to (0 = OFF, 1 = ON).
  • P (optional): Sub-program label.

Use this to power modules such as pumps, valves, or other actuators that have been configured in the GUI.


F6 – Switch Sensor

Powers a sensor ON or OFF for a specific time.

  • T: Duration to remain in the given state.
  • S: State to switch to (0 = OFF, 1 = ON).
  • P (optional): Sub-program label.

Use this to warm up sensors or disable power-hungry components between reads.


F7 – Switch Output

Controls a digital output pin for a defined time.

  • T: Duration to keep the output active.
  • S: Desired state (0 = OFF, 1 = ON).
  • O: Output number as configured in the GUI.
  • P (optional): Sub-program label.
  • I : Invert logic (1 = inverted).

This is used for triggering external devices, activating relays, or controlling other hardware components.


F8 – Read Sensors

Triggers a sensor readout using the parameters set in the GUI.

  • T: Time to wait after triggering the readout (to allow sensor response).
  • P (optional): Sub-program label.

Useful for getting environmental data (e.g., pressure, flow, CO₂) based on preconfigured sensor settings.


F9 – Send Data

Sends all buffered or newly read sensor data to the designated output (e.g., SD card, telemetry, etc.).

  • T: Delay before sending the data.
  • P (optional): Sub-program label.

Use this after a sensor read to store or transmit the data.


F10 – Send Basic Telemetry

Sends general system information such as battery status, signal strength, and system uptime.

  • T: Time to wait before sending.
  • P (optional): Sub-program label.

Helps with remote diagnostics and system health monitoring.


F11 – Send Clean Command

Sends a clean/purge/flush command to a connected cleaning mechanism.

  • T: Time allowed for the cleaning operation.
  • P (optional): Sub-program label.

Commonly used before or after sampling to avoid contamination.


F12 – Set Sub Program

Defines the start of a sub-program block.

  • P: Program identifier (e.g., P1P2, …)

This block will only be executed if the matching trigger condition (defined in the GUI) is currently active. All lines between F12 and F13 belong to the same program.


F13 – End Sub Program

Marks the end of a sub-program block.

  • T (optional): Time to wait before continuing.
  • P: Program identifier (must match the starting F12).

Execution continues after this line if the sub-program was skipped or once the block has finished running.


14 – Formula Evaluation

Allows mathematical expressions.

Syntax:

F14,<formula>,<A_pos>,<B_pos>,<C_pos>,<D_pos>

See full documentation here!


F15 – Counter

Performs operations on one of the internal counters X, Y, or Z.

  • T: Mode: 0 = reset, 1 = increment, 2 = decrement, 3 = set to value in R
  • S: Counter: 0 = X, 1 = Y, 2 = Z
  • P (optional): Sub-program label.

Can be used to count how many cycles have been made/ or to be used in a sub program with changebale in-/outputs.


F16 – FlowControl

Controls filling based on time and volume, typically to control a pump.

Syntax:

F16,T<max_time>,S<target_volume>,O<output>,P<trigger>
  • T: Max runtime in seconds (0 = use value from formula result R)
  • S: Target volume to fill (0 = use value from formula result R)
  • O: Output number to activate (e.g., pump)
  • P (optional): Sub-program label.

Example:

F16,T30,S0,O1,P1

Run for max 30 seconds
Target volume is taken from result R
Use Output 1 to control the fill
Only operate if SubProgram 1 is active


F17 – Compare Value

Compares the result R (typically from a formula) to a given value and sets a trigger.

Syntax:

F17,T<mode>,S<value>,O<set_trigger>
  • T: Mode: 0 = equal, 1 = greater, 2 = less
  • S: Value to compare against
  • O: Set a trigger if the condition is met
  • P (optional): Sub-program label.

Example:

F17,T1,S100,O1

If R > 100, trigger 1 is set.

To compare counters, use a formula first to copy the counter value into R:
Example to compare counter X:

F14,X,0,0,0,0
F17,T1,S10,O2

Set trigger to P2 if X > 10

How can we help?