Using the Variables window to access Keyence Listener connection data

This view of the Variables window shows the items associated with an Keyence Listener device. The information identifies the Keyence PLCs that have connected to the listener and the type of unsolicited messages the PLCs are sending. The first group of variables are counters that provide information on the connections and messages that the listener has serviced during the time that it has been in a started state. Two additional variables provide detailed information on the messages received by the listener and connections that the listener is actively servicing.


Keyence Listener variables

Variable Name

Variable Description

Active Connections The number of devices currently connected to the Keyence Listener device.
Last Connection Timestamp The timestamp of the most recent connection. A value of Wed. Dec 31, 19:00 EST 1969 will be shown when a connection has not been made to the listener device.
Total Connections Accepted The total number of connections that have been accepted since the listener device was started.
Total Connections Closed The number of connections closed since the listener device was started.
Total Connections Rejected The number of connection attempts the listener device has rejected. A connection can be rejected by the listener device for the following reasons:
  • The number of allowed connections as defined in the Maximum Connections parameter of the device definition has been reached
  • A connection can also be rejected if the IP address of the PLC has been denied per the rules set out in the Access List parameter of the device definition.
Total Messages Received The number of messages that have been received by the listener and resulted in a trigger being executed.
Total Messages Rejected

The total number of messages received by the listener that were not processed. Here are a few reasons why a message may be rejected:

  • Incorrect format
  • No corresponding Trigger for the message received
  • Incomplete message was received.
Messages An array that contains information specific to the last 20 messages received by the listener. This is a rolling array, so information on only the last 20 messages is maintained. The information in the array is kept as long as the listener device remains in a started state.
Connections An array that contains information specific to each active connection. The size of the array is determined by the Maximum Connections parameter of the device definition. The information in the array is kept as long as the connection is active. The information is dropped as soon as the connection is broken by either the connected PLC or by the listener.

Keyence Listener Messages summary variables

The array of the last 20 messages received provides insight into the PLCs that have communicated to the listener. The information in each element of the array is maintained while the Listener is in a started state. This is a rolling array, meaning that the 21st message received will be stored in the first element of the array, overwriting the information that was previously in this element. Each element in the array contains the following variables:

Messages variables

Description

Timestamp The date and time the message was received by the listener.
Sender IP IP address of the PLC that sent the message.
Length The length of the message received by the listener.
Data An array that shows up to 50 bytes of the data portion of the message.

Keyence Listener Connections variables

The Connections array size corresponds to the number of Connections that were defined when the Keyence Listener was created. The connection information is maintained for the life of the connection. The information is lost once the connection between the Listener and the PLC is dropped. Each Connections element has the following variables:

Connections variable

Description

IP Address The IP address of the PLC that has created a connection to the listener device.
Messages Received The number of messages sent from the PLC.
Connect Timestamp The date and time when the connection was established.
Last Message Timestamp The date and time when the most recent message was received from the PLC.
Last Message Length The length of the most recent message.
Messages An array containing information about the messages received from the PLC, regardless of whether they resulted in the execution of a trigger or not. This array has twenty elements. The array is circular in nature, so message 21 is stored in array element 0.

Keyence Listener Connections Messages variables

Each element in the Connections Messages array describes a specific message received from the PLC identified in the Connections element. The message information is maintained for the life of the connection. There are twenty elements in the array. The contents of the elements will wrap around to the first element, once the array is full. The data is deleted once the connection is closed.

Connections Messages variable

Description

Timestamp The date and times when the message was received from the PLC.
Message Length The length of the message.