stepWidth
Short summary
Sets the step width for automatic step increment for the current step.
Purpose and usage
This property sets the increment value used when automatically advancing from the current step. It overrides the sequence default step width for this specific step. When no explicit next step is specified, the cycle manager will advance by this step width value.
This allows individual steps to have different increment values, useful for:
- Skipping blocks of steps
- Jumping to different sequence sections
- Implementing conditional branching
- Custom step numbering schemes
typical usage patterns
- Skip sections: Large step width to jump over optional sections
- Branch control: Different widths for different branches
- Return jumps: Negative values to go back in sequence
- Custom flow: Implement complex sequencing logic
When to use
- When this step needs to jump to a non-sequential next step
- For implementing branching logic
- To skip optional sequence sections
- When overriding the default sequential flow
Example
// Configure step to skip optional section
CASE cycleManager.steps.current OF
100: // Decision step
IF skipOptionalSteps THEN
// Jump to step 200, skipping 110-190
cycleManager.configuration.configuration.step
.stepWidth := 100;
ELSE
// Normal increment to 110
cycleManager.configuration.configuration.step
.stepWidth := 10;
END_IF;
cycleManager.steps.next := 0; // Use automatic increment
190: // Last optional step
// Ensure we continue at 200
cycleManager.configuration.configuration.step
.stepWidth := 10;
cycleManager.steps.next := 0; // Automatically goes to 200
250: // Loop back step
IF repeatRequired THEN
// Go back to step 200
cycleManager.configuration.configuration.step
.stepWidth := -50;
cycleManager.steps.next := 0; // Automatically goes to 200
END_IF;
END_CASE
- Type:
DINT - Setter:
public
Code
Declaration
PROPERTY stepWidth : DINT