@machinemetrics/io-adapter-lib 2.32.0

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.
Files changed (264) hide show
  1. package/.circleci/config.yml +141 -0
  2. package/.eslintrc.json +36 -0
  3. package/.gitattributes +12 -0
  4. package/CHANGELOG.md +544 -0
  5. package/README.md +2 -0
  6. package/index.js +17 -0
  7. package/lib/config/adapterConfig.js +535 -0
  8. package/lib/config/common/allowDenyList.js +58 -0
  9. package/lib/config/common/jsonPath.js +44 -0
  10. package/lib/config/common/labjackU3T4Common.js +227 -0
  11. package/lib/config/common/validations.js +142 -0
  12. package/lib/config/configError.js +32 -0
  13. package/lib/config/device/adam-6052Config.js +103 -0
  14. package/lib/config/device/brotherHTTPConfig.js +215 -0
  15. package/lib/config/device/ethernetIPConfig.js +191 -0
  16. package/lib/config/device/ifmIotConfig.js +245 -0
  17. package/lib/config/device/jsonHttpConfig.js +76 -0
  18. package/lib/config/device/labjackT4Config.js +39 -0
  19. package/lib/config/device/labjackT7Config.js +192 -0
  20. package/lib/config/device/labjackU3Config.js +32 -0
  21. package/lib/config/device/modbusTcpConfig.js +336 -0
  22. package/lib/config/device/mqttBaseConfig.js +70 -0
  23. package/lib/config/device/mqttConfig.js +113 -0
  24. package/lib/config/device/mqttLincolnConfig.js +62 -0
  25. package/lib/config/device/mtconnectAdapterConfig.js +42 -0
  26. package/lib/config/device/mtconnectBaseConfig.js +136 -0
  27. package/lib/config/device/mtconnectConfig.js +52 -0
  28. package/lib/config/device/mtconnectHaasConfig.js +15 -0
  29. package/lib/config/device/nullConfig.js +81 -0
  30. package/lib/config/device/opcuaConfig.js +205 -0
  31. package/lib/config/device/pcccConfig.js +88 -0
  32. package/lib/config/engineConfigV1.js +382 -0
  33. package/lib/config/engineConfigV2.js +106 -0
  34. package/lib/config/generator/counterGenConfig.js +15 -0
  35. package/lib/config/generator/cronGenConfig.js +33 -0
  36. package/lib/config/generator/dateTimeGenConfig.js +33 -0
  37. package/lib/config/index.js +339 -0
  38. package/lib/config/transformConfigUtil.js +296 -0
  39. package/lib/engine/dataOutput.js +357 -0
  40. package/lib/engine/deviceOutput.js +186 -0
  41. package/lib/engine/engineV1.js +480 -0
  42. package/lib/engine/engineV2.js +719 -0
  43. package/lib/engine/index.js +34 -0
  44. package/lib/engine/transformBuilderV1.js +111 -0
  45. package/lib/engine/transformBuilderV2.js +74 -0
  46. package/lib/expressionService.js +330 -0
  47. package/lib/math.js +142 -0
  48. package/lib/transform/accumulate.js +98 -0
  49. package/lib/transform/average.js +56 -0
  50. package/lib/transform/debounce.js +152 -0
  51. package/lib/transform/downsample.js +69 -0
  52. package/lib/transform/edge.js +34 -0
  53. package/lib/transform/expression.js +91 -0
  54. package/lib/transform/fallingEdge.js +70 -0
  55. package/lib/transform/fromBuffer.js +89 -0
  56. package/lib/transform/hash.js +41 -0
  57. package/lib/transform/ignoreValue.js +118 -0
  58. package/lib/transform/index.js +93 -0
  59. package/lib/transform/invert.js +25 -0
  60. package/lib/transform/latch.js +99 -0
  61. package/lib/transform/latchValue.js +115 -0
  62. package/lib/transform/logicAnd.js +67 -0
  63. package/lib/transform/logicOr.js +67 -0
  64. package/lib/transform/map.js +115 -0
  65. package/lib/transform/max.js +57 -0
  66. package/lib/transform/maxLength.js +39 -0
  67. package/lib/transform/min.js +57 -0
  68. package/lib/transform/minDelta.js +40 -0
  69. package/lib/transform/offDelay.js +89 -0
  70. package/lib/transform/onDelay.js +89 -0
  71. package/lib/transform/patternEscape.js +24 -0
  72. package/lib/transform/patternMatch.js +194 -0
  73. package/lib/transform/patternReplace.js +170 -0
  74. package/lib/transform/patternTest.js +85 -0
  75. package/lib/transform/rateOfChange.js +56 -0
  76. package/lib/transform/reject.js +115 -0
  77. package/lib/transform/resample.js +96 -0
  78. package/lib/transform/risingEdge.js +90 -0
  79. package/lib/transform/risingEdgeCounter.js +179 -0
  80. package/lib/transform/sampleInterval.js +12 -0
  81. package/lib/transform/source.js +116 -0
  82. package/lib/transform/state.js +201 -0
  83. package/lib/transform/threshold.js +52 -0
  84. package/lib/transform/toBuffer.js +159 -0
  85. package/lib/transform/toggle.js +118 -0
  86. package/lib/transform/transformState.js +193 -0
  87. package/lib/transform/trim.js +27 -0
  88. package/lib/transform/util/chainSource.js +96 -0
  89. package/lib/transform/util/ringBuffer.js +34 -0
  90. package/lib/transform/valueChange.js +34 -0
  91. package/lib/transform/valueDecrease.js +38 -0
  92. package/lib/transform/valueIncrease.js +38 -0
  93. package/lib/transform/valueIncreaseDiff.js +66 -0
  94. package/lib/transform/whenUnavailable.js +73 -0
  95. package/lib/transform/windowCount.js +86 -0
  96. package/lib/util/fileUtil.js +44 -0
  97. package/package.json +38 -0
  98. package/test/.eslintrc.json +15 -0
  99. package/test/chainedTransform.test.js +88 -0
  100. package/test/conditions.test.js +118 -0
  101. package/test/config/ab-pccc.test.js +41 -0
  102. package/test/config/adam-6052.test.js +16 -0
  103. package/test/config/adapter.test.js +109 -0
  104. package/test/config/brother-http.test.js +19 -0
  105. package/test/config/ethernet-ip.test.js +19 -0
  106. package/test/config/ifm-iot.test.js +20 -0
  107. package/test/config/json-http.test.js +47 -0
  108. package/test/config/labjack-t4.test.js +78 -0
  109. package/test/config/labjack-t7.test.js +18 -0
  110. package/test/config/labjack-u3.test.js +17 -0
  111. package/test/config/modbusTcp.test.js +87 -0
  112. package/test/config/mqtt.test.js +19 -0
  113. package/test/config/mqttLincoln.test.js +29 -0
  114. package/test/config/mtconnect.test.js +63 -0
  115. package/test/config/mtconnectAdapter.test.js +124 -0
  116. package/test/config/mtconnectHaas.test.js +15 -0
  117. package/test/config/null.test.js +16 -0
  118. package/test/config/opcua.test.js +97 -0
  119. package/test/config-tests.js +102 -0
  120. package/test/configFiles/conditions.yml +37 -0
  121. package/test/configFiles/data-items-legacy.yml +24 -0
  122. package/test/configFiles/data-items-shorthand.yml +14 -0
  123. package/test/configFiles/data-items.yml +12 -0
  124. package/test/configFiles/device/ab-pccc-default.yml +3 -0
  125. package/test/configFiles/device/ab-pccc-full.yml +13 -0
  126. package/test/configFiles/device/adam-6052-default.yml +2 -0
  127. package/test/configFiles/device/brother-http-default.yml +3 -0
  128. package/test/configFiles/device/ethernet-ip-default.yml +2 -0
  129. package/test/configFiles/device/ifm-iot-default.yml +2 -0
  130. package/test/configFiles/device/json-http-bad-prop.yml +13 -0
  131. package/test/configFiles/device/json-http-bad-prop2.yml +13 -0
  132. package/test/configFiles/device/json-http-default.yml +3 -0
  133. package/test/configFiles/device/json-http-std.yml +13 -0
  134. package/test/configFiles/device/labjack-t4-condition-exprs.yaml +46 -0
  135. package/test/configFiles/device/labjack-t4-default.yml +3 -0
  136. package/test/configFiles/device/labjack-t4-pins-alt.yaml +41 -0
  137. package/test/configFiles/device/labjack-t4-pins.yaml +40 -0
  138. package/test/configFiles/device/labjack-t4-v1.yaml +29 -0
  139. package/test/configFiles/device/labjack-t7-default.yml +2 -0
  140. package/test/configFiles/device/labjack-u3-default.yml +2 -0
  141. package/test/configFiles/device/modbus-partial.yml +4 -0
  142. package/test/configFiles/device/modbus-std-extended.yaml +23 -0
  143. package/test/configFiles/device/modbus-std.yaml +34 -0
  144. package/test/configFiles/device/modbus-tcp-default.yml +3 -0
  145. package/test/configFiles/device/mqtt-default.yml +2 -0
  146. package/test/configFiles/device/mqtt-lincoln-default.yml +3 -0
  147. package/test/configFiles/device/mqtt-lincoln-full.yml +7 -0
  148. package/test/configFiles/device/mtconnect-adapter-default.yml +3 -0
  149. package/test/configFiles/device/mtconnect-adapter-keys.yaml +18 -0
  150. package/test/configFiles/device/mtconnect-complex-keys.yaml +17 -0
  151. package/test/configFiles/device/mtconnect-default.yml +3 -0
  152. package/test/configFiles/device/mtconnect-duplicate-allow-keys.yaml +10 -0
  153. package/test/configFiles/device/mtconnect-duplicate-declare-keys.yaml +8 -0
  154. package/test/configFiles/device/mtconnect-duplicate-deny-keys.yaml +10 -0
  155. package/test/configFiles/device/mtconnect-haas-default.yml +3 -0
  156. package/test/configFiles/device/mtconnect-std.yaml +18 -0
  157. package/test/configFiles/device/null-default.yml +1 -0
  158. package/test/configFiles/device/opcua-bad-tag.yml +18 -0
  159. package/test/configFiles/device/opcua-bad-tag2.yml +18 -0
  160. package/test/configFiles/device/opcua-default.yml +3 -0
  161. package/test/configFiles/device/opcua-std.yml +18 -0
  162. package/test/configFiles/dump-test.yml +11 -0
  163. package/test/configFiles/expressionCond.yml +46 -0
  164. package/test/configFiles/min-config-t4.yaml +4 -0
  165. package/test/configFiles/min-config-u3.yaml +3 -0
  166. package/test/configFiles/missing-device.yaml +2 -0
  167. package/test/configFiles/parse-error1.yml +9 -0
  168. package/test/configFiles/parse-error2.yml +9 -0
  169. package/test/configFiles/repro/buffer-convert-repro.yml +15 -0
  170. package/test/configFiles/repro/chained-delay-timing-repro.yml +13 -0
  171. package/test/configFiles/repro/count-init-repro.yml +45 -0
  172. package/test/configFiles/repro/cycle-break-repro.yml +44 -0
  173. package/test/configFiles/repro/debounce-repro.yml +46 -0
  174. package/test/configFiles/repro/diff-count-repro.yml +34 -0
  175. package/test/configFiles/repro/engine-hang-repro.yml +9 -0
  176. package/test/configFiles/repro/latch-apm-repro.yml +26 -0
  177. package/test/configFiles/repro/lockout-count-repro.yml +33 -0
  178. package/test/configFiles/repro/program-extract-repro.yml +38 -0
  179. package/test/configFiles/repro/state-latch-repro.yml +47 -0
  180. package/test/configFiles/repro/ternary-repro.yml +26 -0
  181. package/test/configFiles/transform/debounce.yml +12 -0
  182. package/test/configFiles/transform/expression.yml +34 -0
  183. package/test/configFiles/transform/ignoreValue.yml +31 -0
  184. package/test/configFiles/transform/latch.yml +11 -0
  185. package/test/configFiles/transform/latchValue.yml +31 -0
  186. package/test/configFiles/transform/logicAnd.yml +14 -0
  187. package/test/configFiles/transform/logicOr.yml +14 -0
  188. package/test/configFiles/transform/map.yml +19 -0
  189. package/test/configFiles/transform/maxLength.yml +13 -0
  190. package/test/configFiles/transform/offDelay.yml +12 -0
  191. package/test/configFiles/transform/pattern-escape.yml +10 -0
  192. package/test/configFiles/transform/pattern-match.yml +57 -0
  193. package/test/configFiles/transform/pattern-replace.yml +34 -0
  194. package/test/configFiles/transform/pattern-test.yml +25 -0
  195. package/test/configFiles/transform/reject.yml +24 -0
  196. package/test/configFiles/transform/risingEdgeCounter.yml +36 -0
  197. package/test/configFiles/transform/source.yml +20 -0
  198. package/test/configFiles/transform/state.yml +56 -0
  199. package/test/configFiles/transform/toggle.yml +19 -0
  200. package/test/configFiles/transform/whenUnavailable.yml +19 -0
  201. package/test/dataFiles/noisy-pulse.txt +11330 -0
  202. package/test/dataItems.test.js +140 -0
  203. package/test/engine-v1-tests.js +418 -0
  204. package/test/engine-v2-tests.js +284 -0
  205. package/test/expression-tests.js +171 -0
  206. package/test/expressionService.test.js +154 -0
  207. package/test/expressionServiceCondition.test.js +130 -0
  208. package/test/repro/buffer-convert-repro.test.js +38 -0
  209. package/test/repro/chained-delay-timing-repro.test.js +34 -0
  210. package/test/repro/count-init-repro.test.js +46 -0
  211. package/test/repro/cylce-break-repro.test.js +57 -0
  212. package/test/repro/debounce-repro.test.js +65 -0
  213. package/test/repro/diff-count-repro.test.js +79 -0
  214. package/test/repro/engine-hang-repro.test.js +38 -0
  215. package/test/repro/latch-apm-repro.test.js +119 -0
  216. package/test/repro/lockout-count-repro.test.js +84 -0
  217. package/test/repro/program-extract-repro.test.js +40 -0
  218. package/test/repro/state-latch-repro.test.js +63 -0
  219. package/test/repro/ternary-repro.test.js +43 -0
  220. package/test/transform/accumulte.test.js +18 -0
  221. package/test/transform/average.test.js +22 -0
  222. package/test/transform/debounce.test.js +70 -0
  223. package/test/transform/downsample.test.js +30 -0
  224. package/test/transform/edge.test.js +27 -0
  225. package/test/transform/expression.test.js +189 -0
  226. package/test/transform/fallingEdge.test.js +59 -0
  227. package/test/transform/fromBuffer.test.js +60 -0
  228. package/test/transform/hash.test.js +34 -0
  229. package/test/transform/ignoreValue.test.js +123 -0
  230. package/test/transform/invert.test.js +26 -0
  231. package/test/transform/latch.test.js +33 -0
  232. package/test/transform/latchValue.test.js +126 -0
  233. package/test/transform/logicAnd.test.js +80 -0
  234. package/test/transform/logicOr.test.js +80 -0
  235. package/test/transform/map.test.js +42 -0
  236. package/test/transform/max.test.js +30 -0
  237. package/test/transform/maxLength.test.js +32 -0
  238. package/test/transform/min.test.js +30 -0
  239. package/test/transform/minDelta.test.js +14 -0
  240. package/test/transform/offDelay.test.js +123 -0
  241. package/test/transform/onDelay.test.js +105 -0
  242. package/test/transform/patternEscape.test.js +18 -0
  243. package/test/transform/patternMatch.test.js +177 -0
  244. package/test/transform/patternReplace.test.js +95 -0
  245. package/test/transform/patternTest.test.js +105 -0
  246. package/test/transform/rateOfChange.test.js +34 -0
  247. package/test/transform/reject.test.js +56 -0
  248. package/test/transform/resample.test.js +193 -0
  249. package/test/transform/risingEdge.test.js +60 -0
  250. package/test/transform/risingEdgeCounter.test.js +227 -0
  251. package/test/transform/sampleInterval.test.js +22 -0
  252. package/test/transform/source.test.js +137 -0
  253. package/test/transform/state.test.js +248 -0
  254. package/test/transform/threshold.test.js +78 -0
  255. package/test/transform/toBuffer.test.js +60 -0
  256. package/test/transform/toggle.test.js +92 -0
  257. package/test/transform/trim.test.js +30 -0
  258. package/test/transform/valueChange.test.js +14 -0
  259. package/test/transform/valueDecrease.test.js +32 -0
  260. package/test/transform/valueIncrease.test.js +32 -0
  261. package/test/transform/valueIncreaseDiff.test.js +32 -0
  262. package/test/transform/whenUnavailable.test.js +93 -0
  263. package/test/transform/windowCount.test.js +26 -0
  264. package/test/util/testUtils.js +405 -0
@@ -0,0 +1,29 @@
1
+ version: 1
2
+ device: labjack-t4
3
+ host: 192.168.1.100
4
+ mtconnect-port: 8001
5
+ pins:
6
+ 0: analog
7
+ 4: digital
8
+ input:
9
+ analog:
10
+ var1:
11
+ pin: 0
12
+ var2:
13
+ pin: 1
14
+ digital:
15
+ var3:
16
+ pin: 5
17
+ v-threshold: 3
18
+ counter:
19
+ var4:
20
+ pin: 2
21
+ v-threshold: 3
22
+ suspend: var2 > 1
23
+ data-items:
24
+ data1:
25
+ value: var1
26
+ data2:
27
+ value:
28
+ ON: var2 and var4 > 4
29
+ OFF: true
@@ -0,0 +1,2 @@
1
+ device: labjack-t7
2
+ host: 192.168.1.100
@@ -0,0 +1,2 @@
1
+ device: labjack-u3
2
+ host: 192.168.1.100
@@ -0,0 +1,4 @@
1
+ versin: 2
2
+ device: modbus-tcp
3
+ host: localhost
4
+ port: 502
@@ -0,0 +1,23 @@
1
+ versin: 2
2
+ device: modbus-tcp
3
+ host: localhost
4
+ port: 502
5
+ byte-order: little
6
+ word-order: little
7
+ coils:
8
+ button: 100002
9
+ switch: 100003
10
+ flipper: 5
11
+ gizmo: 000007
12
+ registers:
13
+ temp:
14
+ address: 400005
15
+ type: float32
16
+ hitemp:
17
+ function: 3 # TODO NOT HONORED FOR ADDR
18
+ address: 400007
19
+ type: uint32
20
+ program:
21
+ address: 300003
22
+ type: string
23
+ size: 20
@@ -0,0 +1,34 @@
1
+ versin: 2
2
+ device: modbus-tcp
3
+ host: localhost
4
+ port: 502
5
+ byte-order: little
6
+ word-order: little
7
+ address-space: mixed
8
+ coils:
9
+ button: 10002
10
+ switch: 10003
11
+ flipper: 5
12
+ registers:
13
+ temp:
14
+ address: 40005
15
+ type: float32
16
+ hitemp:
17
+ function: 3 # TODO NOT HONORED FOR ADDR
18
+ address: 40007
19
+ type: uint32
20
+ program:
21
+ address: 30003
22
+ type: string
23
+ size: 20
24
+ data-items:
25
+ running:
26
+ value: switch
27
+ program1:
28
+ value: program
29
+ conditions:
30
+ system:
31
+ - code: c01
32
+ message: High temp
33
+ value:
34
+ FAULT: hitemp > 100
@@ -0,0 +1,3 @@
1
+ version: 2
2
+ device: modbus-tcp
3
+ host: localhost
@@ -0,0 +1,2 @@
1
+ device: mqtt
2
+ endpoint: mqtt://localhost
@@ -0,0 +1,3 @@
1
+ version: 2
2
+ device: mqtt-lincoln
3
+ endpoint: mqtt://localhost
@@ -0,0 +1,7 @@
1
+ version: 2
2
+ device: mqtt-lincoln
3
+ endpoint: mqtt://localhost
4
+ serial: 6413920132840067
5
+ telemetry-rate: 0.1
6
+ username: lincoln_internal
7
+ password: abc123
@@ -0,0 +1,3 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: machine.local
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: localhost:8001
4
+ declare-keys:
5
+ - key1
6
+ - key12
7
+ allow-keys:
8
+ - system
9
+ - block*
10
+ - dim*x*
11
+ - /[xyz]pos\d*/
12
+ - /[xyz]pos\d*/i
13
+ deny-keys:
14
+ - system
15
+ - block*
16
+ - dim*x*
17
+ - /[xyz]pos\d*/
18
+ - /[xyz]pos\d*/i
@@ -0,0 +1,17 @@
1
+ version: 2
2
+ device: mtconnect
3
+ endpoint: localhost:5000
4
+ declare-keys:
5
+ - key1
6
+ - alias2: key2
7
+ - alias3:
8
+ key: key3
9
+ - alias4:
10
+ key: key4
11
+ type: value
12
+ - alias5:
13
+ key: key5
14
+ type: condition
15
+ - key6:
16
+ type: condition
17
+ - aliasdup: key3
@@ -0,0 +1,3 @@
1
+ version: 2
2
+ device: mtconnect
3
+ endpoint: localhost
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: localhost:8001
4
+ declare-keys:
5
+ - key1
6
+ allow-keys:
7
+ - system
8
+ - block*
9
+ - system
10
+ - dim*x*
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: localhost:8001
4
+ declare-keys:
5
+ - key1
6
+ - key2
7
+ - key1
8
+ - key3
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: localhost:8001
4
+ declare-keys:
5
+ - key1
6
+ deny-keys:
7
+ - system
8
+ - block*
9
+ - system
10
+ - dim*x*
@@ -0,0 +1,3 @@
1
+ version: 2
2
+ device: mtconnect-haas
3
+ endpoint: localhost
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ device: mtconnect
3
+ endpoint: localhost:5000
4
+ declare-keys:
5
+ - key1
6
+ - key12
7
+ allow-keys:
8
+ - system
9
+ - block*
10
+ - dim*x*
11
+ - /[xyz]pos\d*/
12
+ - /[xyz]pos\d*/i
13
+ deny-keys:
14
+ - system
15
+ - block*
16
+ - dim*x*
17
+ - /[xyz]pos\d*/
18
+ - /[xyz]pos\d*/i
@@ -0,0 +1 @@
1
+ device: local
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ device: opc-ua
3
+ endpoint: opc.tcp://opcuademo.sterfive.com:26543
4
+ mtconnect-port: 8001
5
+ tags:
6
+ fan-speed:
7
+ path ns=1;s=FanSpeed
8
+ pump-speed:
9
+ path: ns=1;s=PumpSpeed
10
+ some-date:
11
+ path: ns=1;s=SomeDate
12
+ pressure:
13
+ path: ns=1;s=Pressure
14
+ data-items:
15
+ fan_speed:
16
+ value: fan-speed
17
+ pump_speed:
18
+ value: pump-speed
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ device: opc-ua
3
+ endpoint: opc.tcp://opcuademo.sterfive.com:26543
4
+ mtconnect-port: 8001
5
+ tags:
6
+ fan-speed:
7
+ path2: ns=1;s=FanSpeed
8
+ pump-speed:
9
+ path: ns=1;s=PumpSpeed
10
+ some-date:
11
+ path: ns=1;s=SomeDate
12
+ pressure:
13
+ path: ns=1;s=Pressure
14
+ data-items:
15
+ fan_speed:
16
+ value: fan-speed
17
+ pump_speed:
18
+ value: pump-speed
@@ -0,0 +1,3 @@
1
+ version: 2
2
+ device: opc-ua
3
+ endpoint: opc.tcp://localhost:4840
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ device: opc-ua
3
+ endpoint: opc.tcp://opcuademo.sterfive.com:26543
4
+ mtconnect-port: 8001
5
+ tags:
6
+ fan-speed:
7
+ path: ns=1;s=FanSpeed
8
+ pump-speed:
9
+ path: ns=1;s=PumpSpeed
10
+ some-date:
11
+ path: ns=1;s=SomeDate
12
+ pressure:
13
+ path: ns=1;s=Pressure
14
+ data-items:
15
+ fan_speed:
16
+ value: fan-speed
17
+ pump_speed:
18
+ value: pump-speed
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ # registers
3
+ registers:
4
+ test: # test register
5
+ address: 30001
6
+ type: uint16
7
+
8
+ # output
9
+ data-items:
10
+ test:
11
+ value: "test"
@@ -0,0 +1,46 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: localhost:8001
4
+ declare-keys:
5
+ - data1
6
+ - data2
7
+ - cond1:
8
+ type: condition
9
+ - cond2:
10
+ type: condition
11
+ - cond_test:
12
+ type: condition
13
+ variables:
14
+ seen1:
15
+ - source: cond1.X01.code != null
16
+ seen2:
17
+ - source: cond1.X02.code != null
18
+ level1:
19
+ - source: cond1.X01.level
20
+ level2:
21
+ - source: cond1.X02.level
22
+ level3:
23
+ - source: cond1['X01'].level
24
+ message1:
25
+ - source: cond1.X01.message
26
+ message2:
27
+ - source: cond1.X02.message
28
+
29
+ # Included for testing config parsing only
30
+ conditions:
31
+ system:
32
+ - code: X01
33
+ message: ${cond1.X01.message}
34
+ value:
35
+ WARNING: cond1.X01.level == 'WARNING'
36
+ FAULT: cond1.X01.level == 'FAULT'
37
+ - code: X02
38
+ message: ${cond1.X02.message} plus ${data1}
39
+ value:
40
+ FAULT: cond1.X02.level == 'WARNING' or cond1.X02.level == 'FAULT'
41
+ system2:
42
+ - code: X01
43
+ message: ${cond_test.X01.message}
44
+ value:
45
+ WARNING: cond_test.X01.level == 'WARNING'
46
+ FAULT: cond_test.X01.level == 'FAULT'
@@ -0,0 +1,4 @@
1
+ version: 1
2
+ device: labjack-t4
3
+ host: 192.168.1.100
4
+ mtconnect-port: 8001
@@ -0,0 +1,3 @@
1
+ version: 1
2
+ device: labjack-u3
3
+ mtconnect-port: 8001
@@ -0,0 +1,2 @@
1
+ version: 1
2
+ mtconnect-port: 8001
@@ -0,0 +1,9 @@
1
+ version: 2
2
+ device: labjack-t4
3
+ host: 192.168.1.100
4
+ mtconnect-port: 8001
5
+ data-items:
6
+ execution: AIN0
7
+ value: AIN0
8
+ partcount:
9
+ value: AIN1
@@ -0,0 +1,9 @@
1
+ version: 2
2
+ device: labjack-t4
3
+ host: 192.168.1.100
4
+ mtconnect-port: 8001
5
+ data-items:
6
+ execution:
7
+ value: AIN0
8
+ partcount:
9
+ value: AIN1
@@ -0,0 +1,15 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: 192.168.1.1
4
+ mtconnect-passthrough: false
5
+ mtconnect-port: 8001
6
+ declare-keys:
7
+ - color1
8
+ - color2
9
+ variables:
10
+ color:
11
+ - source: '[color1, color2]'
12
+ - to-buffer: int16 le
13
+ - from-buffer: string
14
+ data-items:
15
+ - color
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ device: labjack-t4
3
+ host: 192.168.0.108
4
+ variables:
5
+ count-in:
6
+ - source: AIN0
7
+ - threshold: 3
8
+ - rising-edge
9
+ delay:
10
+ - source: count-in
11
+ - off-delay: 2
12
+ - falling-edge
13
+ - off-delay: 2
@@ -0,0 +1,45 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: 192.168.1.1
4
+ mtconnect-passthrough: false
5
+ mtconnect-port: 8001
6
+ allow-keys:
7
+ - avail
8
+ declare-keys:
9
+ - Fovr
10
+ - execution
11
+ - program
12
+ - part_count
13
+ variables:
14
+ f_override_low:
15
+ - source: (99 > Fovr) and (Fovr > 0) and (not in-warmup) and (execution == 'ACTIVE')
16
+ - debounce: 20
17
+ f_override_high:
18
+ - source: (Fovr > 100) and (not in-warmup) and (execution == 'ACTIVE')
19
+ - debounce: 20
20
+ in-warmup:
21
+ - source: program
22
+ - pattern-test: 1999|9991|7771|2999|9992|7772|3999|9993|7773
23
+ modified-part-count:
24
+ - source: part_count
25
+ - value-increase
26
+ - and: not in-warmup
27
+ - count
28
+ data-items:
29
+ PartCount-modified:
30
+ value: modified-part-count
31
+ PartCount_orig:
32
+ value: part_count
33
+ testOverrideLow:
34
+ value: f_override_low
35
+ testOverrideHigh:
36
+ value: f_override_high
37
+ conditions:
38
+ fOvr_low:
39
+ message: Feed Rate Override below 100
40
+ value:
41
+ FAULT: f_override_low
42
+ fOvr_high:
43
+ message: Feed Rate Override above 100
44
+ value:
45
+ FAULT: f_override_high
@@ -0,0 +1,44 @@
1
+ version: 2
2
+ device: labjack-t4
3
+ host: 192.168.0.108
4
+ variables:
5
+ trigger-1:
6
+ - source: AIN0
7
+ - threshold: 5
8
+ - rising-edge
9
+ trigger-2:
10
+ - source: AIN1
11
+ - threshold: 5
12
+ - rising-edge
13
+ latch-1:
14
+ - source: trigger-1
15
+ - and: not latch-2
16
+ - count
17
+ - expression: this > 0
18
+ latch-2:
19
+ - source: trigger-2
20
+ - and: not latch-1
21
+ - count
22
+ - expression: this > 0
23
+ latch-3:
24
+ - source: trigger-1
25
+ - and: not latch-4
26
+ - when-unavailable: false
27
+ - count
28
+ - expression: this > 0
29
+ latch-4:
30
+ - source: trigger-2
31
+ - and: not latch-3
32
+ - when-unavailable: false
33
+ - count
34
+ - expression: this > 0
35
+ count-1:
36
+ - source: trigger-1
37
+ - count
38
+ - expression: this + count-2
39
+ - when-unavailable: 0
40
+ count-2:
41
+ - source: trigger-2
42
+ - count
43
+ - expression: this + count-1
44
+ - when-unavailable: 0
@@ -0,0 +1,46 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: 192.168.1.1
4
+ mtconnect-passthrough: false
5
+ mtconnect-port: 8001
6
+ declare-keys:
7
+ - Fovr
8
+ - execution
9
+ - program
10
+ - part_count
11
+ deny-keys:
12
+ - program
13
+ - part_count
14
+ variables:
15
+ f_override_low:
16
+ - source: (99 > Fovr) and (Fovr > 0) and (not in-warmup) and (execution == 'ACTIVE')
17
+ - debounce: 20
18
+ f_override_high:
19
+ - source: (Fovr > 100) and (not in-warmup) and (execution == 'ACTIVE')
20
+ - debounce: 20
21
+ in-warmup:
22
+ - source: program
23
+ - pattern-test: 1999|9991|7771|2999|9992|7772|3999|9993|7773
24
+ modified-part-count:
25
+ - source: part_count
26
+ - value-increase
27
+ - and: not in-warmup
28
+ - count
29
+ data-items:
30
+ PartCount-modified:
31
+ value: modified-part-count
32
+ PartCount_orig:
33
+ value: part_count
34
+ testOverrideLow:
35
+ value: f_override_low
36
+ testOverrideHigh:
37
+ value: f_override_high
38
+ conditions:
39
+ fOvr_low:
40
+ message: Feed Rate Override below 100
41
+ value:
42
+ FAULT: f_override_low
43
+ fOvr_high:
44
+ message: Feed Rate Override above 100
45
+ value:
46
+ FAULT: f_override_high
@@ -0,0 +1,34 @@
1
+ version: 2
2
+ device: mtconnect-adapter
3
+ endpoint: 192.168.1.1
4
+ mtconnect-passthrough: false
5
+ mtconnect-port: 8001
6
+ declare-keys:
7
+ - mode
8
+ - partcount
9
+ variables:
10
+ modified1:
11
+ - source: partcount
12
+ - value-increase-diff
13
+ - accumulate
14
+ modified2:
15
+ - source: partcount
16
+ - value-increase-diff
17
+ - expression: mode == 'MANUAL' ? 0:this
18
+ - accumulate
19
+ modified3-filter-trigger:
20
+ - source: partcount
21
+ - value-change
22
+ - off-delay: 0.1
23
+ modified3-filter:
24
+ - source: modified3-filter-trigger
25
+ - falling-edge
26
+ - off-delay: 420
27
+ modified3:
28
+ - source: partcount
29
+ - value-increase-diff
30
+ - expression: modified3-filter ? 0:this
31
+ - accumulate
32
+ data-items:
33
+ - modified1
34
+ - modified2
@@ -0,0 +1,9 @@
1
+ version: 2
2
+ device: labjack-t4
3
+ host: 192.168.0.108
4
+ variables:
5
+ exec-raw:
6
+ - source: AIN0
7
+ - resample: 2
8
+ - threshold: 3
9
+ - off-delay: 1
@@ -0,0 +1,26 @@
1
+ skip-validate: true
2
+ version: 2
3
+ mtconnect-passthrough: false
4
+ device: mtconnect-adapter
5
+ endpoint: 192.168.1.1
6
+ mtconnect-port: 8001
7
+ declare-keys:
8
+ - block1
9
+ - execution1
10
+ variables:
11
+ block_pattern:
12
+ - source: block1
13
+ - pattern-match:
14
+ pattern: /^O\d.*(\(.*)/
15
+ group: 1
16
+ program_comment:
17
+ - source: 'execution1 == "READY" ? block_pattern : "UNAVAILABLE"'
18
+ operation_name:
19
+ - source: block_pattern
20
+ - latch: execution1 != "READY"
21
+ - pattern-match:
22
+ pattern: /\(\s*([-\w\d]+)\b/
23
+ group: 1
24
+ data-items:
25
+ - program_comment
26
+ - operation_name
@@ -0,0 +1,33 @@
1
+ version: 2
2
+ device: labjack-t4
3
+ host: 192.168.0.108
4
+ variables:
5
+ sq1-trigger:
6
+ - source: AIN0
7
+ - threshold: 5
8
+ - rising-edge
9
+ sq2-trigger:
10
+ - source: AIN1
11
+ - threshold: 5
12
+ - rising-edge
13
+ sq1-latch:
14
+ - source: sq1-trigger
15
+ - and: not sq2-latch
16
+ - when-unavailable: false
17
+ - count:
18
+ reset: reset-latch
19
+ - expression: this > 0
20
+ sq2-latch:
21
+ - source: sq2-trigger
22
+ - and: not sq1-latch
23
+ - when-unavailable: false
24
+ - count:
25
+ reset: reset-latch
26
+ - expression: this > 0
27
+ reset-latch:
28
+ - source: sq1-trigger or sq2-trigger
29
+ - off-delay: 60
30
+ - falling-edge
31
+ part-count:
32
+ - source: (sq1-trigger and sq1-latch) or (sq2-trigger and sq2-latch)
33
+ - count