Defining a trigger for a Mitsubishi unsolicited message

To define a trigger that executes when a Mitsubishi 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 Mitsubishi driver supports the receipt of two types of unsolicited messages from Mitsubishi PLCs:

  • The Mitsubishi (BUFSND) event type will support the receipt of BUFSND messages.
  • The Mitsubishi S(G).INT event type will support the receipt of S(G).INT messages.
    This event type is only supported on the Mitsubishi MESInterface IT product and the deviceWISE Enterprise Gateway for WinCPU product. 

Mitsubishi (BUFSND) event type trigger

To define a trigger that executes when a Mitsubishi BUFSND unsolicited message is received, select the Mitsubishi (BUFSND) trigger event type. The Event tab becomes active with parameters that accommodate the event type. 

Mitsubishi (BUFSND) trigger parameters

Parameter Description
Device Name Select the name of the Mitsubishi Listener device that will receive the unsolicited message and execute this trigger. The devices in this list will be limited to those that are of the Mitsubishi Listener type when the Mitsubishi (BUFSND) trigger event type is selected.
Filter Beginning with the 3.0.0 release of the Mitsubishi driver there are three options available for this parameter, Data Length,Word Value, and MC Write. Previous versions of the driver had two values for this field, True and False. Triggers that were developed prior to the 3.0.0 release of the driver that show a value of False will use the Data Length filter type. This is the default option and is used to filter messages using the length of the message. If this field has a value of True it will use the Word Value Filter type, which will filter the messages based on the value of the first word in the data portion of the message. The MC Write filter is used to process messages that are formatted like the MC Write message, defined in Mitsubishi's SLMP protocol
Data Length (Words) This field is shown only if the Filter field is set to Data Length or False. The value entered is in words, which are two byte (INT2) entities. The value in this field is used as a filter, so that the trigger will fire only when a message arrives with a data length that matches the value in this field. Setting the value in this field to 0 indicates that the trigger will fire regardless of the length of the message.
Word Filter Value This field is shown only if the Filter field is set to Word Value or True. The value entered in this field is a number that is expected in the first word of the data portion of the message. The trigger will fire only when there is a match between this value and the value of the first word in the data portion of the message.
Device Type This field is shown only if the Filterfield is set toMC Write. The options in this field, D, W, SW, and ZR, correspond to word based device types found on Mitsubishi PLCs. Embedded in the MC Write BUFSND message is a device type code that corresponds to either the D, W, SW, or ZR device. The trigger will fire if it locates a matching device type code and device address value in the message. Details on the format of the MC Write BUFSND message are shown below.
Device Address This field is shown only if theFilter field is set toMC Write. Embedded in theMC Write BUFSND message is an address value. This can be thought of as the element offset within the device. The trigger will fire if it locates a matching device type code and device address value in the message. Details on the format of theMC Write BUFSND message are shown below.
Message Data Type Select whether the data will be formatted in either an array of two byte integers (INT2) or in as a binary buffer (BINARY). The default is INT2, an array of two byte integers.
Byteswap on Word Boundary This field is shown only if the Message Data Type field is set to BINARY. The default selection of No will ensure that the data is provided exactly as it is received by the Mitsubishi Listener device. Selecting yes will cause the Mitsubishi Listener device to byteswap the data on word boundaries.

Mitsubishi (BUFSND) event type trigger event variables

When a Mitsubishi BUFSND event type trigger executes, PLC data associated with the message is available as trigger event variables. The trigger event variables are available to trigger actions that have input or source parameters are:

Event Variable Data type Description
Data Array of INT2 or BINARY buffer This is the data from the Mitsubishi PLC. It is sent by the ladder logic running on the PLC as part of the BUFSND message. The data will be represented either as an array of INT2 variables or as a BINARY buffer, depending upon the selection in the Message Data Type field.
IP Address String, length 32 characters The IP address of the PLC that sent the BUFSND message.
Word Count INT2 The number of words in the message. This is the number of INT2 elements in the Data event variable if the INT2 option was selected in the Message Data Type field. Otherwise this is the total length of the message as represented in two byte intervals (total length / 2) if the BINARY option was selected in the Message Data Type field.
Label String, length set in the Active Listener This variable will be supplied if the Mitsubishi Listener device selected was an Active Listener and if the PLC that sent the message was defined with a Label value. See Using the Workbench to Define a Mitsubishi Listener device for details on defining a PLC that the Active Listener will connect to.

There is one event variable that is returned to the PLC upon completion of the trigger. This event variable can be modified in the trigger. It is available to trigger actions that have output or destination parameters.

Event Variable Data type Description
ResultStatus INT1 An integer value that will be returned to the PLC to signify the success or failure status of the trigger that received the BUFSND message.
This value will be returned to the PLC upon completion of the trigger.

Mitsubishi (BUFSND) event type trigger runtime behavior

Filtering using the Data Length

A started trigger will execute only when a message is received by the Mitsubishi Listener device specified in the Device Name field. One way to filter between the many messages the Listener can receive is based on the size of the message, as measured by it's length in words. If the data portion of the message received by the Listener matches the value specified in the Data Length (Words) field, the trigger will execute. In this way unique triggers can be defined to processes specific messages. For example: Trigger A can be defined to handle messages that are 100 words in length, while Trigger B can be defined to handle messages that are 500 words in length.

This event definition is flexible enough though to allow for one trigger to handle all messages, regardless of message length. This is done by entering a value of 0 in the Data Length (Words) field. This indicates that any message received by the Mitsubishi Listener device defined in the Device Name field will be executed by this trigger. This applies to both Passive Listeners and Active Listeners. 

Note: Triggers that are defined and are in a started state, which have a specific message Data Length value, take priority over started triggers that have a 0 message Data Length value.
For example: Trigger A is defined to execute upon receipt of a Mitsubishi BUFSND message that is 100 words in length. Trigger B is also defined to execute upon receipt of a Mitsubishi BUSFSND message, but has a 0 value in the Data Length (Words) parameter. Both triggers are in a started state and are referencing the same Mitsubishi Listener device, which is also in a started state.

  • When the Mitsubishi Listener device receives a BUFSND message that is exactly 100 words in length, Trigger A will be executed.
  • When the Mitsubishi Listener device receives a second BUFSND message that is not 100 words in length, Trigger B will be executed.
    Now in this same example, the state of Trigger A is changed from Started to Stopped, while Trigger B remains in a Started state. When the Mitsubishi Listener receives a message that is 100 words in length, Trigger B will be executed. Trigger B is defined to handle messages of any length and there is no other trigger in a Started state defined to handle messages that are 100 words in length.

Filtering using Word Value

An additional way in which BUFSND messages can be associated with a specific trigger is through the use of the Word Value filter selection. A BUFSND message consists of two parts the header and the data. The header contains two words of data. The first word is an identifier value of 0x60 followed by the second word which is the length of the data portion of the message. Using the Word Filter Value selection allows a message to be associated to a trigger based on the expected value of the first word in the data portion of the message. Using this filter allows the user to process messages of any length as long as the numeric value of the first word matches the value specified in the Word Filter Value field. 

For example: Trigger X can be defined to handle all messages that have a value of 14000 (0x36B0) as the first word in the data portion of the message, while Trigger Y is defined to handle all messages that have a value of 5808 (0x16B0). Trigger X will fire if the first word in the data portion of the message has a value of 14000, regardless of the overall length of the message. In this situation, where triggers X and Y are defined, messages with a first word value of anything other than 14000 or 5808 will be ignored and neither trigger will fire. To ensure you don't miss any messages you can define a Data Length (Words) trigger with a length of 0, which is the catch all trigger for messages that don't meet any filter criteria.

Care must be taken when mixing Data Length (Words) triggers with Word Filter Value triggers. Situations could arise where a BUFSND message matches both the message length filter and the first word value filter. In this case there is no guarantee as to which trigger will fire as the first trigger that matches any criteria will be fired. It is not guaranteed whether the first trigger that matches the criteria will be a Data Length (Words) trigger or a Word Filter Value trigger.

Filtering using MC Write

The MC Write filter type is available beginning with the 3.0.0 release of the Mitsubishi driver. The first word in the MC Write message has a value of 0x60, indicating it is a BUFSND message. The next word identifies the total length of the BUFSND message. The third word in the message is the SLMP protocol command code. The value of the Write code is 1401. Four bytes beyond the command code is the device address, also known as the Head device number. This value will be obtained from the message and used as one of the filter values when locating the trigger to fire. Two bytes beyond the device address is the device code, which is identified in the trigger event parameter as the device type. The following device codes are supported by the trigger event.

  • D - 0xA8
  • W - 0xB4
  • SW - 0xB5
  • ZR - 0xB0

The data portion of the message follows the byte that contains the device code. 

Mitsubishi S(G).INT event type trigger

To define a trigger that executes when a Mitsubishi S(G).INT unsolicited message is received, select the Mitsubishi S(G).INT) trigger event type. The Event tab becomes active with parameters that accommodate the event type. 

Mitsubishi S(G).INT trigger parameters

Parameter Description
CPU ID The CPU ID of the Local CPU, a Q Series PLC in the same Mitsubishi rack.
Event ID The event ID value of 0 through 15 for this trigger. The trigger will only be executed if the value used in the S(G).INT matches this trigger parameter.

Mitsubishi S(G).INT event type trigger event variables

When a Mitsubishi S(G).INT event type trigger executes, the trigger event variables are available to trigger actions that have input or source parameters are:

Event Variable Data type Description
CPU UINT2 The CPU ID of the Local CPU, a Q Series PLC in the same Mitsubishi rack.
Event ID UINT2 The event ID specified in the PLC program when it issued the S(G)INT.

Mitsubishi S(G).INT event type trigger runtime behavior

A started trigger will execute only when the Event ID parameter defined in the trigger matches the event ID used in the S(G).INT issued in the PLC program.

There is no PLC data sent to the trigger as part of the S(G).INT unsolicited message. If the trigger requires data from the PLC variables, it will need to access the data using a Set action (Source parameter) or a Demand Read action.