Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TcoSequencerModeController class implementatin example #721

Open
bolsdrinker opened this issue Jun 11, 2024 · 1 comment
Open

TcoSequencerModeController class implementatin example #721

bolsdrinker opened this issue Jun 11, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@bolsdrinker
Copy link

Hi
Please provide an example of the Hammer application, which will show how
to implement the TcoSequencerModeController class.
Unfortunately, the documentation does not describe the use of this class.

@bolsdrinker bolsdrinker added the question Further information is requested label Jun 11, 2024
@peterbarancek
Copy link
Collaborator

peterbarancek commented Jun 12, 2024

Hi

'TcoSequencerModeController ' is a member of 'TcoSequencerBase' witch is abstract function block and is suitable for extension.
You can create your own Seqencer by derivate from 'TcoSequencerBase' or there already is 'TcoSequence' in TcOpen.

Here are some example

//definition

FUNCTION_BLOCK TcoFeedingSequenceTask EXTENDS TcoCore.TcoTask
VAR
	_sequence      : TcoCore.TcoSequence(THIS^, eRestoreMode.None);
    _observerSequence       : TcoCore.TcoSequencerObserver(THIS^);
END_VAR

//declaration

_feedNewBlisterTask : TcoFeedingSequenceTask(THIS^);

//call

IF(_feedNewBlisterTask.Execute())THEN
	SequenceIncomingBlister(refSequenceTask:=_feedNewBlisterTask );
END_IF;

//method declaration

METHOD SequenceIncomingBlister
VAR_INPUT
	refSequenceTask : REFERENCE TO TcoFeedingSequenceTask;
END_VAR

VAR
    seq    : REFERENCE TO TcoCore.TcoSequence;
END_VAR

// method's body

seq REF= refSequenceTask.Sequence;

seq.Open();
seq.Observer := refSequenceTask.Observer;
`
//***************************************************************************************************     
//    This step will be executed and immediately finished, as the condition in Await method is true.
IF seq.Step(0,TRUE,'<#INIT#>') THEN   
	Messenger.Warning('<#SAFETY INTERUPTED!#>');     
	IF _status.SafeCondition THEN
    	seq.CompleteStep();
	END_IF;
END_IF        
//***************************************************************************************************     

 
//***************************************************************************************************     
IF seq.Step(10,TRUE,'<#YOUR STEP#>') THEN   
    seq.StepCompleteWhen(Components.I3_PresentBlistersInBufferEmpty.IsTrue);
END_IF        
//***************************************************************************************************     
`

//your other steps


IF (seq.Step(inStepID := seq.RESTORE_STEP_ID,
    inEnabled := TRUE,
    inStepDescription := 'RETURN TO THE START OF THE SEQUENCE')) THEN
    //--------------------------------------------------------	
		refSequenceTask.DoneWhen(TRUE);
    	seq.CompleteSequence();
    //--------------------------------------------------------			
END_IF;

seq.Close();

Here is docu
https://docs.tcopengroup.org/articles/TcOpenFramework/TcoCore/TcoSequencer.html

I recommend you check usage in TcoCoreExamples project
or check repository:
https://github.com/TcOpenGroup/tcopen-app-templates where sequencer are used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants