TcOpen

  • Articles
  • API reference
Show / Hide Table of Contents
  • Introduction
  • Conventions
    • General
    • Components
  • TcOpen Framework
    • TcoCore
      • Introduction
      • TcoContext
      • TcoObject
      • TcoTask
      • TcoState
      • TcoSequencer
      • TcoComponent
      • TcoMessenger
      • TcoLogger
      • TcoDialogs
    • TcoData
      • Introduction
    • TcoInspectors
      • Introduction
    • Howto(s)
      • How to get started using TcOpen libraries
      • How to write a sequence
      • How to include TcOpen in a project
  • TcOpen Inxton
    • Colors Material Design WPF
    • Inxton Conventions
    • Inxton.Vortex.Framework.Blazor
      • Introduction and installing
      • RenderableContentControl
      • Layouts
      • Custom libraries
      • Security

How to write a sequence

You need to have TcoCore installed. If you don't here's how to do it link

I recommend to read more about it here.

  1. Create a Context
FUNCTION_BLOCK MainContext EXTENDS TcoCore.TcoContext
VAR
END_VAR
  1. Create a Sequence
FUNCTION_BLOCK AutomaticSequence EXTENDS TcoCore.TcoSequencer
VAR
END_VAR
  1. Create Main method in AutomaticSequence and start writing your sequence with Step
METHOD PROTECTED  Main : BOOL
---
IF Step(0, TRUE, 'First Step') THEN
    StepCompleteWhen(TRUE);
END_IF

IF Step(10, TRUE, 'Second Step') THEN
    StepCompleteWhen(TRUE);
END_IF

IF Step(20, TRUE, 'Third Step') THEN
    StepCompleteWhen(TRUE);
END_IF

IF Step(30, TRUE, 'Last Step') THEN
    CompleteSequence();
END_IF
  1. Create instance of AutomaticSequence in MainContext
FUNCTION_BLOCK MainContext EXTENDS TcoCore.TcoContext
VAR
    AutomaticSeq : AutomaticSequence(THIS^, eRestoreMode.None);
END_VAR
  1. Run the AutomaticSequence in MainContext.Main method
METHOD PROTECTED  Main
---
AutomaticSeq.Run();
  1. Run the MainContext in PRG
PROGRAM MAIN
VAR
	MainContext : MainContext;
END_VAR
---
MainContext.Run();
  • Improve this Doc
In This Article
Back to top

Generated by DocFX | Delivered by TcOpenGroup contributors