For the complete documentation index, see llms.txt. This page is also available as Markdown.

Open Protocol

Connect tightening controllers over Open Protocol, subscribe to MID groups, send requests and commands, and pin revisions.

The Open Protocol connector connects Connectware to tightening controllers from Atlas Copco, Bosch Rexroth, and Desoutter. It publishes tightening results, alarms, and curves as MQTT messages and sends commands to the controller, such as selecting a parameter set.

How the Open Protocol Connector Works

Open Protocol exchanges messages over TCP. Every message type has a four-digit message ID (MID), such as MID 0061 for the last tightening result. A connection is one TCP session to one controller. An endpoint addresses one MID group, a keyword such as lastTightening for the MIDs of one function, or one MID by its number.

Operation
What happens
MQTT topics

subscribe

The controller pushes data, for example after every tightening.

The connector publishes on the endpoint topic.

read

Connectware sends a request MID and receives the reply MID.

Publish the request on <topic>/req. The reply arrives on <topic>/res.

write

Connectware sends a command MID.

Publish the command on <topic>/set. The result arrives on <topic>/res.

The endpoint topic is services/<serviceId>/<topic>, where <topic> is the endpoint's topic property.

Connecting to a Controller

Set protocol to Openprotocol, the controller's address in host, and the controller in device. The port defaults to 4545.

  • device.vendor: AtlasCopco, Bosch, or Desoutter, in any letter case. Another value is treated as AtlasCopco, and the connector logs a warning.

  • device.model: a free-form model name, used for diagnostics only.

openProtocolConnection:
  type: Cybus::Connection
  properties:
    protocol: Openprotocol
    connection:
      host: 192.168.1.100
      port: 4545
      device:
        vendor: AtlasCopco
        model: PowerFocus6000

Header Style

headerStyle sets how the connector writes the unused optional fields of the message header: digits writes explicit digits, spaces leaves them blank. The default is spaces for Desoutter and digits for every other vendor.

Keep-Alive and Timeouts

The connector sends a keep-alive message (MID 9999) every keepAlive milliseconds, 10,000 by default. Keep the interval below the controller's keep-alive timeout, which the Open Protocol specification sets at 15 seconds.

The connector waits timeOut milliseconds (default 3000) for an answer and repeats the wait retryTimes times (default 3). If no answer arrives within timeOut * (retryTimes + 1), 12 seconds with the defaults, the connector gives up on the message, closes the connection, and reconnects.

To use link-level acknowledgement (MID 9997 and MID 9998) instead of application-level acknowledgement, set linkLayerActivate: true.

Generic Mode

With genericMode: true, the connector sends requests with the generic request message (MID 0006) and subscribes with the generic subscription messages (MID 0008 and MID 0009) instead of the dedicated MID of each group. Use it for controllers that implement only the generic messages.

Reconnecting

When the connection is lost, Connectware reconnects according to connectionStrategy. Subscriptions are restored once the connection is back.

A watchdog drops a connection that stays open while the controller stops sending. If the connector receives nothing, keep-alive replies included, for watchdog.inactivityThreshold milliseconds (default 120,000), it drops the connection and reconnects. To turn the watchdog off, set watchdog.enabled to false.

Addressing a MID

An endpoint sets either midGroup or mid. An endpoint that sets neither or both goes into an error state, and the rest of the service keeps running.

MID Groups

midGroup names a MID group from the MID Group Reference. The same keyword can resolve to different MIDs per operation. For example, toolTagID as a subscription receives MID 0262, and as a read sends MID 0260.

MID Numbers

mid addresses a MID that no MID group covers, such as a vendor-specific MID 1000 or higher:

  • For subscribe, it is the data MID the controller pushes.

  • For read, it is the request MID. If the specification does not define the reply MID, set it in replyMid.

  • For write, it is the command MID.

Function Numbers and Trace Types

The following subscriptions take a property that selects what they receive:

  • relayFunction and digitalInputFunction: set the function number from the controller's tables in functionNumber. Without it, the endpoint receives the data of every function.

  • traceData: set the curve in traceType: angle, torque (default), current, gradient, stroke, or force. Use one endpoint per curve.

Sending Requests and Commands

The message you publish on <topic>/req or <topic>/set becomes the data field of the MID:

  • A string or number is sent as published. 002 arrives as the three characters 002.

  • An empty message or {} sends the MID without a data field.

  • A JSON object works for the MID groups in the following table. If a field is missing or a number is too wide, the connector sends nothing and publishes an error on <topic>/res.

MID Group
MID
JSON Payload
Sent As

selectPset

0018

{"parameterSetID": 2}

002

setPsetBatchSize

0019

{"parameterSetID": 2, "batchSize": 4}

00204

resetPsetBatchCounter

0020

{"parameterSetID": 2}

002

selectJob

0038

{"jobID": 1}

01, or 0001 when MID 0038 is pinned to revision 2

jobRestart

0039

{"jobID": 1}

01, or 0001 when MID 0039 is pinned to revision 2

vinDownload

0050

{"numberVIN": "VIN12345678"}

The VIN, padded with spaces to 25 characters

setTime

0082

{"time": "2025-06-01:12:00:00"}

2025-06-01:12:00:00

oldTighteningResultUpload (read)

0064

{"tighteningID": 123456}

0000123456

The following MID groups take no data field. The connector sends them without one and ignores any payload you publish.

MID Group
MID
Operation

psetID

0010

read

jobIdUpload

0030

read

toolDataUpload, below revision 6

0040

read

readTimeUpload

0080

read

toolTagID

0260

read

autoDisableSettings

0410

read

modeIdUpload

2600

read

keepAlive

9999

read

communicationStop

0003

write

parameterUserSetDownload

0025

write

disableTool

0042

write

enableTool

0043

write

disconnectTool

0044

write

flashGreenLightOnTool

0113

write

abortJob

0127

write

jobBatchIncrement

0128

write

setJobLineControlStart

0131

write

setJobLineAlert1

0132

write

setJobLineAlert2

0133

write

bypassIdentifier

0155

write

resetLatestIdentifier

0156

write

resetAllIdentifiers

0157

write

controllerReboot

0270

write

motorTuning

0504

write

  • ${SERVICE_ID}: the ID of the service that contains the endpoints.

Correlating Requests and Results

To match a result to its request, publish {"id": …, "value": …}, with the data field in value and an id of any JSON type. The result arrives as {"id": …, "result": …}. An object with only id sends the MID without a data field.

If the endpoint has rules, they receive the whole {"id": …, "result": …} object. To keep the correlation, copy id into the rule output.

Published Messages

The connector publishes each MID as the controller sent it:

  • mid and revision are the MID and revision the message arrived with. A controller can answer at a lower revision than requested, and the payload follows that revision.

  • The other fields come from the message header. A blank header field is 0.

  • payload holds the data field. The message carries no Connectware time stamp, so use the controller's, such as payload.timeStamp.

With rawData: true on the connection, every message also carries _raw, the data field as received, as {"type": "Buffer", "data": [...]}.

Decoded and Raw Payloads

The connector decodes the following MIDs into JSON objects at the listed revisions:

MID
MID Group
Decoded Revisions

0015

psetSelected

1–2

0035

jobInfo

1–5

0052

vin

1–2

0061

lastTightening

1–7, 998, 999

0065

oldTighteningResultUpload

1–7

0071

alarm

1–2

0074

alarmAcknowledged

1

0076

alarmStatus

1–2

0081

readTimeUpload

1

0106

lastPowerMACSTighteningResultStationData

1–3

0900

traceData

1

0901

plotData

1

Every other MID, and a decoded MID at another revision or with an unexpected layout, is published as a string, untrimmed. To receive a MID as bytes instead, list it in the connection's disableMidParsing property, for example "61,900".

Payload Fields

  • Text fields are trimmed, except numberVIN, which keeps all 25 characters.

  • Controller time stamps are strings in the format YYYY-MM-DD:HH:MM:SS.

  • In lastTightening, coded fields are texts, and a twin field with an underscore prefix holds the code. For example, torqueStatus reads LOW, OK, or HIGH, and _torqueStatus holds the number. Bit fields are lists with one entry per bit, least significant bit first, holding the text of a set bit or null.

  • A loosening arrives on lastTightening with resultType set to Loosening.

Torque values are scaled differently per MID:

MID
Torque Values
Example

0061 (lastTightening)

Divided by 100. Angles are whole degrees.

torque: 8.34 is 8.34 Nm

0065 (oldTighteningResultUpload)

Not scaled. Statuses are numbers without texts.

torque: 1234 is 12.34 Nm

0015 (psetSelected, revision 2)

Not scaled.

1000 is 10.00 Nm

0013 (psetData, string)

Scaled by 100 in the string.

000700 is 7.00 Nm

psetData is a string of numbered fields, each a two-digit field number followed by a fixed-width value. At revisions 3 and 4, an eight-character file version comes first. Parse it field by field, not by character position.

Trace and Plot Data

traceData publishes one curve per tightening. Each sample in sampleTrace has a value, already multiplied by the controller's coefficient, and a timeStamp as an ISO 8601 string. The connector reads the controller's time as its own local time, which is UTC by default. For example, 2026-08-17:15:32:13 becomes 2026-08-17T15:32:13.000Z.

plotData publishes the limit lines around the curve and needs its own endpoint. In fieldPID, parameter IDs 02002, 02003, 02012, and 02013 are lines of four 8-character fields in the order y1, x1, y2, x2. Parameter IDs 05150 and 05151 hold the start and stop of each tightening step.

Both carry the tightening in payload.resultID. The curve can arrive before its limit lines, so to combine them, keep the curve until the limit lines with the same resultID arrive.

Results and Errors

Every read and write publishes its outcome on <topic>/res:

  • A successful read publishes the reply MID.

  • An accepted write publishes the controller's acknowledgement, MID 0005, with the command MID in payload.midNumber.

  • A failed read or write publishes an error object.

code is the error code from the controller's error message (MID 0004), as defined in the Open Protocol specification. It is missing when the controller did not reject the message, for example on a timeout, a lost connection, or an invalid payload. The error object is published regardless of publishError.

A request that arrives while the connection is down is not sent, and <topic>/res receives an empty message.

Revisions

The fields of a payload depend on the revision of its MID. The connector starts the following MIDs at a higher revision, and every other MID at revision 1:

MID
Endpoint
Starting Revision

0014

psetSelected subscription

2

0051

vin subscription

2

0060

lastTightening subscription

7

0064

oldTighteningResultUpload request

7

0070

alarm subscription

2

If the controller refuses a subscription or request with error 97 or 74 (revision unsupported), the connector retries one revision lower, down to revision 1. Commands do not step down.

Pinning Revisions

To send a MID at exactly one revision, pin it with fixedRevisions on the connection, for all endpoints, or with revision on one endpoint. A fixedRevisions entry reads "{60,3}", "60,3", or '{"MID": 60, "Revision": 3}'.

A pin names the MID the connector sends. For a subscription, that is the subscribe MID, not the data MID: pin {60,5} to subscribe lastTightening at revision 5. A refused pinned revision fails instead of stepping down. If fixedRevisions and an endpoint's revision pin the same MID to different revisions, the connector does not send the MID. A read or write publishes an error object on <topic>/res, and a subscription does not start.

Pin revisions for controllers that close the connection on a revision they do not support.

Unless fixedRevisions names them, the connector pins {1,1}, {900,1}, and {901,1}, so the connection handshake (MID 0001) goes out at revision 1. An endpoint's revision must match these default pins as well. For example, revision: 2 on a traceData endpoint also needs {900,2} in fixedRevisions.

Delivery

Each subscription publishes at most one message per 100 milliseconds, in arrival order. When the controller pushes faster, for example stored results after a reconnect, messages queue and arrive with a delay.

The queue is held in memory. Messages still in the queue are lost when the connection to the controller drops, when you disable the service, or when the Protocol Mapper or the agent that runs the connection restarts. Connectware acknowledges each message to the controller when it enters the queue, so the controller treats a lost message as delivered.

MID Group Reference

The following tables list the MID groups per operation and the MIDs they stand for. The Payload column shows whether the connector decodes the data or publishes it as a string.

Subscribe

MID Group
Data MID
Subscribe MID
Payload

alarm

0071

0070

Decoded

alarmAcknowledged

0074

Arrives with alarm (0070)

Decoded

alarmStatus

0076

Arrives with alarm (0070)

Decoded

automaticManualMode

0401

0400

String

digitalInputFunction

0221

0220

String

jobInfo

0035

0034

Decoded

jobLineControl

0121

0120

String

lastPowerMACSTighteningResultStationData

0106

0105

Decoded

lastTightening

0061

0060

Decoded

lockAtBatchDoneUpload

0022

0021

String

motorTuningResultData

0501

0500

String

multipleIdentifierResultParts

0152

0151

String

multiSpindleResult

0101

0100

String

multiSpindleStatus

0091

0090

String

openProtocolCommandsDisabled

0421

0420

String

plotData

0901

0008

Decoded

psetSelected

0015

0014

Decoded

relayFunction

0217

0216

String

selectorSocketInfo

0251

0250

String

statusExternallyMonitoredInputs

0211

0210

String

toolTagID

0262

0261

String

traceData

0900

0008

Decoded

userData

0242

0241

String

vin

0052

0051

Decoded

Read

MID Group
Request MID
Reply MID
Payload

autoDisableSettings

0410

0411

String

histogramUpload

0300

0301

String

ioDeviceStatus

0214

0215

String

jobDataUpload

0032

0033

String

jobIdUpload

0030

0031

String

keepAlive

9999

9999

String

modeDataUpload

2602

2603

String

modeIdUpload

2600

2601

String

oldTighteningResultUpload

0064

0065

Decoded

psetData

0012

0013

String

psetID

0010

0011

String

readTimeUpload

0080

0081

Decoded

toolDataUpload

0040

0041

String

toolTagID

0260

0262

String

Write

MID Group
MID

communicationStop

0003

selectPset

0018

setPsetBatchSize

0019

resetPsetBatchCounter

0020

parameterUserSetDownload

0025

selectJob

0038

jobRestart

0039

disableTool

0042

enableTool

0043

disconnectTool

0044

setCalibrationValue

0045

setPrimaryTool

0046

toolPairingHandling

0047

vinDownload

0050

setTime

0082

displayUserTextOnCompact

0110

displayUserTextOnGraph

0111

flashGreenLightOnTool

0113

abortJob

0127

jobBatchIncrement

0128

jobBatchDecrement

0129

jobOff

0130

setJobLineControlStart

0131

setJobLineAlert1

0132

setJobLineAlert2

0133

executeDynamicJob

0140

identifierDownload

0150

bypassIdentifier

0155

resetLatestIdentifier

0156

resetAllIdentifiers

0157

setExternallyControlledRelays

0200

setDigitalInputFunction

0224

resetDigitalInputFunction

0225

userDataDownload

0240

userDataDownloadWithOffset

0245

selectorControlGreenLights

0254

selectorControlRedLights

0255

controllerReboot

0270

motorTuning

0504

deviceCommand

2100

passwordRequest

2502

passwordResponse

2503

selectParameterSetDynamically

2505

selectMode

2606

Service Commissioning File Example

The following service commissioning file subscribes to tightening results, alarms, and torque curves, reads the parameter set IDs of the controller, and selects a parameter set.

Troubleshooting

The connector logs the following messages:

Log Message
Meaning

Read of 'psetID' failed: MID 10 rejected (error 97: …)

The controller refused the request. The error is also published on <topic>/res.

Write to 'selectJob' failed: MID 38 rejected (error 1: …)

The controller refused the command. The error is also published on <topic>/res.

Ignoring malformed fixedRevisions entry '…'

One fixedRevisions entry could not be read and was skipped.

Openprotocol client reported: …

A problem that does not end the connection.

Publishing MID 0061 revision 8 as received: …

A decoded MID arrived at a revision or in a layout the connector does not decode. It is published as a string.

Openprotocol watchdog: nothing received for …s, dropping the connection

The controller stopped sending. The connector reconnects.

Subscription … receives pushes faster than it publishes them: … queued, at least … s behind

100 or more messages are queued. See Delivery.

Unknown Openprotocol vendor '…'

device.vendor is not a supported vendor. The connection proceeds as AtlasCopco.

If a controller does not answer the connection handshake or closes the connection right after it, try the following:

Last updated

Was this helpful?