Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

We want to have the components usable in applications that do not use full framework. #42

Closed
2 tasks
PTKu opened this issue May 5, 2021 · 3 comments
Closed
2 tasks

Comments

@PTKu
Copy link
Member

PTKu commented May 5, 2021

Following #13 (comment)

  • All components should be usable outside TcOpen framework

  • Some framework features can be lost (messaging, RPC, etc.)

  • Elaborate pattern for non-framework use

  • Create example(s) of component implementation outside TcOpen framework

@PTKu
Copy link
Member Author

PTKu commented May 8, 2021

@Barteling I sketched a way it could work here:

https://github.com/TcOpenGroup/TcOpen/tree/feature/pkml/src/TcoApplicationExamples/XaeAppExamples/PlcAppExamples/POUs/NonFrameworkUse

The basic idea is that we will need to have something of ITcoContext (TcoContextNfCompatibility is in example implementation) declared somewhere (probably global scope) in the application:

PROGRAM MAIN
VAR
	_context : TcoCore.TcoContextNfCompatibility;	
	_logic : NF_Logic;
END_VAR
//------------------------------------------------------
_context.VolatileOpen(); // OPENS CONTEXT
_logic();                          // ENTRY POINT OF ALL LOGIC
_context.VolatileClose(); // CLOSES CONTEXT
//------------------------------------------------------
+ PROPERTY PUBLIC Context ... Gets _context;

then NF_Logic block can use the components:

FUNCTION_BLOCK NF_Logic
VAR
	_piston : TcoPneumatics.Cylinder(NF_MAIN.Context);
END_VAR
//------------------------------------------------------------

_piston.MoveHome();

Your thoughts?

@Barteling
Copy link

Yep looks, good. As explained I believe this will help for a much higher acceptance of TC open, and I'm not to worried about the empty ITcoContext in the FBInit

Although this painfully displays the lack of support for method overloading in TwinCAT..

@PTKu
Copy link
Member Author

PTKu commented May 10, 2021

Although this painfully displays the lack of support for method overloading in TwinCAT..
👍

@PTKu PTKu closed this as completed May 19, 2021
@TcOpenGroup TcOpenGroup locked and limited conversation to collaborators May 19, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants