Defining a trigger for a
Siemens (AG_SEND/TSEND) unsolicited message
To define a trigger that executes when a Siemens
unsolicited message is sent, follow the steps for defining
a new trigger.
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 Siemens driver supports the receipt of AG_SEND and
TSEND unsolicited messages sent from Siemens PLCs.
The Siemens (AG_SEND/TSEND) event type
will support the receipt of the two message types sent to
a S7 Listener device that is defined with
the ISO on TCP Protocol value.
Siemens (AG_SEND/TSEND) event type trigger
To define a trigger that executes when a Siemens AG_SEND or a Siemens TSEND unsolicited message is received on the ISO on TCP port (102), select the Siemens (AG_SEND/TSEND) trigger event type. The Event tab becomes active with parameters that accommodate the event type.
Siemens (AG_SEND/TSEND) trigger parameters
Parameter | Description |
---|---|
Device Name | A list of all of the Siemens S7
Listener devices that have been defined
on the node. The S7 Listener devices
that process the AG_SEND and TSEND
message must have a Protocol value of
ISO on TCP. For information about the S7 Listener device type and the Protocol parameter, see Using the Workbench to define a Siemens S7 Listener device. |
Filter | Specifies the received messages that
will execute the trigger. The options
are:
|
Source TSAP (ASCII) | This parameter is displayed if the TSAP (ASCII) value is selected in the Filter parameter. The value of the Source TSAP that was specified in the connection logic on the Siemens PLC will be entered into this parameter to filter on the Source TSAP value. This TSAP value is sent to the S7 Listener device when the PLC connects to the node. A value is required in this parameter if the Destination TSAP (ASCII) parameter is left blank. |
Destination TSAP (ASCII) | This parameter is displayed if theTSAP (ASCII)value is selected in theFilterparameter. The value of the Destination TSAP that was specified in the connection logic on the Siemens PLC will be entered into this parameter to filter on the Destination TSAP value. This TSAP value is sent to the S7 Listener device when the PLC connects to the node. A value is required in this parameter if the Source TSAP (ASCII) parameter is left blank. |
Siemens (AG_SEND/TSEND) event type trigger event variables
When a Siemens (AG_SEND/TSEND) event type trigger executes, PLC data associated with the message is available as trigger event variables. The trigger event variables that are available to trigger actions that have input or source parameters are listed below.
Event Variable | Data type | Description |
---|---|---|
Data | BINARY | This is the data from the Siemens PLC. It is sent by the ladder logic running on the PLC as part of the AG_SEND or TSEND message. The data type is binary, allowing the user to process it as a single data element, an array of elements of a specific data type, or a combination of different data types. |
Data Length | INT4 | The number of bytes in the data portion of the message. |
Device Name | String, length 128 characters | The name of the S7 Listener device that received the message. |
IP Address | String, length 32 characters | The IP address of the PLC that sent the AG_SEND or TSEND message. |
There are no output event variables associated with this event.
Siemens (AG_SEND/TSEND) event type trigger runtime behavior
AG_SEND and TSEND messages are sent from a Siemens S7 PLC to a S7 Listener that is listening on the ISO on TCP port, which is port 102. Triggers that are using the Siemens (AG_SEND/TSEND) event type have the option of defining a filter. The filter is a valuable way to associate specific triggers with messages sent from a specific PLC. To begin communications with the S7 Listener device, the Siemens PLC will send a Connection Request message. Embedded within the Connection Request message are two parameters, the Source TSAP and the Destination TSAP. These values will be maintained by the S7 Listener and associated with each specific PLC Connection. The TSAP values received when the connection is made can then be used as a trigger filter when the S7 Listener receives a message on that connection. The TSAP parameters contain ASCII characters and are a maximum of eight characters in length.
A filter can be defined using both the Source and the Destination TSAP values, just the Source TSAP value, or only the Destination TSAP value. TSAP values that are blank will be ignored. At least one TSAP parameter must contain a value, if the TSAP (ASCII) filter is selected.
For example: Trigger A can be defined with a blank Source TSAP value and a Destination TSAP value of TS123, while Trigger B is defined to handle messages with a Source TSAP value of SRC678 and a blank Destination TSAP value. Finally a third trigger, Trigger C is defined with None selected in the Filter parameter. Trigger C's definition allows it to process every AG_SEND or TSEND message received by the S7 Listener, regardless of TSAP values associated with each connected PLC. AG_SEND or TSEND messages received from PLCs that connect with a Source TSAP value of SRC678 will be processed by Trigger B and Trigger C. AG_SEND or TSEND messages received from PLCs that connect with a Destination TSAP value of TS123 will be processed by Trigger A and Trigger C.