Shdr

Shdr is the underlying protocol of MTConnect, which implements the communication between an MTConnect Adapter and MTConnect Agent.

In situation where no MTConnect Agent is available, you can directly hook into this communication. The protocol is readonly and reports all process data of machines including conditions, alarms and events.

Important

For addressing data in Shdr, you first need to know the keys of the data items. These may be one of the following (in this order): Source, name, id of the item in the MTConnect Information Model of your equipment.

To learn about the available keys on your equipment without the MTConnect Information Model being available, subscribe to raw data and observe the data over time.

Commissioning file specifics

A typical commissioning file for the SHDR protocol looks like this:

Download:

# ----------------------------------------------------------------------------#
# Commissioning File
# ----------------------------------------------------------------------------#
# Copyright: Cybus GmbH (2020)
# Contact: support@cybus.io
# ----------------------------------------------------------------------------#
description: >
    Shdr sample commissioning file

metadata:
    name: Shdr simulator
    icon: https://www.cybus.io/wp-content/themes/cybus/img/product-slide-img.png
    provider: cybus
    homepage: https://www.cybus.io
    version: 1.0.0

parameters:
    IP_Address:
        type: string
        default: 192.168.0.1
    Port:
        type: integer
        default: 7878
    initialReconnectDelay:
        type: integer
        default: 1000
    maxReconnectDelay:
        type: integer
        default: 30000
    factorReconnectDelay:
        type: integer
        default: 2

definitions:
    MQTT_TOPIC_PREFIX: io/cybus/shdr

resources:
    shdrConnection:
        type: Cybus::Connection
        properties:
            protocol: Shdr
            connection:
                host: !ref IP_Address
                port: !ref Port
                connectionStrategy:
                    initialDelay: !ref initialReconnectDelay
                    maxDelay: !ref maxReconnectDelay
                    incrementFactor: !ref factorReconnectDelay

    raw:
        type: Cybus::Endpoint
        properties:
            protocol: Shdr
            connection: !ref shdrConnection
            subscribe:
                key: raw
                type: sample

    xact:
        type: Cybus::Endpoint
        properties:
            protocol: Shdr
            connection: !ref shdrConnection
            subscribe:
                key: Xact
                type: sample

    temperature:
        type: Cybus::Endpoint
        properties:
            protocol: Shdr
            connection: !ref shdrConnection
            subscribe:
                key: temp_cond
                type: condition

    mapping:
        type: Cybus::Mapping
        properties:
            mappings:
                - subscribe:
                      endpoint: !ref raw
                  publish:
                      topic: !sub '${MQTT_TOPIC_PREFIX}/raw'
                - subscribe:
                      endpoint: !ref xact
                  publish:
                      topic: !sub '${MQTT_TOPIC_PREFIX}/xAct'
                - subscribe:
                      endpoint: !ref temperature
                  publish:
                      topic: !sub '${MQTT_TOPIC_PREFIX}/tempCondition'

Connection Properties

Endpoint Properties

Output Format

If data is read from SHDR the output will be provided as JSON object

type: sample, event

{ 'timestamp': '<msSinceEpoch>', 'value': '<value>' }

type: condition

{
    'timestamp': '<msSinceEpoch>',
    'value': { 'level': '<level>', 'nativeCode': '<nativeCode>', 'nativeSeverity': '<nativeSeverity>', 'qualifier': '<qualifier>', 'text': '<text>' },
}

type: message

{ 'timestamp': '<msSinceEpoch>', 'value': { 'nativeCode': '<nativeCode>', 'text': '<text>' } }

type: alarm

{ 'timestamp': '<msSinceEpoch>', 'value': { 'code': '<code>', 'nativeCode': '<nativeCode>', 'severity': '<severity>', 'state': '<state>' } }

Last updated

Logo

© Copyright 2024, Cybus GmbH