1. Home
  2. Docs
  3. SmartConfig
  4. Sampler mode
  5. UserDefined
  6. Examples

Examples

Simply switch outputs

This program sequentially switches Output 1 to 3 ON for 5 seconds each, turns them OFF, then waits for 60 seconds and loops back to the beginning.

F7,T5,S1,O1,I0
F7,T0,S0,O1,I0
F7,T5,S1,O2,I0
F7,T0,S0,O2,I0
F7,T5,S1,O3,I0
F7,T0,S0,O3,I0
F3,T60
F2,T1

Repeating Sequences Using Sub-Programs

Repeating sequences can be programmed using sub-programs.
When a sub-program ends (with F13), execution automatically continues from the line after the one that called it.
For stability, sub-programs should be located at the end of the user-defined code.

Example: Repeating Sub-Program (P1)

F12,P1                     // start of the sub program P1
F7,T5,S1,O1,I0,P1  // switch on output 1
F7,T0,S0,O1,I0,P1  // switch off output 1
F13,P1                    // end of sub program

Full Code Example: Periodic Measurement with Output Pulse

This program periodically switches Output 1 before and after a sensor read, then waits before repeating.

F2,T10  // go to line 9
F6,S1  // switch on sensor
F8,T20 // read sensor for 20 seconds
F6,S0  // switch off sensors
F9     // send/save data
F2,T10 // go to line 10
F3,T300 // wait 300 seconds
F2,T1   // loop to first line
F1  // end program, will never be called
F12,P1    // start of the sub program P1
F7,T5,S1,O1,I0,P1  // switch on output 1
F7,T0,S0,O1,I0,P1  // switch off output 1
F13,P1  // end of sub program

Notes

  • Sub-programs like P1 can be reused at multiple points for consistent behavior.
  • The flow always resumes at the line after the one that called the sub-program.
  • Keeping sub-programs at the end of the file helps prevent unintentional jumps or loops.

How can we help?