You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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();
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..
Following #13 (comment)
All components should be usable outside
TcOpen
frameworkSome framework features can be lost (messaging, RPC, etc.)
Elaborate pattern for non-framework use
Create example(s) of component implementation outside TcOpen framework
The text was updated successfully, but these errors were encountered: