当前位置:   article > 正文

使用node-red通过MQTT传送数据_mqtt.fx 输出json结构

mqtt.fx 输出json结构

要求:

PC通过网线采集S7-200SMART数据,通过PC端部署的node-red,与云服务器部署的node-red通过MQTT通信,并将数据在本地或外网界面显示。

准备:

node.js

阿里云服务器

PC

参考:Node-red学习第8篇--关于function节点的详细介绍_Enl0ve的博客-CSDN博客_function node

JSON对象使用变量作为键名_lihefei_coder的博客-CSDN博客_json 变量

1-阿里云服务器端部署的node-red

  1. [
  2. {
  3. "id": "c86dbba29484c7bc",
  4. "type": "tab",
  5. "label": "MQTTDATA",
  6. "disabled": false,
  7. "info": ""
  8. },
  9. {
  10. "id": "16dc231f756b5cd4",
  11. "type": "comment",
  12. "z": "c86dbba29484c7bc",
  13. "name": "接收运行情况",
  14. "info": "",
  15. "x": 570,
  16. "y": 540,
  17. "wires": []
  18. },
  19. {
  20. "id": "d29fed4a8ed88cab",
  21. "type": "comment",
  22. "z": "c86dbba29484c7bc",
  23. "name": "远程数据下传",
  24. "info": "",
  25. "x": 570,
  26. "y": 400,
  27. "wires": []
  28. },
  29. {
  30. "id": "507781c8ee76c4f7",
  31. "type": "function",
  32. "z": "c86dbba29484c7bc",
  33. "name": "",
  34. "func": "var msg1 = {payload:msg.payload.U_dCpos};\nvar msg2 = {payload:msg.payload.U_dCspd};\nreturn [msg1,msg2];",
  35. "outputs": 2,
  36. "noerr": 0,
  37. "initialize": "",
  38. "finalize": "",
  39. "libs": [],
  40. "x": 870,
  41. "y": 780,
  42. "wires": [
  43. [
  44. "45ddec103b3c0908",
  45. "0425ae561a44dd72"
  46. ],
  47. [
  48. "b1a321e17188aad5"
  49. ]
  50. ]
  51. },
  52. {
  53. "id": "a47efa30939c8969",
  54. "type": "json",
  55. "z": "c86dbba29484c7bc",
  56. "name": "",
  57. "property": "payload",
  58. "action": "obj",
  59. "pretty": false,
  60. "x": 710,
  61. "y": 720,
  62. "wires": [
  63. [
  64. "507781c8ee76c4f7"
  65. ]
  66. ]
  67. },
  68. {
  69. "id": "345847283f4f5b2f",
  70. "type": "mqtt in",
  71. "z": "c86dbba29484c7bc",
  72. "name": "",
  73. "topic": "CYQplc",
  74. "qos": "0",
  75. "datatype": "json",
  76. "broker": "bf5fe1b1f396077f",
  77. "nl": false,
  78. "rap": true,
  79. "rh": 0,
  80. "x": 550,
  81. "y": 720,
  82. "wires": [
  83. [
  84. "a47efa30939c8969"
  85. ]
  86. ]
  87. },
  88. {
  89. "id": "865106b81d4e628c",
  90. "type": "mqtt out",
  91. "z": "c86dbba29484c7bc",
  92. "name": "",
  93. "topic": "YunData",
  94. "qos": "0",
  95. "retain": "",
  96. "respTopic": "",
  97. "contentType": "",
  98. "userProps": "",
  99. "correl": "",
  100. "expiry": "",
  101. "broker": "bf5fe1b1f396077f",
  102. "x": 720,
  103. "y": 460,
  104. "wires": []
  105. },
  106. {
  107. "id": "45ddec103b3c0908",
  108. "type": "ui_text",
  109. "z": "c86dbba29484c7bc",
  110. "group": "abc33c008a0186bd",
  111. "order": 3,
  112. "width": 0,
  113. "height": 0,
  114. "name": "",
  115. "label": "位置1",
  116. "format": "{{msg.payload}}",
  117. "layout": "row-spread",
  118. "className": "",
  119. "x": 1010,
  120. "y": 760,
  121. "wires": []
  122. },
  123. {
  124. "id": "b1a321e17188aad5",
  125. "type": "ui_text",
  126. "z": "c86dbba29484c7bc",
  127. "group": "abc33c008a0186bd",
  128. "order": 2,
  129. "width": 0,
  130. "height": 0,
  131. "name": "",
  132. "label": "速度1",
  133. "format": "{{msg.payload}}",
  134. "layout": "row-spread",
  135. "className": "",
  136. "x": 1010,
  137. "y": 880,
  138. "wires": []
  139. },
  140. {
  141. "id": "0425ae561a44dd72",
  142. "type": "debug",
  143. "z": "c86dbba29484c7bc",
  144. "name": "",
  145. "active": true,
  146. "tosidebar": true,
  147. "console": false,
  148. "tostatus": false,
  149. "complete": "payload",
  150. "targetType": "msg",
  151. "statusVal": "",
  152. "statusType": "auto",
  153. "x": 1110,
  154. "y": 820,
  155. "wires": []
  156. },
  157. {
  158. "id": "bf5fe1b1f396077f",
  159. "type": "mqtt-broker",
  160. "name": "wgj",
  161. "broker": "121.196.179.60",
  162. "port": "61613",
  163. "clientid": "",
  164. "usetls": false,
  165. "protocolVersion": "4",
  166. "keepalive": "60",
  167. "cleansession": true,
  168. "birthTopic": "",
  169. "birthQos": "0",
  170. "birthPayload": "",
  171. "birthMsg": {},
  172. "closeTopic": "",
  173. "closeQos": "0",
  174. "closePayload": "",
  175. "closeMsg": {},
  176. "willTopic": "",
  177. "willQos": "0",
  178. "willPayload": "",
  179. "willMsg": {},
  180. "sessionExpiry": ""
  181. },
  182. {
  183. "id": "abc33c008a0186bd",
  184. "type": "ui_group",
  185. "name": "运行状态",
  186. "tab": "6dd062cb1b09a3af",
  187. "order": 1,
  188. "disp": true,
  189. "width": "6",
  190. "collapse": false,
  191. "className": ""
  192. },
  193. {
  194. "id": "6dd062cb1b09a3af",
  195. "type": "ui_tab",
  196. "name": "调试板",
  197. "icon": "dashboard",
  198. "order": 1,
  199. "disabled": false,
  200. "hidden": false
  201. }
  202. ]

2- PC端部署的NODE-RED

  1. [
  2. {
  3. "id": "8ee22d9371723256",
  4. "type": "tab",
  5. "label": "DAQ",
  6. "disabled": false,
  7. "info": ""
  8. },
  9. {
  10. "id": "e5d12a0e3ab9826c",
  11. "type": "s7 control",
  12. "z": "8ee22d9371723256",
  13. "endpoint": "bea9ddf4f56cfeb2",
  14. "function": "trigger",
  15. "name": "",
  16. "x": 370,
  17. "y": 200,
  18. "wires": [
  19. []
  20. ]
  21. },
  22. {
  23. "id": "a443e97a2c9c3993",
  24. "type": "ui_switch",
  25. "z": "8ee22d9371723256",
  26. "name": "",
  27. "label": "正转",
  28. "tooltip": "",
  29. "group": "4fe48dc8aa7b2968",
  30. "order": 1,
  31. "width": 0,
  32. "height": 0,
  33. "passthru": true,
  34. "decouple": "false",
  35. "topic": "topic",
  36. "topicType": "msg",
  37. "style": "",
  38. "onvalue": "true",
  39. "onvalueType": "bool",
  40. "onicon": "",
  41. "oncolor": "",
  42. "offvalue": "false",
  43. "offvalueType": "bool",
  44. "officon": "",
  45. "offcolor": "",
  46. "animate": false,
  47. "className": "",
  48. "x": 330,
  49. "y": 520,
  50. "wires": [
  51. [
  52. "8cc61f1c7c44a1c4"
  53. ]
  54. ]
  55. },
  56. {
  57. "id": "8cc61f1c7c44a1c4",
  58. "type": "s7 out",
  59. "z": "8ee22d9371723256",
  60. "endpoint": "bea9ddf4f56cfeb2",
  61. "variable": "U_bJogP",
  62. "name": "",
  63. "x": 500,
  64. "y": 520,
  65. "wires": []
  66. },
  67. {
  68. "id": "0b4738a5a6c94e87",
  69. "type": "ui_switch",
  70. "z": "8ee22d9371723256",
  71. "name": "",
  72. "label": "反转",
  73. "tooltip": "",
  74. "group": "4fe48dc8aa7b2968",
  75. "order": 2,
  76. "width": 0,
  77. "height": 0,
  78. "passthru": true,
  79. "decouple": "false",
  80. "topic": "topic",
  81. "topicType": "msg",
  82. "style": "",
  83. "onvalue": "true",
  84. "onvalueType": "bool",
  85. "onicon": "",
  86. "oncolor": "",
  87. "offvalue": "false",
  88. "offvalueType": "bool",
  89. "officon": "",
  90. "offcolor": "",
  91. "animate": false,
  92. "className": "",
  93. "x": 330,
  94. "y": 560,
  95. "wires": [
  96. [
  97. "4b2296b1539f27ba"
  98. ]
  99. ]
  100. },
  101. {
  102. "id": "4b2296b1539f27ba",
  103. "type": "s7 out",
  104. "z": "8ee22d9371723256",
  105. "endpoint": "bea9ddf4f56cfeb2",
  106. "variable": "U_bJogN",
  107. "name": "",
  108. "x": 500,
  109. "y": 560,
  110. "wires": []
  111. },
  112. {
  113. "id": "ab2d6e52d06b2357",
  114. "type": "s7 out",
  115. "z": "8ee22d9371723256",
  116. "endpoint": "bea9ddf4f56cfeb2",
  117. "variable": "U_dGpos",
  118. "name": "",
  119. "x": 500,
  120. "y": 720,
  121. "wires": []
  122. },
  123. {
  124. "id": "35a55fdaf9ec917a",
  125. "type": "s7 out",
  126. "z": "8ee22d9371723256",
  127. "endpoint": "bea9ddf4f56cfeb2",
  128. "variable": "U_dGspd",
  129. "name": "",
  130. "x": 500,
  131. "y": 760,
  132. "wires": []
  133. },
  134. {
  135. "id": "518287261f915fcc",
  136. "type": "comment",
  137. "z": "8ee22d9371723256",
  138. "name": "点动",
  139. "info": "",
  140. "x": 330,
  141. "y": 480,
  142. "wires": []
  143. },
  144. {
  145. "id": "9a3bf0bee2ba6cc1",
  146. "type": "comment",
  147. "z": "8ee22d9371723256",
  148. "name": "定位",
  149. "info": "",
  150. "x": 330,
  151. "y": 680,
  152. "wires": []
  153. },
  154. {
  155. "id": "bcb2e21202d51493",
  156. "type": "trigger",
  157. "z": "8ee22d9371723256",
  158. "name": "",
  159. "op1": "",
  160. "op2": "false",
  161. "op1type": "pay",
  162. "op2type": "bool",
  163. "duration": "100",
  164. "extend": false,
  165. "overrideDelay": false,
  166. "units": "ms",
  167. "reset": "",
  168. "bytopic": "all",
  169. "topic": "topic",
  170. "outputs": 1,
  171. "x": 490,
  172. "y": 800,
  173. "wires": [
  174. [
  175. "8b29a9ee3d120e4a"
  176. ]
  177. ]
  178. },
  179. {
  180. "id": "c0651f0965ba2668",
  181. "type": "ui_button",
  182. "z": "8ee22d9371723256",
  183. "name": "",
  184. "group": "625ff6e7b6bfef8b",
  185. "order": 3,
  186. "width": 0,
  187. "height": 0,
  188. "passthru": false,
  189. "label": "定位触发",
  190. "tooltip": "",
  191. "color": "",
  192. "bgcolor": "",
  193. "className": "",
  194. "icon": "",
  195. "payload": "",
  196. "payloadType": "date",
  197. "topic": "topic",
  198. "topicType": "msg",
  199. "x": 340,
  200. "y": 800,
  201. "wires": [
  202. [
  203. "bcb2e21202d51493"
  204. ]
  205. ]
  206. },
  207. {
  208. "id": "8b29a9ee3d120e4a",
  209. "type": "s7 out",
  210. "z": "8ee22d9371723256",
  211. "endpoint": "bea9ddf4f56cfeb2",
  212. "variable": "U_bGoTrig",
  213. "name": "",
  214. "x": 650,
  215. "y": 800,
  216. "wires": []
  217. },
  218. {
  219. "id": "52dba1183273a58c",
  220. "type": "ui_text_input",
  221. "z": "8ee22d9371723256",
  222. "name": "",
  223. "label": "定位量",
  224. "tooltip": "",
  225. "group": "625ff6e7b6bfef8b",
  226. "order": 2,
  227. "width": 0,
  228. "height": 0,
  229. "passthru": true,
  230. "mode": "number",
  231. "delay": 300,
  232. "topic": "topic",
  233. "sendOnBlur": true,
  234. "className": "",
  235. "topicType": "msg",
  236. "x": 330,
  237. "y": 720,
  238. "wires": [
  239. [
  240. "ab2d6e52d06b2357"
  241. ]
  242. ]
  243. },
  244. {
  245. "id": "5a0e428e8281793f",
  246. "type": "ui_text_input",
  247. "z": "8ee22d9371723256",
  248. "name": "",
  249. "label": "速度",
  250. "tooltip": "",
  251. "group": "625ff6e7b6bfef8b",
  252. "order": 1,
  253. "width": 0,
  254. "height": 0,
  255. "passthru": true,
  256. "mode": "number",
  257. "delay": 300,
  258. "topic": "topic",
  259. "sendOnBlur": true,
  260. "className": "",
  261. "topicType": "msg",
  262. "x": 330,
  263. "y": 760,
  264. "wires": [
  265. [
  266. "35a55fdaf9ec917a"
  267. ]
  268. ]
  269. },
  270. {
  271. "id": "711bfb7f6645d998",
  272. "type": "ui_text",
  273. "z": "8ee22d9371723256",
  274. "group": "abc33c008a0186bd",
  275. "order": 3,
  276. "width": 0,
  277. "height": 0,
  278. "name": "",
  279. "label": "位置",
  280. "format": "{{msg.payload}}",
  281. "layout": "row-spread",
  282. "className": "",
  283. "x": 470,
  284. "y": 360,
  285. "wires": []
  286. },
  287. {
  288. "id": "749625cde1564895",
  289. "type": "ui_text",
  290. "z": "8ee22d9371723256",
  291. "group": "abc33c008a0186bd",
  292. "order": 2,
  293. "width": 0,
  294. "height": 0,
  295. "name": "",
  296. "label": "速度",
  297. "format": "{{msg.payload}}",
  298. "layout": "row-spread",
  299. "className": "",
  300. "x": 470,
  301. "y": 400,
  302. "wires": []
  303. },
  304. {
  305. "id": "896b6744e91bbf7e",
  306. "type": "comment",
  307. "z": "8ee22d9371723256",
  308. "name": "运动状态",
  309. "info": "",
  310. "x": 340,
  311. "y": 280,
  312. "wires": []
  313. },
  314. {
  315. "id": "411fdb23bca345f8",
  316. "type": "s7 in",
  317. "z": "8ee22d9371723256",
  318. "endpoint": "bea9ddf4f56cfeb2",
  319. "mode": "single",
  320. "variable": "U_dCpos",
  321. "diff": true,
  322. "name": "Cpos",
  323. "x": 330,
  324. "y": 360,
  325. "wires": [
  326. [
  327. "711bfb7f6645d998"
  328. ]
  329. ]
  330. },
  331. {
  332. "id": "17a5a37a3b402ca3",
  333. "type": "s7 in",
  334. "z": "8ee22d9371723256",
  335. "endpoint": "bea9ddf4f56cfeb2",
  336. "mode": "single",
  337. "variable": "U_dCspd",
  338. "diff": true,
  339. "name": "Cspd",
  340. "x": 330,
  341. "y": 400,
  342. "wires": [
  343. [
  344. "749625cde1564895"
  345. ]
  346. ]
  347. },
  348. {
  349. "id": "13522b11251c74eb",
  350. "type": "s7 in",
  351. "z": "8ee22d9371723256",
  352. "endpoint": "bea9ddf4f56cfeb2",
  353. "mode": "single",
  354. "variable": "U_bCrunning",
  355. "diff": true,
  356. "name": "noRun",
  357. "x": 330,
  358. "y": 320,
  359. "wires": [
  360. [
  361. "bdc32f6ccff802bb"
  362. ]
  363. ]
  364. },
  365. {
  366. "id": "f27e6a8eb9277043",
  367. "type": "ui_button",
  368. "z": "8ee22d9371723256",
  369. "name": "",
  370. "group": "4fe48dc8aa7b2968",
  371. "order": 3,
  372. "width": 0,
  373. "height": 0,
  374. "passthru": false,
  375. "label": "位置标零",
  376. "tooltip": "",
  377. "color": "",
  378. "bgcolor": "",
  379. "className": "",
  380. "icon": "",
  381. "payload": "",
  382. "payloadType": "date",
  383. "topic": "topic",
  384. "topicType": "msg",
  385. "x": 340,
  386. "y": 600,
  387. "wires": [
  388. [
  389. "31a3c24c41ccb1cb"
  390. ]
  391. ]
  392. },
  393. {
  394. "id": "31a3c24c41ccb1cb",
  395. "type": "trigger",
  396. "z": "8ee22d9371723256",
  397. "name": "",
  398. "op1": "",
  399. "op2": "false",
  400. "op1type": "pay",
  401. "op2type": "bool",
  402. "duration": "100",
  403. "extend": false,
  404. "overrideDelay": false,
  405. "units": "ms",
  406. "reset": "",
  407. "bytopic": "all",
  408. "topic": "topic",
  409. "outputs": 1,
  410. "x": 490,
  411. "y": 600,
  412. "wires": [
  413. [
  414. "5a221991d211ae69"
  415. ]
  416. ]
  417. },
  418. {
  419. "id": "bdc32f6ccff802bb",
  420. "type": "ui_led",
  421. "z": "8ee22d9371723256",
  422. "order": 1,
  423. "group": "abc33c008a0186bd",
  424. "width": 0,
  425. "height": 0,
  426. "label": "状态",
  427. "labelPlacement": "right",
  428. "labelAlignment": "left",
  429. "colorForValue": [
  430. {
  431. "color": "#f8f7f7",
  432. "value": "false",
  433. "valueType": "bool"
  434. },
  435. {
  436. "color": "#008000",
  437. "value": "true",
  438. "valueType": "bool"
  439. }
  440. ],
  441. "allowColorForValueInMessage": false,
  442. "shape": "circle",
  443. "showGlow": true,
  444. "name": "",
  445. "x": 470,
  446. "y": 320,
  447. "wires": []
  448. },
  449. {
  450. "id": "5a221991d211ae69",
  451. "type": "s7 out",
  452. "z": "8ee22d9371723256",
  453. "endpoint": "bea9ddf4f56cfeb2",
  454. "variable": "U_bClsPos",
  455. "name": "",
  456. "x": 650,
  457. "y": 600,
  458. "wires": []
  459. },
  460. {
  461. "id": "6805b1b652c577ff",
  462. "type": "ui_spacer",
  463. "z": "8ee22d9371723256",
  464. "name": "spacer",
  465. "group": "bcdd867b59a3eac4",
  466. "order": 2,
  467. "width": 1,
  468. "height": 1
  469. },
  470. {
  471. "id": "fca3849530564772",
  472. "type": "ui_spacer",
  473. "z": "8ee22d9371723256",
  474. "name": "spacer",
  475. "group": "83791b88bc9ededf",
  476. "order": 5,
  477. "width": 1,
  478. "height": 1
  479. },
  480. {
  481. "id": "bea9ddf4f56cfeb2",
  482. "type": "s7 endpoint",
  483. "transport": "iso-on-tcp",
  484. "address": "192.168.0.20",
  485. "port": "102",
  486. "rack": "0",
  487. "slot": "2",
  488. "localtsaphi": "10",
  489. "localtsaplo": "02",
  490. "remotetsaphi": "03",
  491. "remotetsaplo": "01",
  492. "connmode": "tsap",
  493. "adapter": "",
  494. "busaddr": "2",
  495. "cycletime": "500",
  496. "timeout": "1500",
  497. "name": "ST20",
  498. "vartable": [
  499. {
  500. "addr": "I0.0",
  501. "name": "I00"
  502. },
  503. {
  504. "addr": "I0.1",
  505. "name": "I01"
  506. },
  507. {
  508. "addr": "I0.2",
  509. "name": "I02"
  510. },
  511. {
  512. "addr": "I0.3",
  513. "name": "I03"
  514. },
  515. {
  516. "addr": "I0.4",
  517. "name": "I04"
  518. },
  519. {
  520. "addr": "I0.5",
  521. "name": "I05"
  522. },
  523. {
  524. "addr": "I0.6",
  525. "name": "I06"
  526. },
  527. {
  528. "addr": "I0.7",
  529. "name": "I07"
  530. },
  531. {
  532. "addr": "I1.0",
  533. "name": "I10"
  534. },
  535. {
  536. "addr": "I1.1",
  537. "name": "I11"
  538. },
  539. {
  540. "addr": "I1.2",
  541. "name": "I12"
  542. },
  543. {
  544. "addr": "I1.3",
  545. "name": "I13"
  546. },
  547. {
  548. "addr": "Q0.0",
  549. "name": "Q00"
  550. },
  551. {
  552. "addr": "Q0.1",
  553. "name": "Q01"
  554. },
  555. {
  556. "addr": "Q0.2",
  557. "name": "Q02"
  558. },
  559. {
  560. "addr": "Q0.3",
  561. "name": "Q03"
  562. },
  563. {
  564. "addr": "Q0.4",
  565. "name": "Q04"
  566. },
  567. {
  568. "addr": "Q0.5",
  569. "name": "Q05"
  570. },
  571. {
  572. "addr": "Q0.6",
  573. "name": "Q06"
  574. },
  575. {
  576. "addr": "Q0.7",
  577. "name": "Q07"
  578. },
  579. {
  580. "addr": "DB1,X1200.0",
  581. "name": "U_bCrunning"
  582. },
  583. {
  584. "addr": "DB1,X1200.1",
  585. "name": "U_bJogP"
  586. },
  587. {
  588. "addr": "DB1,X1200.2",
  589. "name": "U_bJogN"
  590. },
  591. {
  592. "addr": "DB1,X1200.3",
  593. "name": "U_bClsPos"
  594. },
  595. {
  596. "addr": "DB1,X1200.4",
  597. "name": "U_bGoTrig"
  598. },
  599. {
  600. "addr": "DB1,DI1300",
  601. "name": "U_dCpos"
  602. },
  603. {
  604. "addr": "DB1,DI1304",
  605. "name": "U_dCspd"
  606. },
  607. {
  608. "addr": "DB1,DI1308",
  609. "name": "U_dMspd"
  610. },
  611. {
  612. "addr": "DB1,DI1312",
  613. "name": "U_dGspd"
  614. },
  615. {
  616. "addr": "DB1,DI1316",
  617. "name": "U_dGpos"
  618. }
  619. ]
  620. },
  621. {
  622. "id": "4fe48dc8aa7b2968",
  623. "type": "ui_group",
  624. "name": "点动操作",
  625. "tab": "6dd062cb1b09a3af",
  626. "order": 3,
  627. "disp": true,
  628. "width": "6",
  629. "collapse": false,
  630. "className": ""
  631. },
  632. {
  633. "id": "625ff6e7b6bfef8b",
  634. "type": "ui_group",
  635. "name": "定位操作",
  636. "tab": "6dd062cb1b09a3af",
  637. "order": 5,
  638. "disp": true,
  639. "width": "6",
  640. "collapse": false,
  641. "className": ""
  642. },
  643. {
  644. "id": "abc33c008a0186bd",
  645. "type": "ui_group",
  646. "name": "运行状态",
  647. "tab": "6dd062cb1b09a3af",
  648. "order": 1,
  649. "disp": true,
  650. "width": "6",
  651. "collapse": false,
  652. "className": ""
  653. },
  654. {
  655. "id": "bcdd867b59a3eac4",
  656. "type": "ui_group",
  657. "name": "I",
  658. "tab": "6dd062cb1b09a3af",
  659. "order": 2,
  660. "disp": false,
  661. "width": 2,
  662. "collapse": false,
  663. "className": ""
  664. },
  665. {
  666. "id": "83791b88bc9ededf",
  667. "type": "ui_group",
  668. "name": "II",
  669. "tab": "6dd062cb1b09a3af",
  670. "order": 4,
  671. "disp": false,
  672. "width": 2,
  673. "collapse": false,
  674. "className": ""
  675. },
  676. {
  677. "id": "6dd062cb1b09a3af",
  678. "type": "ui_tab",
  679. "name": "调试板",
  680. "icon": "dashboard",
  681. "disabled": false,
  682. "hidden": false
  683. }
  684. ]

  1. [
  2. {
  3. "id": "98a4d6e78c673268",
  4. "type": "tab",
  5. "label": "DataMQTT",
  6. "disabled": false,
  7. "info": ""
  8. },
  9. {
  10. "id": "9a920a29961d0d56",
  11. "type": "mqtt out",
  12. "z": "98a4d6e78c673268",
  13. "name": "",
  14. "topic": "CYQplc",
  15. "qos": "0",
  16. "retain": "",
  17. "respTopic": "",
  18. "contentType": "",
  19. "userProps": "",
  20. "correl": "",
  21. "expiry": "",
  22. "broker": "e47e3b729550a5cc",
  23. "x": 560,
  24. "y": 560,
  25. "wires": []
  26. },
  27. {
  28. "id": "0d7a9216295512b6",
  29. "type": "comment",
  30. "z": "98a4d6e78c673268",
  31. "name": "运行情况上传",
  32. "info": "",
  33. "x": 390,
  34. "y": 520,
  35. "wires": []
  36. },
  37. {
  38. "id": "708a0dc7eaa9e784",
  39. "type": "s7 in",
  40. "z": "98a4d6e78c673268",
  41. "endpoint": "bea9ddf4f56cfeb2",
  42. "mode": "all",
  43. "variable": "U_bCrunning",
  44. "diff": true,
  45. "name": "Data_to_Yun",
  46. "x": 390,
  47. "y": 560,
  48. "wires": [
  49. [
  50. "9a920a29961d0d56"
  51. ]
  52. ]
  53. },
  54. {
  55. "id": "80c418a72e186ea4",
  56. "type": "mqtt in",
  57. "z": "98a4d6e78c673268",
  58. "name": "",
  59. "topic": "YunData",
  60. "qos": "0",
  61. "datatype": "json",
  62. "broker": "e47e3b729550a5cc",
  63. "nl": false,
  64. "rap": true,
  65. "rh": 0,
  66. "x": 380,
  67. "y": 680,
  68. "wires": [
  69. [
  70. "0a64c16a1581aa83"
  71. ]
  72. ]
  73. },
  74. {
  75. "id": "ce1f04d2f6b341e1",
  76. "type": "comment",
  77. "z": "98a4d6e78c673268",
  78. "name": "远程数据下传",
  79. "info": "",
  80. "x": 390,
  81. "y": 640,
  82. "wires": []
  83. },
  84. {
  85. "id": "c23a9be21666b22b",
  86. "type": "function",
  87. "z": "98a4d6e78c673268",
  88. "name": "",
  89. "func": "\nreturn msg;",
  90. "outputs": 1,
  91. "noerr": 0,
  92. "initialize": "",
  93. "finalize": "",
  94. "libs": [],
  95. "x": 690,
  96. "y": 680,
  97. "wires": [
  98. []
  99. ]
  100. },
  101. {
  102. "id": "0a64c16a1581aa83",
  103. "type": "json",
  104. "z": "98a4d6e78c673268",
  105. "name": "",
  106. "property": "payload",
  107. "action": "",
  108. "pretty": false,
  109. "x": 550,
  110. "y": 680,
  111. "wires": [
  112. [
  113. "c23a9be21666b22b"
  114. ]
  115. ]
  116. },
  117. {
  118. "id": "e47e3b729550a5cc",
  119. "type": "mqtt-broker",
  120. "name": "wgj",
  121. "broker": "121.196.179.60",
  122. "port": "61613",
  123. "clientid": "",
  124. "usetls": false,
  125. "protocolVersion": "4",
  126. "keepalive": "60",
  127. "cleansession": true,
  128. "birthTopic": "",
  129. "birthQos": "0",
  130. "birthPayload": "",
  131. "birthMsg": {},
  132. "closeTopic": "",
  133. "closeQos": "0",
  134. "closePayload": "",
  135. "closeMsg": {},
  136. "willTopic": "",
  137. "willQos": "0",
  138. "willPayload": "",
  139. "willMsg": {},
  140. "sessionExpiry": ""
  141. },
  142. {
  143. "id": "bea9ddf4f56cfeb2",
  144. "type": "s7 endpoint",
  145. "transport": "iso-on-tcp",
  146. "address": "192.168.0.20",
  147. "port": "102",
  148. "rack": "0",
  149. "slot": "2",
  150. "localtsaphi": "10",
  151. "localtsaplo": "02",
  152. "remotetsaphi": "03",
  153. "remotetsaplo": "01",
  154. "connmode": "tsap",
  155. "adapter": "",
  156. "busaddr": "2",
  157. "cycletime": "500",
  158. "timeout": "1500",
  159. "name": "ST20",
  160. "vartable": [
  161. {
  162. "addr": "I0.0",
  163. "name": "I00"
  164. },
  165. {
  166. "addr": "I0.1",
  167. "name": "I01"
  168. },
  169. {
  170. "addr": "I0.2",
  171. "name": "I02"
  172. },
  173. {
  174. "addr": "I0.3",
  175. "name": "I03"
  176. },
  177. {
  178. "addr": "I0.4",
  179. "name": "I04"
  180. },
  181. {
  182. "addr": "I0.5",
  183. "name": "I05"
  184. },
  185. {
  186. "addr": "I0.6",
  187. "name": "I06"
  188. },
  189. {
  190. "addr": "I0.7",
  191. "name": "I07"
  192. },
  193. {
  194. "addr": "I1.0",
  195. "name": "I10"
  196. },
  197. {
  198. "addr": "I1.1",
  199. "name": "I11"
  200. },
  201. {
  202. "addr": "I1.2",
  203. "name": "I12"
  204. },
  205. {
  206. "addr": "I1.3",
  207. "name": "I13"
  208. },
  209. {
  210. "addr": "Q0.0",
  211. "name": "Q00"
  212. },
  213. {
  214. "addr": "Q0.1",
  215. "name": "Q01"
  216. },
  217. {
  218. "addr": "Q0.2",
  219. "name": "Q02"
  220. },
  221. {
  222. "addr": "Q0.3",
  223. "name": "Q03"
  224. },
  225. {
  226. "addr": "Q0.4",
  227. "name": "Q04"
  228. },
  229. {
  230. "addr": "Q0.5",
  231. "name": "Q05"
  232. },
  233. {
  234. "addr": "Q0.6",
  235. "name": "Q06"
  236. },
  237. {
  238. "addr": "Q0.7",
  239. "name": "Q07"
  240. },
  241. {
  242. "addr": "DB1,X1200.0",
  243. "name": "U_bCrunning"
  244. },
  245. {
  246. "addr": "DB1,X1200.1",
  247. "name": "U_bJogP"
  248. },
  249. {
  250. "addr": "DB1,X1200.2",
  251. "name": "U_bJogN"
  252. },
  253. {
  254. "addr": "DB1,X1200.3",
  255. "name": "U_bClsPos"
  256. },
  257. {
  258. "addr": "DB1,X1200.4",
  259. "name": "U_bGoTrig"
  260. },
  261. {
  262. "addr": "DB1,DI1300",
  263. "name": "U_dCpos"
  264. },
  265. {
  266. "addr": "DB1,DI1304",
  267. "name": "U_dCspd"
  268. },
  269. {
  270. "addr": "DB1,DI1308",
  271. "name": "U_dMspd"
  272. },
  273. {
  274. "addr": "DB1,DI1312",
  275. "name": "U_dGspd"
  276. },
  277. {
  278. "addr": "DB1,DI1316",
  279. "name": "U_dGpos"
  280. }
  281. ]
  282. }
  283. ]

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号