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

5.1.1 User Program

In UserDefined Mode, the SmartSampler executes a sequence of instructions defined by the user. Each instruction is written on its own line and follows this general structure:

F#,T#,S#,O#,P#,I#

Where:

  • F# = Function number
  • T# = Time parameter, target line, or mode (depending on the function)
  • S# = State or secondary parameter
  • O# = Output number (only for functions that control outputs)
  • P# = Sub-program selection (optional)
  • I# = Invert flag (only for output control functions)

Not all functions use all parameters. Unused parameters may be omitted.

The program uses the configuration defined in the GUI (sensor inputs, modules, timing settings, output modes). The User Program controls the sequence in which actions occur.


Accessible Variables

The following variables can be used in User Programs and User Formulas.

Sensor Variables (A to D)

These correspond to the sensor string positions selected in the GUI. They are updated automatically after each sensor read.

VariableMeaningTypeRangeUser Editable
A–DSensor inputsfloatSensor dependentNo

User Parameters (G, H, J, K, L, M)

Editable under
Basics -> Home

VariableMeaningTypeRangeUser Editable
G, H, J, K, L, MUser parametersuint16_t0 to 65535Yes

Formula Result (R)

Contains the result of the most recently evaluated formula.

VariableMeaningTypeRange
RFormula resultdoubleFull double precision

Counters (X, Y, Z)

General-purpose counters used for loop control or conditional logic.

VariableMeaningTypeRangeEditable
X–ZCountersuint32_t0 to 4,294,967,296Indirectly via F15

Function-Specific Identifiers (I, O, T, P, S)

These letters are not variables. They are parameter labels used inside function definitions:

  • I = invert flag
  • O = output reference
  • T = time or mode
  • P = sub-program
  • S = state or secondary argument

These are not numeric variables and cannot be used in formulas.

How can we help?