node-red-dashboard-2-hmi 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +144 -140
- package/LICENSE +21 -21
- package/README.md +273 -273
- package/docs/mensagens.md +266 -266
- package/examples/clp-schneider.json +431 -431
- package/examples/envase.json +545 -545
- package/examples/esteira.json +639 -639
- package/examples/pintura.json +610 -610
- package/examples/tela-basica.json +572 -572
- package/nodes/access.js +69 -69
- package/nodes/admin.js +170 -166
- package/nodes/alarms.js +177 -177
- package/nodes/clients.js +31 -31
- package/nodes/plugin.js +24 -24
- package/nodes/trend.js +54 -54
- package/nodes/ui-hmi-canvas.html +383 -383
- package/nodes/ui-hmi-canvas.js +335 -335
- package/nodes/values.js +176 -176
- package/package.json +63 -63
- package/resources/hmi-editor.js +10893 -10887
- package/resources/ui-hmi-canvas.umd.js +667 -667
package/examples/envase.json
CHANGED
|
@@ -1,545 +1,545 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "ex_env",
|
|
4
|
-
"type": "tab",
|
|
5
|
-
"label": "IHM envase",
|
|
6
|
-
"info": "Linha de envase simulada, montada com as montagens prontas (Estação de envase e Cilindro com válvula). Abra /dashboard/envase."
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"id": "hx_base",
|
|
10
|
-
"type": "ui-base",
|
|
11
|
-
"name": "Dashboard",
|
|
12
|
-
"path": "/dashboard",
|
|
13
|
-
"includeClientData": true,
|
|
14
|
-
"acceptsClientConfig": [
|
|
15
|
-
"ui-notification",
|
|
16
|
-
"ui-control"
|
|
17
|
-
],
|
|
18
|
-
"showPathInSidebar": false,
|
|
19
|
-
"navigationStyle": "none",
|
|
20
|
-
"titleBarStyle": "hidden"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"id": "hx_theme",
|
|
24
|
-
"type": "ui-theme",
|
|
25
|
-
"name": "Default",
|
|
26
|
-
"colors": {
|
|
27
|
-
"surface": "#ffffff",
|
|
28
|
-
"primary": "#0094CE",
|
|
29
|
-
"bgPage": "#eeeeee",
|
|
30
|
-
"groupBg": "#ffffff",
|
|
31
|
-
"groupOutline": "#cccccc"
|
|
32
|
-
},
|
|
33
|
-
"sizes": {
|
|
34
|
-
"pagePadding": "12px",
|
|
35
|
-
"groupGap": "12px",
|
|
36
|
-
"groupBorderRadius": "4px",
|
|
37
|
-
"widgetGap": "12px"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"id": "pg_env",
|
|
42
|
-
"type": "ui-page",
|
|
43
|
-
"name": "Envase",
|
|
44
|
-
"ui": "hx_base",
|
|
45
|
-
"path": "/envase",
|
|
46
|
-
"icon": "bottle-wine",
|
|
47
|
-
"layout": "grid",
|
|
48
|
-
"theme": "hx_theme",
|
|
49
|
-
"breakpoints": [
|
|
50
|
-
{
|
|
51
|
-
"name": "Default",
|
|
52
|
-
"px": "0",
|
|
53
|
-
"cols": "3"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"name": "Desktop",
|
|
57
|
-
"px": "1024",
|
|
58
|
-
"cols": "12"
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
"order": 5,
|
|
62
|
-
"visible": "true",
|
|
63
|
-
"disabled": "false"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"id": "env_cmt",
|
|
67
|
-
"type": "comment",
|
|
68
|
-
"z": "ex_env",
|
|
69
|
-
"name": "Ciclo simulado a cada 1 s: a garrafa chega, o cilindro trava, enche, tampa, rotula e solta.",
|
|
70
|
-
"info": "",
|
|
71
|
-
"x": 360,
|
|
72
|
-
"y": 40,
|
|
73
|
-
"wires": []
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"id": "env_tick",
|
|
77
|
-
"type": "inject",
|
|
78
|
-
"z": "ex_env",
|
|
79
|
-
"name": "a cada 1 s",
|
|
80
|
-
"props": [],
|
|
81
|
-
"repeat": "1",
|
|
82
|
-
"once": true,
|
|
83
|
-
"onceDelay": "1",
|
|
84
|
-
"topic": "",
|
|
85
|
-
"x": 120,
|
|
86
|
-
"y": 120,
|
|
87
|
-
"wires": [
|
|
88
|
-
[
|
|
89
|
-
"env_sim"
|
|
90
|
-
]
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"id": "env_sim",
|
|
95
|
-
"type": "function",
|
|
96
|
-
"z": "ex_env",
|
|
97
|
-
"name": "simula envase",
|
|
98
|
-
"func": "// Ciclo de envase simulado. Troque pelos valores do seu CLP.\n// passos: 0 esteira leva a garrafa, 1 trava (cilindro) e enche, 2 tampa, 3 rotula, 4 solta\nconst s = flow.get('sim') || { passo: 0, t: 0, nivel: 0, garrafas: 0 }\nconst cmd = flow.get('cmd') || { rodando: 1 }\nif (cmd.rodando) {\n s.t++\n if (s.passo === 0 && s.t >= 3) { s.passo = 1; s.t = 0; s.nivel = 0 }\n else if (s.passo === 1) { s.nivel = Math.min(100, s.nivel + 20); if (s.nivel >= 100) { s.passo = 2; s.t = 0 } }\n else if (s.passo === 2 && s.t >= 2) { s.passo = 3; s.t = 0 }\n else if (s.passo === 3 && s.t >= 2) { s.passo = 4; s.t = 0; s.garrafas++ }\n else if (s.passo === 4 && s.t >= 1) { s.passo = 0; s.t = 0; s.nivel = 0 }\n}\nflow.set('sim', s)\nconst trava = s.passo >= 1 && s.passo <= 3\nmsg.payload = {\n rodando: cmd.rodando, ciclo: s.passo,\n 'E1.esteira': cmd.rodando && (s.passo === 0 || s.passo === 4) ? 1 : 0,\n 'E1.garrafa': s.passo >= 1 && s.passo <= 3 ? 1 : 0,\n 'E1.nivel': s.nivel, 'E1.tampa': s.passo === 2 ? 1 : 0, 'E1.rotulo': s.passo === 3 ? 1 : 0,\n 'E1.garrafas': s.garrafas, 'E1.falha': cmd.rodando ? 0 : 1,\n 'Y1.solenoide': trava ? 1 : 0, 'Y1.avancado': trava ? 1 : 0, 'Y1.recuado': trava ? 0 : 1\n}\nreturn msg",
|
|
99
|
-
"outputs": 1,
|
|
100
|
-
"x": 290,
|
|
101
|
-
"y": 120,
|
|
102
|
-
"wires": [
|
|
103
|
-
[
|
|
104
|
-
"env_canvas"
|
|
105
|
-
]
|
|
106
|
-
]
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"id": "env_canvas",
|
|
110
|
-
"type": "ui-hmi-canvas",
|
|
111
|
-
"z": "ex_env",
|
|
112
|
-
"name": "Envase",
|
|
113
|
-
"scope": "page",
|
|
114
|
-
"page": "pg_env",
|
|
115
|
-
"order": 1,
|
|
116
|
-
"viewW": 1280,
|
|
117
|
-
"viewH": 720,
|
|
118
|
-
"theme": "isa101",
|
|
119
|
-
"fit": "screen",
|
|
120
|
-
"background": "theme",
|
|
121
|
-
"offlineAfter": 10,
|
|
122
|
-
"locale": "pt-BR",
|
|
123
|
-
"alarms": "on",
|
|
124
|
-
"alarmsOut": "no",
|
|
125
|
-
"symbols": [
|
|
126
|
-
{
|
|
127
|
-
"id": "env1",
|
|
128
|
-
"type": "text",
|
|
129
|
-
"x": 60,
|
|
130
|
-
"y": 90,
|
|
131
|
-
"w": 640,
|
|
132
|
-
"h": 24,
|
|
133
|
-
"rot": 0,
|
|
134
|
-
"key": "",
|
|
135
|
-
"props": {
|
|
136
|
-
"text": "Envase E1",
|
|
137
|
-
"size": 14,
|
|
138
|
-
"align": "middle",
|
|
139
|
-
"bold": "yes",
|
|
140
|
-
"tone": "normal",
|
|
141
|
-
"unit": "",
|
|
142
|
-
"decimals": ""
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"id": "env2",
|
|
147
|
-
"type": "frame",
|
|
148
|
-
"x": 60,
|
|
149
|
-
"y": 120,
|
|
150
|
-
"w": 260,
|
|
151
|
-
"h": 170,
|
|
152
|
-
"rot": 0,
|
|
153
|
-
"key": "E1.nivel",
|
|
154
|
-
"props": {
|
|
155
|
-
"shape": "filler",
|
|
156
|
-
"tone": "equip",
|
|
157
|
-
"label": "Enchedora",
|
|
158
|
-
"level": "no",
|
|
159
|
-
"min": 0,
|
|
160
|
-
"max": 100,
|
|
161
|
-
"levelColor": "level",
|
|
162
|
-
"showValue": "no",
|
|
163
|
-
"unit": "%",
|
|
164
|
-
"decimals": 0,
|
|
165
|
-
"motion": "value"
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"id": "env3",
|
|
170
|
-
"type": "frame",
|
|
171
|
-
"x": 340,
|
|
172
|
-
"y": 150,
|
|
173
|
-
"w": 150,
|
|
174
|
-
"h": 140,
|
|
175
|
-
"rot": 0,
|
|
176
|
-
"key": "E1.tampa",
|
|
177
|
-
"props": {
|
|
178
|
-
"shape": "capper",
|
|
179
|
-
"tone": "equip",
|
|
180
|
-
"label": "Tampadora",
|
|
181
|
-
"level": "no",
|
|
182
|
-
"min": 0,
|
|
183
|
-
"max": 100,
|
|
184
|
-
"levelColor": "level",
|
|
185
|
-
"showValue": "no",
|
|
186
|
-
"unit": "%",
|
|
187
|
-
"decimals": 0
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
"id": "env4",
|
|
192
|
-
"type": "frame",
|
|
193
|
-
"x": 510,
|
|
194
|
-
"y": 150,
|
|
195
|
-
"w": 180,
|
|
196
|
-
"h": 140,
|
|
197
|
-
"rot": 0,
|
|
198
|
-
"key": "E1.rotulo",
|
|
199
|
-
"props": {
|
|
200
|
-
"shape": "labeler",
|
|
201
|
-
"tone": "equip",
|
|
202
|
-
"label": "Rotuladora",
|
|
203
|
-
"level": "no",
|
|
204
|
-
"min": 0,
|
|
205
|
-
"max": 100,
|
|
206
|
-
"levelColor": "level",
|
|
207
|
-
"showValue": "no",
|
|
208
|
-
"unit": "%",
|
|
209
|
-
"decimals": 0
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"id": "env5",
|
|
214
|
-
"type": "conveyor",
|
|
215
|
-
"x": 60,
|
|
216
|
-
"y": 320,
|
|
217
|
-
"w": 640,
|
|
218
|
-
"h": 40,
|
|
219
|
-
"rot": 0,
|
|
220
|
-
"key": "E1.esteira",
|
|
221
|
-
"props": {
|
|
222
|
-
"label": "",
|
|
223
|
-
"onWhen": "nonzero",
|
|
224
|
-
"threshold": 0,
|
|
225
|
-
"dir": "fwd",
|
|
226
|
-
"faultKey": "",
|
|
227
|
-
"priority": "1"
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
"id": "env6",
|
|
232
|
-
"type": "frame",
|
|
233
|
-
"x": 280,
|
|
234
|
-
"y": 370,
|
|
235
|
-
"w": 160,
|
|
236
|
-
"h": 30,
|
|
237
|
-
"rot": 0,
|
|
238
|
-
"key": "E1.garrafa",
|
|
239
|
-
"props": {
|
|
240
|
-
"shape": "photoEye",
|
|
241
|
-
"tone": "equip",
|
|
242
|
-
"label": "",
|
|
243
|
-
"level": "no",
|
|
244
|
-
"min": 0,
|
|
245
|
-
"max": 100,
|
|
246
|
-
"levelColor": "level",
|
|
247
|
-
"showValue": "no",
|
|
248
|
-
"unit": "%",
|
|
249
|
-
"decimals": 0
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
"id": "env7",
|
|
254
|
-
"type": "frame",
|
|
255
|
-
"x": 660,
|
|
256
|
-
"y": 110,
|
|
257
|
-
"w": 36,
|
|
258
|
-
"h": 70,
|
|
259
|
-
"rot": 0,
|
|
260
|
-
"key": "E1.falha",
|
|
261
|
-
"props": {
|
|
262
|
-
"shape": "beacon",
|
|
263
|
-
"tone": "equip",
|
|
264
|
-
"label": "",
|
|
265
|
-
"level": "no",
|
|
266
|
-
"min": 0,
|
|
267
|
-
"max": 100,
|
|
268
|
-
"levelColor": "level",
|
|
269
|
-
"showValue": "no",
|
|
270
|
-
"unit": "%",
|
|
271
|
-
"decimals": 0
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"id": "env8",
|
|
276
|
-
"type": "tag",
|
|
277
|
-
"x": 60,
|
|
278
|
-
"y": 420,
|
|
279
|
-
"w": 140,
|
|
280
|
-
"h": 60,
|
|
281
|
-
"rot": 0,
|
|
282
|
-
"key": "E1.nivel",
|
|
283
|
-
"props": {
|
|
284
|
-
"title": "NÍVEL",
|
|
285
|
-
"unit": "%",
|
|
286
|
-
"decimals": 0,
|
|
287
|
-
"min": "",
|
|
288
|
-
"max": "",
|
|
289
|
-
"lo": "",
|
|
290
|
-
"hi": "",
|
|
291
|
-
"priority": "2"
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"id": "env9",
|
|
296
|
-
"type": "counter",
|
|
297
|
-
"x": 220,
|
|
298
|
-
"y": 420,
|
|
299
|
-
"w": 160,
|
|
300
|
-
"h": 60,
|
|
301
|
-
"rot": 0,
|
|
302
|
-
"key": "E1.garrafas",
|
|
303
|
-
"props": {
|
|
304
|
-
"kind": "count",
|
|
305
|
-
"title": "GARRAFAS",
|
|
306
|
-
"src": "h",
|
|
307
|
-
"decimals": 0,
|
|
308
|
-
"unit": "",
|
|
309
|
-
"label": ""
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"id": "cil10",
|
|
314
|
-
"type": "text",
|
|
315
|
-
"x": 780,
|
|
316
|
-
"y": 90,
|
|
317
|
-
"w": 260,
|
|
318
|
-
"h": 24,
|
|
319
|
-
"rot": 0,
|
|
320
|
-
"key": "",
|
|
321
|
-
"props": {
|
|
322
|
-
"text": "Y1",
|
|
323
|
-
"size": 14,
|
|
324
|
-
"align": "middle",
|
|
325
|
-
"bold": "yes",
|
|
326
|
-
"tone": "normal",
|
|
327
|
-
"unit": "",
|
|
328
|
-
"decimals": ""
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
"id": "cil11",
|
|
333
|
-
"type": "frame",
|
|
334
|
-
"x": 790,
|
|
335
|
-
"y": 120,
|
|
336
|
-
"w": 50,
|
|
337
|
-
"h": 70,
|
|
338
|
-
"rot": 0,
|
|
339
|
-
"key": "Y1.recuado",
|
|
340
|
-
"props": {
|
|
341
|
-
"shape": "limitSwitch",
|
|
342
|
-
"tone": "equip",
|
|
343
|
-
"label": "Recuado",
|
|
344
|
-
"level": "no",
|
|
345
|
-
"min": 0,
|
|
346
|
-
"max": 100,
|
|
347
|
-
"levelColor": "level",
|
|
348
|
-
"showValue": "no",
|
|
349
|
-
"unit": "%",
|
|
350
|
-
"decimals": 0
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
"id": "cil12",
|
|
355
|
-
"type": "frame",
|
|
356
|
-
"x": 980,
|
|
357
|
-
"y": 120,
|
|
358
|
-
"w": 50,
|
|
359
|
-
"h": 70,
|
|
360
|
-
"rot": 0,
|
|
361
|
-
"key": "Y1.avancado",
|
|
362
|
-
"props": {
|
|
363
|
-
"shape": "limitSwitch",
|
|
364
|
-
"tone": "equip",
|
|
365
|
-
"label": "Avançado",
|
|
366
|
-
"level": "no",
|
|
367
|
-
"min": 0,
|
|
368
|
-
"max": 100,
|
|
369
|
-
"levelColor": "level",
|
|
370
|
-
"showValue": "no",
|
|
371
|
-
"unit": "%",
|
|
372
|
-
"decimals": 0
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
"id": "cil13",
|
|
377
|
-
"type": "frame",
|
|
378
|
-
"x": 780,
|
|
379
|
-
"y": 220,
|
|
380
|
-
"w": 260,
|
|
381
|
-
"h": 70,
|
|
382
|
-
"rot": 0,
|
|
383
|
-
"key": "Y1.avancado",
|
|
384
|
-
"props": {
|
|
385
|
-
"shape": "pneuCyl",
|
|
386
|
-
"tone": "equip",
|
|
387
|
-
"label": "",
|
|
388
|
-
"level": "no",
|
|
389
|
-
"min": 0,
|
|
390
|
-
"max": 100,
|
|
391
|
-
"levelColor": "level",
|
|
392
|
-
"showValue": "no",
|
|
393
|
-
"unit": "%",
|
|
394
|
-
"decimals": 0,
|
|
395
|
-
"motion": "onoff"
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
"id": "cil14",
|
|
400
|
-
"type": "frame",
|
|
401
|
-
"x": 820,
|
|
402
|
-
"y": 320,
|
|
403
|
-
"w": 180,
|
|
404
|
-
"h": 80,
|
|
405
|
-
"rot": 0,
|
|
406
|
-
"key": "Y1.solenoide",
|
|
407
|
-
"props": {
|
|
408
|
-
"shape": "valve52",
|
|
409
|
-
"tone": "equip",
|
|
410
|
-
"label": "Válvula Y1",
|
|
411
|
-
"level": "no",
|
|
412
|
-
"min": 0,
|
|
413
|
-
"max": 100,
|
|
414
|
-
"levelColor": "level",
|
|
415
|
-
"showValue": "no",
|
|
416
|
-
"unit": "%",
|
|
417
|
-
"decimals": 0
|
|
418
|
-
}
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
"id": "ui15",
|
|
422
|
-
"type": "text",
|
|
423
|
-
"x": 60,
|
|
424
|
-
"y": 30,
|
|
425
|
-
"w": 600,
|
|
426
|
-
"h": 36,
|
|
427
|
-
"rot": 0,
|
|
428
|
-
"key": "",
|
|
429
|
-
"props": {
|
|
430
|
-
"text": "Linha de envase (simulada)",
|
|
431
|
-
"size": 24,
|
|
432
|
-
"align": "start",
|
|
433
|
-
"bold": "yes",
|
|
434
|
-
"tone": "normal",
|
|
435
|
-
"unit": "",
|
|
436
|
-
"decimals": ""
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
"id": "ui16",
|
|
441
|
-
"type": "button",
|
|
442
|
-
"x": 780,
|
|
443
|
-
"y": 440,
|
|
444
|
-
"w": 130,
|
|
445
|
-
"h": 50,
|
|
446
|
-
"rot": 0,
|
|
447
|
-
"key": "rodando",
|
|
448
|
-
"props": {
|
|
449
|
-
"text": "PARTIR",
|
|
450
|
-
"textOn": "",
|
|
451
|
-
"onWhen": "nonzero",
|
|
452
|
-
"threshold": 0
|
|
453
|
-
},
|
|
454
|
-
"action": {
|
|
455
|
-
"mode": "pulse",
|
|
456
|
-
"value": "",
|
|
457
|
-
"topic": "cmd/partir",
|
|
458
|
-
"confirm": "no"
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
"id": "ui17",
|
|
463
|
-
"type": "button",
|
|
464
|
-
"x": 930,
|
|
465
|
-
"y": 440,
|
|
466
|
-
"w": 130,
|
|
467
|
-
"h": 50,
|
|
468
|
-
"rot": 0,
|
|
469
|
-
"key": "",
|
|
470
|
-
"props": {
|
|
471
|
-
"text": "PARAR",
|
|
472
|
-
"textOn": "",
|
|
473
|
-
"onWhen": "nonzero",
|
|
474
|
-
"threshold": 0
|
|
475
|
-
},
|
|
476
|
-
"action": {
|
|
477
|
-
"mode": "pulse",
|
|
478
|
-
"value": "",
|
|
479
|
-
"topic": "cmd/parar",
|
|
480
|
-
"confirm": "no"
|
|
481
|
-
}
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
"id": "ui18",
|
|
485
|
-
"type": "tag",
|
|
486
|
-
"x": 780,
|
|
487
|
-
"y": 520,
|
|
488
|
-
"w": 130,
|
|
489
|
-
"h": 60,
|
|
490
|
-
"rot": 0,
|
|
491
|
-
"key": "ciclo",
|
|
492
|
-
"props": {
|
|
493
|
-
"title": "PASSO",
|
|
494
|
-
"unit": "",
|
|
495
|
-
"decimals": 0,
|
|
496
|
-
"min": "",
|
|
497
|
-
"max": "",
|
|
498
|
-
"lo": "",
|
|
499
|
-
"hi": "",
|
|
500
|
-
"priority": "2"
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
],
|
|
504
|
-
"outputs": 1,
|
|
505
|
-
"x": 460,
|
|
506
|
-
"y": 120,
|
|
507
|
-
"wires": [
|
|
508
|
-
[
|
|
509
|
-
"env_cmd"
|
|
510
|
-
]
|
|
511
|
-
]
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
"id": "env_cmd",
|
|
515
|
-
"type": "function",
|
|
516
|
-
"z": "ex_env",
|
|
517
|
-
"name": "aplica comando",
|
|
518
|
-
"func": "// Comandos da tela. Aqui só mudam a simulação; no seu flow ligue a saída no CLP.\nconst cmd = flow.get('cmd') || { rodando: 1 }\nconst on = Number(msg.payload) ? 1 : 0\nif (msg.topic === 'cmd/partir' && on) cmd.rodando = 1\nif (msg.topic === 'cmd/parar' && on) cmd.rodando = 0\nflow.set('cmd', cmd)\nreturn msg",
|
|
519
|
-
"outputs": 1,
|
|
520
|
-
"x": 640,
|
|
521
|
-
"y": 120,
|
|
522
|
-
"wires": [
|
|
523
|
-
[
|
|
524
|
-
"env_dbg"
|
|
525
|
-
]
|
|
526
|
-
]
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
"id": "env_dbg",
|
|
530
|
-
"type": "debug",
|
|
531
|
-
"z": "ex_env",
|
|
532
|
-
"name": "comandos",
|
|
533
|
-
"active": true,
|
|
534
|
-
"tosidebar": true,
|
|
535
|
-
"console": false,
|
|
536
|
-
"tostatus": true,
|
|
537
|
-
"complete": "true",
|
|
538
|
-
"targetType": "full",
|
|
539
|
-
"statusVal": "topic",
|
|
540
|
-
"statusType": "auto",
|
|
541
|
-
"x": 830,
|
|
542
|
-
"y": 120,
|
|
543
|
-
"wires": []
|
|
544
|
-
}
|
|
545
|
-
]
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "ex_env",
|
|
4
|
+
"type": "tab",
|
|
5
|
+
"label": "IHM envase",
|
|
6
|
+
"info": "Linha de envase simulada, montada com as montagens prontas (Estação de envase e Cilindro com válvula). Abra /dashboard/envase."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"id": "hx_base",
|
|
10
|
+
"type": "ui-base",
|
|
11
|
+
"name": "Dashboard",
|
|
12
|
+
"path": "/dashboard",
|
|
13
|
+
"includeClientData": true,
|
|
14
|
+
"acceptsClientConfig": [
|
|
15
|
+
"ui-notification",
|
|
16
|
+
"ui-control"
|
|
17
|
+
],
|
|
18
|
+
"showPathInSidebar": false,
|
|
19
|
+
"navigationStyle": "none",
|
|
20
|
+
"titleBarStyle": "hidden"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "hx_theme",
|
|
24
|
+
"type": "ui-theme",
|
|
25
|
+
"name": "Default",
|
|
26
|
+
"colors": {
|
|
27
|
+
"surface": "#ffffff",
|
|
28
|
+
"primary": "#0094CE",
|
|
29
|
+
"bgPage": "#eeeeee",
|
|
30
|
+
"groupBg": "#ffffff",
|
|
31
|
+
"groupOutline": "#cccccc"
|
|
32
|
+
},
|
|
33
|
+
"sizes": {
|
|
34
|
+
"pagePadding": "12px",
|
|
35
|
+
"groupGap": "12px",
|
|
36
|
+
"groupBorderRadius": "4px",
|
|
37
|
+
"widgetGap": "12px"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "pg_env",
|
|
42
|
+
"type": "ui-page",
|
|
43
|
+
"name": "Envase",
|
|
44
|
+
"ui": "hx_base",
|
|
45
|
+
"path": "/envase",
|
|
46
|
+
"icon": "bottle-wine",
|
|
47
|
+
"layout": "grid",
|
|
48
|
+
"theme": "hx_theme",
|
|
49
|
+
"breakpoints": [
|
|
50
|
+
{
|
|
51
|
+
"name": "Default",
|
|
52
|
+
"px": "0",
|
|
53
|
+
"cols": "3"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "Desktop",
|
|
57
|
+
"px": "1024",
|
|
58
|
+
"cols": "12"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"order": 5,
|
|
62
|
+
"visible": "true",
|
|
63
|
+
"disabled": "false"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "env_cmt",
|
|
67
|
+
"type": "comment",
|
|
68
|
+
"z": "ex_env",
|
|
69
|
+
"name": "Ciclo simulado a cada 1 s: a garrafa chega, o cilindro trava, enche, tampa, rotula e solta.",
|
|
70
|
+
"info": "",
|
|
71
|
+
"x": 360,
|
|
72
|
+
"y": 40,
|
|
73
|
+
"wires": []
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "env_tick",
|
|
77
|
+
"type": "inject",
|
|
78
|
+
"z": "ex_env",
|
|
79
|
+
"name": "a cada 1 s",
|
|
80
|
+
"props": [],
|
|
81
|
+
"repeat": "1",
|
|
82
|
+
"once": true,
|
|
83
|
+
"onceDelay": "1",
|
|
84
|
+
"topic": "",
|
|
85
|
+
"x": 120,
|
|
86
|
+
"y": 120,
|
|
87
|
+
"wires": [
|
|
88
|
+
[
|
|
89
|
+
"env_sim"
|
|
90
|
+
]
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "env_sim",
|
|
95
|
+
"type": "function",
|
|
96
|
+
"z": "ex_env",
|
|
97
|
+
"name": "simula envase",
|
|
98
|
+
"func": "// Ciclo de envase simulado. Troque pelos valores do seu CLP.\n// passos: 0 esteira leva a garrafa, 1 trava (cilindro) e enche, 2 tampa, 3 rotula, 4 solta\nconst s = flow.get('sim') || { passo: 0, t: 0, nivel: 0, garrafas: 0 }\nconst cmd = flow.get('cmd') || { rodando: 1 }\nif (cmd.rodando) {\n s.t++\n if (s.passo === 0 && s.t >= 3) { s.passo = 1; s.t = 0; s.nivel = 0 }\n else if (s.passo === 1) { s.nivel = Math.min(100, s.nivel + 20); if (s.nivel >= 100) { s.passo = 2; s.t = 0 } }\n else if (s.passo === 2 && s.t >= 2) { s.passo = 3; s.t = 0 }\n else if (s.passo === 3 && s.t >= 2) { s.passo = 4; s.t = 0; s.garrafas++ }\n else if (s.passo === 4 && s.t >= 1) { s.passo = 0; s.t = 0; s.nivel = 0 }\n}\nflow.set('sim', s)\nconst trava = s.passo >= 1 && s.passo <= 3\nmsg.payload = {\n rodando: cmd.rodando, ciclo: s.passo,\n 'E1.esteira': cmd.rodando && (s.passo === 0 || s.passo === 4) ? 1 : 0,\n 'E1.garrafa': s.passo >= 1 && s.passo <= 3 ? 1 : 0,\n 'E1.nivel': s.nivel, 'E1.tampa': s.passo === 2 ? 1 : 0, 'E1.rotulo': s.passo === 3 ? 1 : 0,\n 'E1.garrafas': s.garrafas, 'E1.falha': cmd.rodando ? 0 : 1,\n 'Y1.solenoide': trava ? 1 : 0, 'Y1.avancado': trava ? 1 : 0, 'Y1.recuado': trava ? 0 : 1\n}\nreturn msg",
|
|
99
|
+
"outputs": 1,
|
|
100
|
+
"x": 290,
|
|
101
|
+
"y": 120,
|
|
102
|
+
"wires": [
|
|
103
|
+
[
|
|
104
|
+
"env_canvas"
|
|
105
|
+
]
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "env_canvas",
|
|
110
|
+
"type": "ui-hmi-canvas",
|
|
111
|
+
"z": "ex_env",
|
|
112
|
+
"name": "Envase",
|
|
113
|
+
"scope": "page",
|
|
114
|
+
"page": "pg_env",
|
|
115
|
+
"order": 1,
|
|
116
|
+
"viewW": 1280,
|
|
117
|
+
"viewH": 720,
|
|
118
|
+
"theme": "isa101",
|
|
119
|
+
"fit": "screen",
|
|
120
|
+
"background": "theme",
|
|
121
|
+
"offlineAfter": 10,
|
|
122
|
+
"locale": "pt-BR",
|
|
123
|
+
"alarms": "on",
|
|
124
|
+
"alarmsOut": "no",
|
|
125
|
+
"symbols": [
|
|
126
|
+
{
|
|
127
|
+
"id": "env1",
|
|
128
|
+
"type": "text",
|
|
129
|
+
"x": 60,
|
|
130
|
+
"y": 90,
|
|
131
|
+
"w": 640,
|
|
132
|
+
"h": 24,
|
|
133
|
+
"rot": 0,
|
|
134
|
+
"key": "",
|
|
135
|
+
"props": {
|
|
136
|
+
"text": "Envase E1",
|
|
137
|
+
"size": 14,
|
|
138
|
+
"align": "middle",
|
|
139
|
+
"bold": "yes",
|
|
140
|
+
"tone": "normal",
|
|
141
|
+
"unit": "",
|
|
142
|
+
"decimals": ""
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "env2",
|
|
147
|
+
"type": "frame",
|
|
148
|
+
"x": 60,
|
|
149
|
+
"y": 120,
|
|
150
|
+
"w": 260,
|
|
151
|
+
"h": 170,
|
|
152
|
+
"rot": 0,
|
|
153
|
+
"key": "E1.nivel",
|
|
154
|
+
"props": {
|
|
155
|
+
"shape": "filler",
|
|
156
|
+
"tone": "equip",
|
|
157
|
+
"label": "Enchedora",
|
|
158
|
+
"level": "no",
|
|
159
|
+
"min": 0,
|
|
160
|
+
"max": 100,
|
|
161
|
+
"levelColor": "level",
|
|
162
|
+
"showValue": "no",
|
|
163
|
+
"unit": "%",
|
|
164
|
+
"decimals": 0,
|
|
165
|
+
"motion": "value"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"id": "env3",
|
|
170
|
+
"type": "frame",
|
|
171
|
+
"x": 340,
|
|
172
|
+
"y": 150,
|
|
173
|
+
"w": 150,
|
|
174
|
+
"h": 140,
|
|
175
|
+
"rot": 0,
|
|
176
|
+
"key": "E1.tampa",
|
|
177
|
+
"props": {
|
|
178
|
+
"shape": "capper",
|
|
179
|
+
"tone": "equip",
|
|
180
|
+
"label": "Tampadora",
|
|
181
|
+
"level": "no",
|
|
182
|
+
"min": 0,
|
|
183
|
+
"max": 100,
|
|
184
|
+
"levelColor": "level",
|
|
185
|
+
"showValue": "no",
|
|
186
|
+
"unit": "%",
|
|
187
|
+
"decimals": 0
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "env4",
|
|
192
|
+
"type": "frame",
|
|
193
|
+
"x": 510,
|
|
194
|
+
"y": 150,
|
|
195
|
+
"w": 180,
|
|
196
|
+
"h": 140,
|
|
197
|
+
"rot": 0,
|
|
198
|
+
"key": "E1.rotulo",
|
|
199
|
+
"props": {
|
|
200
|
+
"shape": "labeler",
|
|
201
|
+
"tone": "equip",
|
|
202
|
+
"label": "Rotuladora",
|
|
203
|
+
"level": "no",
|
|
204
|
+
"min": 0,
|
|
205
|
+
"max": 100,
|
|
206
|
+
"levelColor": "level",
|
|
207
|
+
"showValue": "no",
|
|
208
|
+
"unit": "%",
|
|
209
|
+
"decimals": 0
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"id": "env5",
|
|
214
|
+
"type": "conveyor",
|
|
215
|
+
"x": 60,
|
|
216
|
+
"y": 320,
|
|
217
|
+
"w": 640,
|
|
218
|
+
"h": 40,
|
|
219
|
+
"rot": 0,
|
|
220
|
+
"key": "E1.esteira",
|
|
221
|
+
"props": {
|
|
222
|
+
"label": "",
|
|
223
|
+
"onWhen": "nonzero",
|
|
224
|
+
"threshold": 0,
|
|
225
|
+
"dir": "fwd",
|
|
226
|
+
"faultKey": "",
|
|
227
|
+
"priority": "1"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"id": "env6",
|
|
232
|
+
"type": "frame",
|
|
233
|
+
"x": 280,
|
|
234
|
+
"y": 370,
|
|
235
|
+
"w": 160,
|
|
236
|
+
"h": 30,
|
|
237
|
+
"rot": 0,
|
|
238
|
+
"key": "E1.garrafa",
|
|
239
|
+
"props": {
|
|
240
|
+
"shape": "photoEye",
|
|
241
|
+
"tone": "equip",
|
|
242
|
+
"label": "",
|
|
243
|
+
"level": "no",
|
|
244
|
+
"min": 0,
|
|
245
|
+
"max": 100,
|
|
246
|
+
"levelColor": "level",
|
|
247
|
+
"showValue": "no",
|
|
248
|
+
"unit": "%",
|
|
249
|
+
"decimals": 0
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"id": "env7",
|
|
254
|
+
"type": "frame",
|
|
255
|
+
"x": 660,
|
|
256
|
+
"y": 110,
|
|
257
|
+
"w": 36,
|
|
258
|
+
"h": 70,
|
|
259
|
+
"rot": 0,
|
|
260
|
+
"key": "E1.falha",
|
|
261
|
+
"props": {
|
|
262
|
+
"shape": "beacon",
|
|
263
|
+
"tone": "equip",
|
|
264
|
+
"label": "",
|
|
265
|
+
"level": "no",
|
|
266
|
+
"min": 0,
|
|
267
|
+
"max": 100,
|
|
268
|
+
"levelColor": "level",
|
|
269
|
+
"showValue": "no",
|
|
270
|
+
"unit": "%",
|
|
271
|
+
"decimals": 0
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"id": "env8",
|
|
276
|
+
"type": "tag",
|
|
277
|
+
"x": 60,
|
|
278
|
+
"y": 420,
|
|
279
|
+
"w": 140,
|
|
280
|
+
"h": 60,
|
|
281
|
+
"rot": 0,
|
|
282
|
+
"key": "E1.nivel",
|
|
283
|
+
"props": {
|
|
284
|
+
"title": "NÍVEL",
|
|
285
|
+
"unit": "%",
|
|
286
|
+
"decimals": 0,
|
|
287
|
+
"min": "",
|
|
288
|
+
"max": "",
|
|
289
|
+
"lo": "",
|
|
290
|
+
"hi": "",
|
|
291
|
+
"priority": "2"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"id": "env9",
|
|
296
|
+
"type": "counter",
|
|
297
|
+
"x": 220,
|
|
298
|
+
"y": 420,
|
|
299
|
+
"w": 160,
|
|
300
|
+
"h": 60,
|
|
301
|
+
"rot": 0,
|
|
302
|
+
"key": "E1.garrafas",
|
|
303
|
+
"props": {
|
|
304
|
+
"kind": "count",
|
|
305
|
+
"title": "GARRAFAS",
|
|
306
|
+
"src": "h",
|
|
307
|
+
"decimals": 0,
|
|
308
|
+
"unit": "",
|
|
309
|
+
"label": ""
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"id": "cil10",
|
|
314
|
+
"type": "text",
|
|
315
|
+
"x": 780,
|
|
316
|
+
"y": 90,
|
|
317
|
+
"w": 260,
|
|
318
|
+
"h": 24,
|
|
319
|
+
"rot": 0,
|
|
320
|
+
"key": "",
|
|
321
|
+
"props": {
|
|
322
|
+
"text": "Y1",
|
|
323
|
+
"size": 14,
|
|
324
|
+
"align": "middle",
|
|
325
|
+
"bold": "yes",
|
|
326
|
+
"tone": "normal",
|
|
327
|
+
"unit": "",
|
|
328
|
+
"decimals": ""
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"id": "cil11",
|
|
333
|
+
"type": "frame",
|
|
334
|
+
"x": 790,
|
|
335
|
+
"y": 120,
|
|
336
|
+
"w": 50,
|
|
337
|
+
"h": 70,
|
|
338
|
+
"rot": 0,
|
|
339
|
+
"key": "Y1.recuado",
|
|
340
|
+
"props": {
|
|
341
|
+
"shape": "limitSwitch",
|
|
342
|
+
"tone": "equip",
|
|
343
|
+
"label": "Recuado",
|
|
344
|
+
"level": "no",
|
|
345
|
+
"min": 0,
|
|
346
|
+
"max": 100,
|
|
347
|
+
"levelColor": "level",
|
|
348
|
+
"showValue": "no",
|
|
349
|
+
"unit": "%",
|
|
350
|
+
"decimals": 0
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"id": "cil12",
|
|
355
|
+
"type": "frame",
|
|
356
|
+
"x": 980,
|
|
357
|
+
"y": 120,
|
|
358
|
+
"w": 50,
|
|
359
|
+
"h": 70,
|
|
360
|
+
"rot": 0,
|
|
361
|
+
"key": "Y1.avancado",
|
|
362
|
+
"props": {
|
|
363
|
+
"shape": "limitSwitch",
|
|
364
|
+
"tone": "equip",
|
|
365
|
+
"label": "Avançado",
|
|
366
|
+
"level": "no",
|
|
367
|
+
"min": 0,
|
|
368
|
+
"max": 100,
|
|
369
|
+
"levelColor": "level",
|
|
370
|
+
"showValue": "no",
|
|
371
|
+
"unit": "%",
|
|
372
|
+
"decimals": 0
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"id": "cil13",
|
|
377
|
+
"type": "frame",
|
|
378
|
+
"x": 780,
|
|
379
|
+
"y": 220,
|
|
380
|
+
"w": 260,
|
|
381
|
+
"h": 70,
|
|
382
|
+
"rot": 0,
|
|
383
|
+
"key": "Y1.avancado",
|
|
384
|
+
"props": {
|
|
385
|
+
"shape": "pneuCyl",
|
|
386
|
+
"tone": "equip",
|
|
387
|
+
"label": "",
|
|
388
|
+
"level": "no",
|
|
389
|
+
"min": 0,
|
|
390
|
+
"max": 100,
|
|
391
|
+
"levelColor": "level",
|
|
392
|
+
"showValue": "no",
|
|
393
|
+
"unit": "%",
|
|
394
|
+
"decimals": 0,
|
|
395
|
+
"motion": "onoff"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"id": "cil14",
|
|
400
|
+
"type": "frame",
|
|
401
|
+
"x": 820,
|
|
402
|
+
"y": 320,
|
|
403
|
+
"w": 180,
|
|
404
|
+
"h": 80,
|
|
405
|
+
"rot": 0,
|
|
406
|
+
"key": "Y1.solenoide",
|
|
407
|
+
"props": {
|
|
408
|
+
"shape": "valve52",
|
|
409
|
+
"tone": "equip",
|
|
410
|
+
"label": "Válvula Y1",
|
|
411
|
+
"level": "no",
|
|
412
|
+
"min": 0,
|
|
413
|
+
"max": 100,
|
|
414
|
+
"levelColor": "level",
|
|
415
|
+
"showValue": "no",
|
|
416
|
+
"unit": "%",
|
|
417
|
+
"decimals": 0
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"id": "ui15",
|
|
422
|
+
"type": "text",
|
|
423
|
+
"x": 60,
|
|
424
|
+
"y": 30,
|
|
425
|
+
"w": 600,
|
|
426
|
+
"h": 36,
|
|
427
|
+
"rot": 0,
|
|
428
|
+
"key": "",
|
|
429
|
+
"props": {
|
|
430
|
+
"text": "Linha de envase (simulada)",
|
|
431
|
+
"size": 24,
|
|
432
|
+
"align": "start",
|
|
433
|
+
"bold": "yes",
|
|
434
|
+
"tone": "normal",
|
|
435
|
+
"unit": "",
|
|
436
|
+
"decimals": ""
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"id": "ui16",
|
|
441
|
+
"type": "button",
|
|
442
|
+
"x": 780,
|
|
443
|
+
"y": 440,
|
|
444
|
+
"w": 130,
|
|
445
|
+
"h": 50,
|
|
446
|
+
"rot": 0,
|
|
447
|
+
"key": "rodando",
|
|
448
|
+
"props": {
|
|
449
|
+
"text": "PARTIR",
|
|
450
|
+
"textOn": "",
|
|
451
|
+
"onWhen": "nonzero",
|
|
452
|
+
"threshold": 0
|
|
453
|
+
},
|
|
454
|
+
"action": {
|
|
455
|
+
"mode": "pulse",
|
|
456
|
+
"value": "",
|
|
457
|
+
"topic": "cmd/partir",
|
|
458
|
+
"confirm": "no"
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"id": "ui17",
|
|
463
|
+
"type": "button",
|
|
464
|
+
"x": 930,
|
|
465
|
+
"y": 440,
|
|
466
|
+
"w": 130,
|
|
467
|
+
"h": 50,
|
|
468
|
+
"rot": 0,
|
|
469
|
+
"key": "",
|
|
470
|
+
"props": {
|
|
471
|
+
"text": "PARAR",
|
|
472
|
+
"textOn": "",
|
|
473
|
+
"onWhen": "nonzero",
|
|
474
|
+
"threshold": 0
|
|
475
|
+
},
|
|
476
|
+
"action": {
|
|
477
|
+
"mode": "pulse",
|
|
478
|
+
"value": "",
|
|
479
|
+
"topic": "cmd/parar",
|
|
480
|
+
"confirm": "no"
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"id": "ui18",
|
|
485
|
+
"type": "tag",
|
|
486
|
+
"x": 780,
|
|
487
|
+
"y": 520,
|
|
488
|
+
"w": 130,
|
|
489
|
+
"h": 60,
|
|
490
|
+
"rot": 0,
|
|
491
|
+
"key": "ciclo",
|
|
492
|
+
"props": {
|
|
493
|
+
"title": "PASSO",
|
|
494
|
+
"unit": "",
|
|
495
|
+
"decimals": 0,
|
|
496
|
+
"min": "",
|
|
497
|
+
"max": "",
|
|
498
|
+
"lo": "",
|
|
499
|
+
"hi": "",
|
|
500
|
+
"priority": "2"
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
],
|
|
504
|
+
"outputs": 1,
|
|
505
|
+
"x": 460,
|
|
506
|
+
"y": 120,
|
|
507
|
+
"wires": [
|
|
508
|
+
[
|
|
509
|
+
"env_cmd"
|
|
510
|
+
]
|
|
511
|
+
]
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"id": "env_cmd",
|
|
515
|
+
"type": "function",
|
|
516
|
+
"z": "ex_env",
|
|
517
|
+
"name": "aplica comando",
|
|
518
|
+
"func": "// Comandos da tela. Aqui só mudam a simulação; no seu flow ligue a saída no CLP.\nconst cmd = flow.get('cmd') || { rodando: 1 }\nconst on = Number(msg.payload) ? 1 : 0\nif (msg.topic === 'cmd/partir' && on) cmd.rodando = 1\nif (msg.topic === 'cmd/parar' && on) cmd.rodando = 0\nflow.set('cmd', cmd)\nreturn msg",
|
|
519
|
+
"outputs": 1,
|
|
520
|
+
"x": 640,
|
|
521
|
+
"y": 120,
|
|
522
|
+
"wires": [
|
|
523
|
+
[
|
|
524
|
+
"env_dbg"
|
|
525
|
+
]
|
|
526
|
+
]
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"id": "env_dbg",
|
|
530
|
+
"type": "debug",
|
|
531
|
+
"z": "ex_env",
|
|
532
|
+
"name": "comandos",
|
|
533
|
+
"active": true,
|
|
534
|
+
"tosidebar": true,
|
|
535
|
+
"console": false,
|
|
536
|
+
"tostatus": true,
|
|
537
|
+
"complete": "true",
|
|
538
|
+
"targetType": "full",
|
|
539
|
+
"statusVal": "topic",
|
|
540
|
+
"statusType": "auto",
|
|
541
|
+
"x": 830,
|
|
542
|
+
"y": 120,
|
|
543
|
+
"wires": []
|
|
544
|
+
}
|
|
545
|
+
]
|