Cybus::Connection

A connection provides connectivity to some other things over some protocol (see also Industry Protocol Details) and implements connect and disconnect functionality.

Properties

Property

Type

Required

protocol

enum

Required

targetState

enum

Optional

agentName

string

Optional

connection

object

Required

protocol

Identifies the protocol for which a connection should be established

  • is required

  • type: enum

The value of this property must be equal to one of the below

  • Ads

  • Bacnet

  • EthernetIp

  • Focas

  • GenericVrpc

  • Hbmdaq

  • Heidenhain

  • Http

  • InfluxDB

  • Kafka

  • Modbus

  • Mqtt

  • Mssql

  • Opcda

  • Opcua

  • Profinet

  • S7

  • Shdr

  • Sinumerik

  • Sopas

  • Sql

  • Systemstate

  • Werma

targetState

The state this resource should be in, after start-up.

  • is optional

  • type: enum, must be one of connected, disconnected

  • default: connected

agentName

Only set this property if your protocol-mapper runs as in a distributed mode, i.e. on an agent instance separated from the Connectware. If this is the case, specify the corresponding agent name here.

  • is optional

  • type: string

  • default: protocol-mapper

connection

  • is required

  • type: object

Depending on the protocol type the connection provides the following properties:

Most protocols expose a property connectionStrategy which allows configuring the incremental delays between re-connection attempts. Each protocol provides defaults for this configuration which is documented on each of them. In general an initialDelay property determines how many milliseconds to wait before the first attempt to re-connect is executed and then this value is multiplied by the configured incrementFactor, replacing the original initialDelay, up to a maximum configured maxDelay that once reached causes all subsequent re-connection attempts to occur after that many milliseconds. Once the connection is restablished the initialDelay is reset to its original value. The procotols Mqtt, Opcua, S7 and Sinumerik use their own strategy described in each of them.

Examples

Mqtt

1mqttConnection:
2  type: Cybus::Connection
3  properties:
4    protocol: Mqtt
5    connection:
6      host: broker

OPC UA

1opcuaConnection:
2  type: Cybus::Connection
3  properties:
4    protocol: Opcua
5    connection:
6      host: 127.17.0.1
7      port: 50000
8      username: user
9      password: user

Modbus

1modbusConnection:
2  type: Cybus::Connection
3  properties:
4    agentName: edge-mapper # uses the protocol-mapper agent 'edge-mapper'
5    protocol: Modbus
6    connection:
7      host: 172.17.0.1
8      port: 10502