Modular field instruments · Engineered and produced in Germanyinfo@smartsamplersolutions.com

5.1.4 Creating your first program

This example creates a user-defined program that waits for 30 seconds and then ends. It demonstrates how to add and configure actions, connect them, generate code, and validate the result.

  1. Open the Visual Programmer. A new workflow starts with the Start block.
  2. In the Blocks tab, locate F3 – Delay and drag it onto the canvas below Start.
  3. In the configuration window, set Wait for to 30 seconds. Leave Program section set to Main program (no P value). Add an optional comment, then select Apply.
SmartConfig2 configuration window for a 30-second Delay action
Configuring the Delay action.
  1. Drag F1 – End program from the Blocks tab onto the canvas below the Delay block. Retain the main-program setting and select Apply.
  2. Connect the lower port of Start to the upper port of Delay.
  3. Connect the lower port of Delay to the upper port of End program.
  4. Confirm that the connections show the intended execution order.
SmartConfig2 visual program containing Start, Delay, and End program actions
A program that waits for 30 seconds and then ends.
  1. Open the Code menu and select Flowchart to code.
SmartConfig2 Code menu used to generate program code
Generating program code from the visual workflow.
  1. Open the Validation tab and select Validate. Confirm that there are no errors requiring correction. If an issue is reported, double-click the relevant block, correct its settings, and validate again.
  2. Select Apply code to SmartConfig2 to return the generated program code to SmartConfig2.
SmartConfig2 Visual Programmer Validation tab showing validation results
Validate the program before applying it.

Resulting program flow

When the user-defined program runs on a SmartSampler2, execution starts at Start, waits for 30 seconds at F3 – Delay, and then reaches F1 – End program. This example does not read sensors, switch outputs, or transmit data.

Before configuring a connected SmartSampler2, follow the documented USB connection and cable guidance in SmartSampler2 hardware interfaces.

Related hardware: SmartSampler2 hardware reference.

Ask an engineering questionSoftware & downloads