Overview

The Open Protocol connector provides tag-based read access and on-demand command access to an Atlas Copco tightening controller (smart tool) over TCP/IP, using the industry-standard Open Protocol (MID-based message) interface via a custom TCP client (IW.OpenProtocol.Ethernet.SimpleTcpClient).

Each poll cycle sends a keep-alive (MID 9999) and expects a reply within the request timeout - a timeout, a socket-level disconnect, or an exception are all treated as a lost connection. Incoming MID messages (tightening results, alarms, job/program status, etc.) are routed to whichever tag is subscribed to that MID number.

The connector detects when the underlying connection is lost and reconnects automatically without blocking the read cycle - reconnection runs on its own dedicated background thread, and the previous TCP client is properly disposed (stopping its background receive thread and closing its socket) before a new one replaces it.

Parameters

Name Values Description
Type OPENPROTOCOL The connector type identifier.
IP IP address or hostname The IP address or hostname of the tightening controller.
Port integer The controller's Open Protocol port. Defaults to 4545.
Revision integer The Open Protocol revision to request during the initial handshake.
UpdateRate milliseconds (integer) How often the connector sends a keep-alive and polls for tag updates. Defaults to 5000.
ReconnectDelay milliseconds (integer) Delay between reconnect attempts while the controller is unreachable. Defaults to 2000.

Supported Tag Types:

Tag Type Address Behaviour
Any standard tag A MID number, e.g. MID0040 or 40 Read-only. The MID prefix, if present, is stripped and the number left-padded to 4 digits when subscribing; incoming messages of that MID are routed to this tag.

Connector Methods

Name Arguments Description
StartCommunication - Starts the Open Protocol communication start sequence (MID 0001) and subscribes to incoming messages. Called automatically on connect.
StopCommunication - Sends the communication stop sequence.
ActivateTool / DeactivateTool - Activates/deactivates the tightening tool.
Send / SendAndWaitForResponse MID, Revision, StationId, NoAckFlag Builds and sends an arbitrary Open Protocol MID message; the WaitForResponse variant blocks for the matching reply.
SendRaw / SendAndWaitForResponseRaw Message Sends a pre-built raw Open Protocol message string.
ProgramSelectedSubscribe / JobInfoSubscribe / AlarmSubscribe / DigitalInputSubscribe / TighteningSubscribe - Subscribes to the corresponding class of controller-pushed messages.
RelaySubscribe OutputFunction Subscribes to relay/output function status changes.
Subscribe MID, Revision, ExtraData Subscribes to an arbitrary MID not covered by the named subscribe methods above.

Addressing

The Address field of a tag is a bare Open Protocol MID number, e.g. 40 or MID0040 - both forms are accepted. The same message-send capabilities are also available on demand via RunMethod's SEND/SENDANDWAITFORRESPONSE family, for commands rather than passive subscription.