Defining a trigger for a Beckhoff unsolicited message

The following section explains how to define a trigger that executes when a Beckhoff unsolicited message is received. For complete information on defining projects and triggers, see Defining a trigger.

Every trigger identifies the trigger event type, which identifies when the trigger will be executed.

The PLC Logic Events category will list the available event types, based on the drivers that are installed on the node. The Beckhoff driver supports the receipt of Beckhoff (ADS) messages.

To define a trigger that executes when a Beckhoff unsolicited message is received, select the Beckhoff (ADS) trigger event type. The event panel will change to display the parameters that the trigger needs to process an unsolicited message. The Beckhoff driver supports two ADS message types, ADS Read and ADS Write. An ADS Read occurs when the PLC requests a data block from deviceWISE. An ADS Write occurs when the PLC is trying to send a data block to deviceWISE.

In addition to trigger parameters, the Beckhoff unsolicited event contains what are called event variables. Event variables are used in the reply to the Beckhoff PLC upon completion of the trigger. These variables are set within the trigger during execution. For more information on event variables see Trigger event variables.

ADS Read Trigger

This section describes the components of an ADS Read Trigger.

ADS Read trigger parameters

This image shows the parameter panel for defining an ADS Read unsolicited message.

The following parameters will be displayed on the trigger definition panel for ADS Read unsolicited messages.

  • Device Type - Type of TwinCAT. Options are TwinCAT 2 and TwinCAT 3.
  • Device Name - Name of the device you want the trigger to listen to.
  • Command - The type of request the event should trigger off of. Options include ADS Read and ADS Write. ADS Read refers to when the Beckhoff PLC is trying to read data from deviceWISE. ADS Write refers to when the Beckhoff PLC is trying to write data to deviceWISE.
  • Index Group - The PLC variable memory location. The trigger will not fire if an incoming message is for a different location. A -1 can be used as a wildcard and will cause the trigger to fire for any group.
  • Index Offset - The PLC variable memory location offset. The trigger will not fire if an incoming message is for a different offset. A -1 can be used as a wildcard and will cause the trigger to fire for any offset.
  • Output Data Type - Data type of information to be sent back to the PLC.
  • Data Count - Number of elements to be read or written.
  • Size of One Element (bytes) - This field is displayed for binary and string data types in order to specify the length of each element.

ADS Read Input Event Variables

This image shows the input event variables for an ADS Read trigger type.

The input event variables for an ADS Read are:

  • AMS Sender Net ID - Beckhoff network address from which the request originated.
  • Command ID - Request type identifier. Supported types are 0x02 (ADS Read) and 0x03 (ADS Write)
  • Data Length - Size of request data.
  • Device Name - Name of Beckhoff device sending the request.
  • Index Group - Memory address for which the request is intended.
  • Index Offset - Memory offset for which the request is intended.

ADS Read Output Event Variables

This image shows the output event variables for an ADS Read trigger type.

The output event variables for an ADS Read are:

  • Data - The data that will be sent back to the Beckhoff PLC when the trigger completes. The data type and count is based on the parameters specified in the trigger definition.
  • ResultStatus - Status code to be appended to response to the Beckhoff PLC when the trigger completes.

ADS Write Trigger

This section describes the components of an ADS Write Trigger.

ADS Write parameters

This image shows the parameter panel for defining an ADS Write unsolicited message.

The following parameters will be displayed on the trigger definition panel for ADS Write unsolicited messages.

  • Device Type - Type of TwinCAT. Options are TwinCAT 2 and TwinCAT 3.
  • Device Name - Name of the device you want the trigger to listen to.
  • Command - The type of request the event should trigger off of. Options include ADS Read and ADS Write. ADS Read refers to when the Beckhoff PLC is trying to read data from deviceWISE. ADS Write refers to when the Beckhoff PLC is trying to write data to deviceWISE.
  • Index Group - The PLC variable memory location. The trigger will not fire if an incoming message is for a different location. A -1 can be used as a wildcard and will cause the trigger to fire for any group.
  • Index Offset - The PLC variable memory location offset. The trigger will not fire if an incoming message is for a different offset. A -1 can be used as a wildcard and will cause the trigger to fire for any offset.
  • Input Data Type - Data type of information to be received from the PLC.
  • Data Count - Number of elements to be read or written.
  • Size of One Element (bytes) - This field is displayed for binary and string data types in order to specify the length of each element.

ADS Write Input Event Variables

This image shows the input event variables for an ADS Write trigger type.

The input event variables for an ADS Write are:

  • AMS Sender Net ID - Beckhoff network address from which the request originated.
  • Command ID - Request type identifier. Supported types are 0x02 (ADS Read) and 0x03 (ADS Write)
  • Data Length - Size of request data.
  • Device Name - Name of Beckhoff device sending the request.
  • Index Group - Memory address for which the request is intended.
  • Index Offset - Memory offset for which the request is intended.
  • Data - Data received from the PLC.

ADS Write Output Event Variables

This image shows the output event variables for an ADS Write trigger type.

The output event variables for an ADS Write are:

  • ResultStatus - Status code to be appended to response to the Beckhoff PLC when the trigger completes.