“Bearbeitungszentrum BAZ” - Single File and Custom Topics¶
This example shows an entire BAZ setup expressed within a single commissioning file and by using explicit topics on the endpoint resources (obsoleting a mapping resource).
Download: bazCustomTopics.yml
Note
The example below uses an additional Docker image provided by Cybus that requires a suitable license. You can check the current capabilities and permissions of your Connectware license in the Cybus Portal (https://portal.cybus.io). If your license is not eligible to use the example Docker image, please contact Cybus Sales (sales@cybus.io).
1description: >
2 Entire simulated machining demo setup
3
4metadata:
5
6 name: Simulated Machining Center
7 icon: https://www.cybus.io/wp-content/themes/cybus/img/product-slide-img.png
8 provider: cybus
9 homepage: https://www.cybus.io
10 version: 2.0.0
11
12parameters:
13
14 modbusPort:
15 type: integer
16 default: 10502
17 dockerBridgeNetworkIp:
18 type: string
19 default: 172.17.0.1
20 description: The IP address of the docker bridge network gateway, see "docker network inspect bridge"
21
22definitions:
23
24 CYBUS_MQTT_ROOT: cybus/baz-simulator
25
26 defaultModbusAddress:
27 fc: 3
28 length: 2
29 interval: 1000
30 dataType: uint16BE
31
32resources:
33
34 machineSimulator:
35 type: Cybus::Container
36 properties:
37 image: registry.cybus.io/cybus-services/baz-machine-simulator:0.0.1
38 ports:
39 - !sub '${modbusPort}:10502/tcp'
40
41 modbusConnection:
42 type: Cybus::Connection
43 properties:
44 protocol: Modbus
45 targetState: connected
46 connection:
47 host: !ref dockerBridgeNetworkIp
48 port: !ref modbusPort
49
50 currentState:
51 type: Cybus::Endpoint
52 properties:
53 protocol: Modbus
54 connection: !ref modbusConnection
55 topic: current-state
56 subscribe:
57 !merge
58 defaultModbusAddress:
59 address: 0
60
61 currentTool:
62 type: Cybus::Endpoint
63 properties:
64 protocol: Modbus
65 connection: !ref modbusConnection
66 topic: current-tool
67 subscribe:
68 !merge
69 defaultModbusAddress:
70 address: 2
71
72 coolantLevel:
73 type: Cybus::Endpoint
74 properties:
75 protocol: Modbus
76 connection: !ref modbusConnection
77 topic: coolant-level
78 subscribe:
79 !merge
80 defaultModbusAddress:
81 address: 4
82
83 spindleSpeed:
84 type: Cybus::Endpoint
85 properties:
86 protocol: Modbus
87 connection: !ref modbusConnection
88 topic: spindle-speed
89 subscribe:
90 !merge
91 defaultModbusAddress:
92 address: 6
93
94 dashboard:
95 type: Cybus::Container
96 properties:
97 image: registry.cybus.io/cybus-services/baz-dashboard:0.2.3
98 volumes:
99 - !sub '${dashboardData}:/root/.node-red'
100 environment:
101 MQTT_HOST: !ref Cybus::MqttHost
102 MQTT_USER: !ref Cybus::MqttUser
103 MQTT_PASS: !ref Cybus::MqttPassword
104 MQTT_PORT: !ref Cybus::MqttPort
105 HTTP_ROOT: /
106
107 dashboardData:
108 type: Cybus::Volume
109
110 dashboardRoute:
111 type: Cybus::IngressRoute
112 properties:
113 container: !ref dashboard
114 type: http
115 slug: dashboard
116 target:
117 path: /
118 port: 1880
119
120 dashboardLink:
121 type: Cybus::Link
122 properties:
123 ingressRoute: !ref dashboardRoute
124 href: ui/
125 name: Dashboard