Industry News, Trends and Technology, and Standards Updates

SECS/GEM series: Message Logging

In 1977, the classic movie "Close Encounters of the Third Kind" was released.  Towards the end of the movie, there is a dramatic "conversation" between the space aliens and the humans. One of the scientists makes the statement, "I hope someone is taking all this down."

What they really wanted was message logging!

Just like software logging is important for troubleshooting an application, logging the detailed message traffic between a factory host and the manufacturing equipment is just as important for troubleshooting.

For example, a host sends a command, and the equipment behaves based upon the message, but something does not work as expected.  It would be very helpful to see the message that was sent and the reply from the equipment, in conjunction with any other logs from the equipment to determine where the problem is located.

The format used to display/represent the logged messages is also very important. The latest industry standard for SECS message formatting is SEMI E173, the Specification for XML SECS-II Message Notation (SMN).

Here is an example:

<?xml version="1.0" encoding="utf-8"?>
<SECSMessageScenario xmlns="urn:semi-org:xsd.SMN">
                <Comment time="2018-02-05T18:19:20.365Z">State Change NotConnected</Comment>
                <Comment time="2018-02-05T18:19:20.400Z">State Change NotSelected</Comment>
                <HSMSMessage time="2018-02-05T18:19:20.394Z" sType="Select.req" direction="H to E" txid="1">
                                <Header>FFFF0000000100000001</Header>
                </HSMSMessage>
                <HSMSMessage time="2018-02-05T18:19:20.417Z" sType="Select.rsp" direction="E to H" txid="1">
                                <Header>FFFF0000000200000001</Header>
                                <Description>Communication Established</Description>
                </HSMSMessage>

Here is an S5,F5 example:

<SECSMessage s="5" f="5" direction="H to E" replyBit="true" txid="7" time="2018-02-05T18:19:20.507Z">
    <SECSData>
        <UI4 />
    </SECSData>
</SECSMessage>
<SECSMessage s="5" f="6" direction="E to H" replyBit="false" txid="7" time="2018-02-05T18:19:20.507Z">
    <SECSData>
        <LST>
            <LST>
                <BIN>0</BIN>
                <UI4>1</UI4>
                <ASC>Alarm 1 Text</ASC>
            </LST>
        </LST>
    </SECSData>
</SECSMessage> 

The SMN format is ideally suited for:

  • Capturing the HSMS header information in a clear way
  • Logging messages in an exact, binary format
  • Reading the logs using software
  • Creating a host or equipment emulator, since it is easy to read the logging from a software application and play it back.
  • Extracting data from the SMN logs

The logs can be captured by the Equipment, Host, or even a "network sniffer" like Cimetrix's CIMSniffer utility.

Cimetrix’s Logviewer utility supports SMN logs as well:

message logging blog image

With these standards and tools available, there's no reason to be like the scientist in Close Encounters, hoping that the messages were being logged.  Turn on logging!

Cimetrix's CIMConnect, HostConnect and SECSConnect all provide message logging in the SMN format.

Click here to read the other articles in our SECS/GEM Features and Benefits series. 

To download a white paper with an introduction to SECS/GEM, Click below:

SECS/GEM White Paper

Topics: SECS/GEM, Smart Manufacturing/Industry 4.0, SECS/GEM Features & Benefits Series

Posted by Tim Hutchison: Senior Software Engineer on Sep 19, 2018 10:51:00 AM
Find me on: