Constructor, which stores the TcComSettings used for establishing communication, as well as the callback, which is triggered upon Code Change detection
Parent TcContext, of whom TcCom
is part of, and whom to propagate events to
Settings used for communicating over ADS. Definition of connection settings can be found at ads-client library
Callback, which is called when Code Changes are detected. This callback is called after the sourceChanged
event is emitted
If enabled, will produce debug information
Emitted when TcCom
connects to the Target PLC
Emitted when TcCom
disconnects from the Target PLC
Emitted when TcCom
detects Code Changes in the Target PLC
Emitted when TcCom
looses connection to the Target PLC
Emitted when TcCom
reconnects to the Target PLC
Returns true
if the current TcCom
Object is in a valid state, and can be used for communication
Access to the previously used TcComSettings for establishing connection to the TwinCAT PLC
Internal function, which is invoked whenever Code Changes are detected by the TcCom
object.
Will emit the sourceChanged
event, as well as invoke a callback which was provided
The current PLC Last code change stamp which is used to see if changes have happened
Internal function, which splits SymbolPointers into groups of 500,
due to a TwinCAT ADS limitation, used by the TcCom.read()
function
List of Symbol Pointers to split
Internal function, which splits Data Packages into groups of 500,
due to a TwinCAT ADS limitation, used by the TcCom.write()
function
List of Data Packages to split
Performs a call to a method of a specific variable over ADS
The variable name, whose method is called
The name of the method that is to be called
The parameters, which are passed to the method
Disconnects the previously established connection to the TwinCAT PLC, and cleans up all subscription handles.
The TcCom
Object is no longer usable after this point, unless TcCom.initialize()
is once again called, to
reestablish the connection.
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
Converts a given Buffer of data to Javascript Data, based on the TwinCAT Type. This conversion works for primitive types, and not structured
The TwinCAT Type, whose data is to be converted
The Buffer of Raw Data, that is to be converted
buffer
data converted from the TwinCAT type
Initializes the TcCom
Object, by establishing a connection to the TwinCAT PLC, with the previously provided TcComSettings, as well as
setting up Code Change monitoring, if the Source Code on the PLC Changes, during run-time
TcCom
ObjectPerforms a read operation over ADS of the TwinCAT Symbol Pointers. When requesting more than 500+ packages at once, the pointers will be split in groups of 500 due to a limitation of ADS
The symbol pointers, whose data to be queried
Subscribes to a TwinCAT Symbol, with a callback, which is invoked, whenever the Symbol value changes.
The detection of change speed can be set through the sampling
argument, in case the value changes too fast
and such detection is not needed
The speed in ms
of detecting change. Any change in this interval will not trigger change events
The Symbol Pointer, to which to subscribe
The callback that is invoked, whenever Symbol change is detected
Queries the raw ADS Symbol Data from the Target PLC
Converts a primitive non-structured Javascript Value to a Buffer of Data, which can be
passed to a TwinCAT Type, as specified by the type
argument.
This conversion works for primitive types, and not structured
The TwinCAT Type, to whom the value is converted
The Javascript value, which is converted to Raw Data
type
, representing the passed value
Queries the raw ADS Type Data from the Target PLC
Unsubscribes the previously created TwinCAT Handle for value change event
The previously create active subscription handle to a TwinCAT Symbol
Performs a write operation over ADS to the TwinCAT PLC of the provided TcDataPackages
.
When sending more than 500+ packages at once, the packages will be split in groups of 500 due to a limitation of ADS
The packages with symbol location and data to be send to the Target
The Default settings, used for connecting to a TwinCAT PLC, located at localhost. These settings are merged in, with whatever custom settings are provided during construction
Generated using TypeDoc
Class responsible for establishing connection and managing all communication and data transformation to and from the Target PLC over TwinCAT's ADS layer.
Is used as a wrapper for the ads-client library.