Internal constructor, which creates and binds all the Components of TcContext
, used by TcContext.create()
Settings used for communicating over ADS. Definition of connection settings can be found at ads-client library
Callback which is issued when Code Change is detected. If none is specified, the the TcContext.reinitialize
function is bound to it
If enabled, all components of TcContext
will produce debug information
Emitted when TcContext
is killed and is no longer usable
Emitted when TcContext
is reinitialized
Emitted from TcCom when it establishes a connection to the PLC
Emitted from TcCom when it disconnects from the PLC
Emitted from TcCom when it detect Code Changes in the PLC
Emitted from TcSymbolRegistry when it creates the Symbol Map
Emitted from TcSymbolRegistry when it destroys the Symbol Map
Emitted from TcTypeRegistry when it creates the Type Map
Emitted from TcTypeRegistry when it destroys the Types Map
Shortcut operator of TcContext.symbols.namespaces
, for quickly accessing the created TcNamespaces
Access to the ADS Communication Module, through which all ADS Actions are made
Access to the Registry, which stores the Symbol Map, generated based on the TwinCAT PLC Data and the
Type data gathered by the TcContext.types
Component
Access to the Registry, which stores all the TwinCAT Type Data, pulled from the PLC, and which is used for Symbol generation
Internal function used by TcContext.create()
static method, to initialize all the Components of the TcContext
Object
TcContext
Emits an event of eventName
with data e
and if parent is present
will propagated that event to it, unless stopped
The event name to emit
The Data associated with this event
Function responsible for explicitly killing TcContext
, rendering it unusable, unless TcContext.reinitialize()
is called
afterwards, which will reconnect and rebuild a new TcContext
with previously passed settings
const { TcContext } = require('tc-context');
TcContext.create().then(context => {
await context.kill()
//context is no longer usable afterwards
})
NOTE: Even if the function throws an exception, the context will still be rendered unusable
TcContext
, which is no longer usableFunction, which using the previously passed settings during TcContext.create()
call, will kill the TcContext
and then reconnect and rebuild all the components.
This function is automatically called, whenever the TcCom
module detects a code change on the PLC if
no explicit callback was given during construction
TcContext
Function responsible for the creation of TcContext
, as well as initializing all of its components
const { TcContext } = require('tc-context');
TcContext.create().then(context => {
//.....
})
Settings used for communicating over ADS. Definition of connection settings can be found at ads-client library
Callback which is issued when Code Change is detected. If none is specified, the the TcContext.reinitialize
function is bound to it
If enabled, all components of TcContext
will produce debug information
TcContext
Generated using TypeDoc
Class responsible for creating the connection, mapping the types and symbols over the TwinCAT's ADS layer. Its purpose is to serve as the entry point for the tc-context Library.
Creation of a context is done through the
TcContext.create()
static method, due to the asynchronous nature of creation.const { TcContext } = require('tc-context'); TcContext.create().then(context => { //..... await context.kill(); })