How rejected messages are handled (UCO)
- Last UpdatedFeb 10, 2025
- 3 minute read
The object includes a set of RejectedMessages attributes for retrieving, viewing, and acknowledging rejected messages that occur during run time. The rejected messages are stored in the MES database. There is no configuration of the RejectedMessages attributes as these are set by the object.
With the exception of the RejectedMessages.Filter.MaxHours attribute, the RejectedMessage attributes configuration, such as I/O extensions, is not supported on UCO-specific tabs in Object Editor. However, RejectedMessages attributes can be interacted with through scripts, LMX-based read/write operations, Object Viewer, and also through System Platform's I/O extensions on the Attributes tab.
OnScan Behavior
At OnScan, a subscription to rejected message events is established. A filter is applied to specify a representative rejected message dataset. The filter comprises the following attributes.
RejectedMessages.Filter.Entity
The MES entity by which to filter the rejected messages that will be visible. This will be the object's parent entity.
This attribute is auto-set at run time by the UCO. Its value should not be changed to ensure correct retrieval of rejected messages.
RejectedMessages.Filter.MaxHours
The rejected messages that occurred up to the number of previous hours entered for this attribute will be retrieved.
The range of allowable values is from 1 to 100. However, any values greater than 24 will cause the filter to behave as if the value is 24. This is because, every hour, the UCO resets the Time filter to the previous 24 hours.
RejectedMessages.Filter.MsgType
The message type by which to filter the rejected messages that will be visible. For example, for a UCO, this filter will be set to raw reason code change events.
RejectedMessages.Filter.Time
Only rejected messages that are more recent than this time stamp value will be retrieved. At OnScan, the time stamp value is set to the current time. During execution, this time stamp is checked every hour to see whether it is older than 24 hours. If it is, it is reset to ensure that rejected messages older than 24 hours are not retrieved.
A count of the rejected messages that match the filter criteria and a string array of the messages themselves will be available through the RejectedMessages.Count and RejectedMessages.Messages attributes. The RejectedMessages.Messages attribute can hold up to 200 messages. For example, in a 12-hour period, 450 rejected messages might be logged. The RejectedMessages.Count attribute would have a value of 450 but the RejectedMessages.Messages attribute would have only the 200 most recent messages.
The message array is ordered with the most recent message at the top (that is, with the first index value). Time stamps are in the object’s local time.
Rejected Message Retrieval Failures
If the rejected message retrieval fails, the RejectedMessages.Status attribute value changes from Ready to Error. Also, an error code (RejectedMessages.ErrorCode) and error message (RejectedMessages.ErrorMessage) are returned.
The error codes are:
-
-100, which indicates a communication error or MES middleware exception.
-
-1, which indicates an unknown error.
The RejectedMessages.ResetCmd is used to clear the error condition. The reset command:
-
Clears the ErrorCode and ErrorMessage attributes.
-
Sets the Status attribute to Ready.
-
Re-subscribes if the subscription has become invalid due to the error.
Acknowledging Rejected Messages and Resetting the Subscription
The RejectedMessages.AckRejectedMessagesCmd command attribute is used to acknowledge the rejected messages and clear them.
Setting this command to True acknowledges that the currently visible rejected messages have been viewed. The active rejected message subscription is removed and a new one is established. Also, the time stamp filter is set to the current time, effectively clearing any previous rejected messages.
Failover Behavior
On failover to a redundant engine, the most recent RejectedMessages.Filters.Time value is retained and used when the new subscription is established from the redundant engine. The RejectedMessages.Filters.Entity and RejectedMessages.Filters.MsgType attributes will be set to their default values. This will cause the rejected message dataset that was current at the time of the failure to be retrieved.
OffScan and Shutdown Behavior
At OffScan or Shutdown, the rejected message subscription is removed.
Alarms and History
Rejected message alarm or history configuration is not supported for the object on the object-specific tabs in Object Editor. However, alarms and history can be configured for any of the attributes on the Attributes tab.