You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-7Lines changed: 45 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,22 +2,24 @@
2
2
3
3
> Manufacturing line simulator interfaced using PackML over MQTT.
4
4
5
-
PackML MQTT Simulator is a virtual line that interfaces using PackML implemented over MQTT. For use with the development of Industry 4.0 software solutions. The simulator implements the following PackML State model below and communicates over MQTT topics as defined by environmental variables.
5
+
PackML MQTT Simulator is a virtual line that interfaces using PackML implemented over MQTT. For use with the development of Industry 4.0 software solutions. The simulator implements the following PackML State model below and communicates over MQTT topics as defined by environmental variables. The simulator can run with either a basic MQTT topic structure or SparkPlugB.
6
6
7
7

8
8
9
9
The simulator supports the following topic and payload defintions:
To start and run the PackML simulation, you'll need an MQTT server running and accessible to the image. Once available, the easiest approach is using docker to run the simulation using environmental variables to control the MQTT connection, Site, Area, and line. Once up and running, use an MQTT client to publish to .../Command/Reset and .../Command/Start to get the simulated machine into the execute state. The default topic and payload is Custom as defined below.
16
+
To start and run the PackML simulation, you'll need an MQTT server running and accessible. Once available, the easiest approach is using docker to run the simulation using environmental variables to control the MQTT connection, Site, Area, and line.
17
17
18
18
### Docker
19
19
20
-
Start your container with environmental variables
20
+
Start your container with environmental variables.
2020-06-22T03:13:49.819Z | info: Site/Area/Line/Status/UnitModeCurrent : Production
27
29
```
28
30
31
+
Once up and running, use an MQTT client to publish to .../Command/Reset and .../Command/Start to get the simulated machine into the execute state. The default topic and payload is Custom as defined below.
2020-06-22T03:13:49.817Z | info: Connected to mqtt://broker.hivemq.com:1883
39
+
2020-06-22T03:13:49.819Z | info: Site/Area/Line/Status/UnitModeCurrent : Production
40
+
```
41
+
42
+
Once up and running, use an Sparkplug B device commands to publish to `Command.Reset` and `Command.Start` metrics to get the simulated machine into the execute state.
2020-06-22T03:13:49.819Z | info: Site/Area/Line/Status/UnitModeCurrent : Production
42
59
```
43
60
44
-
### Publish Commands
61
+
#### SparkPlugB
62
+
63
+
```shell
64
+
$ npm i
65
+
...
66
+
added 421 packages from 213 contributors and audited 421 packages in 12.337s
67
+
found 0 vulnerabilities
68
+
$ export LINE=Line
69
+
$ export CLIENT_TYPE=sparkplugb
70
+
71
+
$ node --max-old-space-size=20 ./src/index.js
72
+
2021-06-01T20:05:30.841Z | info: Initializing
73
+
2021-06-01T20:05:31.141Z | info: Connected to mqtt://broker.hivemq.com:1883
74
+
2021-06-01T20:05:31.142Z | info: Site/Area/Line/Status/UnitModeCurrentStr : Production
75
+
```
76
+
77
+
### Publish Commands for Basic MQTT Structure
45
78
46
79
Please allow some time in between commands to enable the machine to get to the Idle state before issuing the Start command.
47
80
@@ -72,9 +105,9 @@ The simulation consists of
72
105
73
106
The simulation uses probability dice rolls to determine actions.
74
107
75
-
## Interfacing via Custom Interface
108
+
## interfacing via Basic MQTT Topic Structure
76
109
77
-
Interface with the virtual line via MQTT. The virtual line subscribes to `<SITE>/<AREA>/<LINE>/Command/*` (see below) and publishes information to `<SITE>/<AREA>/<LINE>/Status` and `<SITE>/<AREA>/<LINE>/Admin`. `<SITE>`, `<AREA>` and `<LINE>` are set using environmental variables.
110
+
Interface with the virtual line via the basic MQTT structure. The virtual line subscribes to `<SITE>/<AREA>/<LINE>/Command/*` (see below) and publishes information to `<SITE>/<AREA>/<LINE>/Status` and `<SITE>/<AREA>/<LINE>/Admin`. `<SITE>`, `<AREA>` and `<LINE>` are set using environmental variables.
78
111
79
112
### Commands
80
113
@@ -262,6 +295,11 @@ For any issue, there are fundamentally three ways an individual can contribute:
0 commit comments