@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.
- package/.circleci/config.yml +141 -0
- package/.eslintrc.json +36 -0
- package/.gitattributes +12 -0
- package/CHANGELOG.md +544 -0
- package/README.md +2 -0
- package/index.js +17 -0
- package/lib/config/adapterConfig.js +535 -0
- package/lib/config/common/allowDenyList.js +58 -0
- package/lib/config/common/jsonPath.js +44 -0
- package/lib/config/common/labjackU3T4Common.js +227 -0
- package/lib/config/common/validations.js +142 -0
- package/lib/config/configError.js +32 -0
- package/lib/config/device/adam-6052Config.js +103 -0
- package/lib/config/device/brotherHTTPConfig.js +215 -0
- package/lib/config/device/ethernetIPConfig.js +191 -0
- package/lib/config/device/ifmIotConfig.js +245 -0
- package/lib/config/device/jsonHttpConfig.js +76 -0
- package/lib/config/device/labjackT4Config.js +39 -0
- package/lib/config/device/labjackT7Config.js +192 -0
- package/lib/config/device/labjackU3Config.js +32 -0
- package/lib/config/device/modbusTcpConfig.js +336 -0
- package/lib/config/device/mqttBaseConfig.js +70 -0
- package/lib/config/device/mqttConfig.js +113 -0
- package/lib/config/device/mqttLincolnConfig.js +62 -0
- package/lib/config/device/mtconnectAdapterConfig.js +42 -0
- package/lib/config/device/mtconnectBaseConfig.js +136 -0
- package/lib/config/device/mtconnectConfig.js +52 -0
- package/lib/config/device/mtconnectHaasConfig.js +15 -0
- package/lib/config/device/nullConfig.js +81 -0
- package/lib/config/device/opcuaConfig.js +205 -0
- package/lib/config/device/pcccConfig.js +88 -0
- package/lib/config/engineConfigV1.js +382 -0
- package/lib/config/engineConfigV2.js +106 -0
- package/lib/config/generator/counterGenConfig.js +15 -0
- package/lib/config/generator/cronGenConfig.js +33 -0
- package/lib/config/generator/dateTimeGenConfig.js +33 -0
- package/lib/config/index.js +339 -0
- package/lib/config/transformConfigUtil.js +296 -0
- package/lib/engine/dataOutput.js +357 -0
- package/lib/engine/deviceOutput.js +186 -0
- package/lib/engine/engineV1.js +480 -0
- package/lib/engine/engineV2.js +719 -0
- package/lib/engine/index.js +34 -0
- package/lib/engine/transformBuilderV1.js +111 -0
- package/lib/engine/transformBuilderV2.js +74 -0
- package/lib/expressionService.js +330 -0
- package/lib/math.js +142 -0
- package/lib/transform/accumulate.js +98 -0
- package/lib/transform/average.js +56 -0
- package/lib/transform/debounce.js +152 -0
- package/lib/transform/downsample.js +69 -0
- package/lib/transform/edge.js +34 -0
- package/lib/transform/expression.js +91 -0
- package/lib/transform/fallingEdge.js +70 -0
- package/lib/transform/fromBuffer.js +89 -0
- package/lib/transform/hash.js +41 -0
- package/lib/transform/ignoreValue.js +118 -0
- package/lib/transform/index.js +93 -0
- package/lib/transform/invert.js +25 -0
- package/lib/transform/latch.js +99 -0
- package/lib/transform/latchValue.js +115 -0
- package/lib/transform/logicAnd.js +67 -0
- package/lib/transform/logicOr.js +67 -0
- package/lib/transform/map.js +115 -0
- package/lib/transform/max.js +57 -0
- package/lib/transform/maxLength.js +39 -0
- package/lib/transform/min.js +57 -0
- package/lib/transform/minDelta.js +40 -0
- package/lib/transform/offDelay.js +89 -0
- package/lib/transform/onDelay.js +89 -0
- package/lib/transform/patternEscape.js +24 -0
- package/lib/transform/patternMatch.js +194 -0
- package/lib/transform/patternReplace.js +170 -0
- package/lib/transform/patternTest.js +85 -0
- package/lib/transform/rateOfChange.js +56 -0
- package/lib/transform/reject.js +115 -0
- package/lib/transform/resample.js +96 -0
- package/lib/transform/risingEdge.js +90 -0
- package/lib/transform/risingEdgeCounter.js +179 -0
- package/lib/transform/sampleInterval.js +12 -0
- package/lib/transform/source.js +116 -0
- package/lib/transform/state.js +201 -0
- package/lib/transform/threshold.js +52 -0
- package/lib/transform/toBuffer.js +159 -0
- package/lib/transform/toggle.js +118 -0
- package/lib/transform/transformState.js +193 -0
- package/lib/transform/trim.js +27 -0
- package/lib/transform/util/chainSource.js +96 -0
- package/lib/transform/util/ringBuffer.js +34 -0
- package/lib/transform/valueChange.js +34 -0
- package/lib/transform/valueDecrease.js +38 -0
- package/lib/transform/valueIncrease.js +38 -0
- package/lib/transform/valueIncreaseDiff.js +66 -0
- package/lib/transform/whenUnavailable.js +73 -0
- package/lib/transform/windowCount.js +86 -0
- package/lib/util/fileUtil.js +44 -0
- package/package.json +38 -0
- package/test/.eslintrc.json +15 -0
- package/test/chainedTransform.test.js +88 -0
- package/test/conditions.test.js +118 -0
- package/test/config/ab-pccc.test.js +41 -0
- package/test/config/adam-6052.test.js +16 -0
- package/test/config/adapter.test.js +109 -0
- package/test/config/brother-http.test.js +19 -0
- package/test/config/ethernet-ip.test.js +19 -0
- package/test/config/ifm-iot.test.js +20 -0
- package/test/config/json-http.test.js +47 -0
- package/test/config/labjack-t4.test.js +78 -0
- package/test/config/labjack-t7.test.js +18 -0
- package/test/config/labjack-u3.test.js +17 -0
- package/test/config/modbusTcp.test.js +87 -0
- package/test/config/mqtt.test.js +19 -0
- package/test/config/mqttLincoln.test.js +29 -0
- package/test/config/mtconnect.test.js +63 -0
- package/test/config/mtconnectAdapter.test.js +124 -0
- package/test/config/mtconnectHaas.test.js +15 -0
- package/test/config/null.test.js +16 -0
- package/test/config/opcua.test.js +97 -0
- package/test/config-tests.js +102 -0
- package/test/configFiles/conditions.yml +37 -0
- package/test/configFiles/data-items-legacy.yml +24 -0
- package/test/configFiles/data-items-shorthand.yml +14 -0
- package/test/configFiles/data-items.yml +12 -0
- package/test/configFiles/device/ab-pccc-default.yml +3 -0
- package/test/configFiles/device/ab-pccc-full.yml +13 -0
- package/test/configFiles/device/adam-6052-default.yml +2 -0
- package/test/configFiles/device/brother-http-default.yml +3 -0
- package/test/configFiles/device/ethernet-ip-default.yml +2 -0
- package/test/configFiles/device/ifm-iot-default.yml +2 -0
- package/test/configFiles/device/json-http-bad-prop.yml +13 -0
- package/test/configFiles/device/json-http-bad-prop2.yml +13 -0
- package/test/configFiles/device/json-http-default.yml +3 -0
- package/test/configFiles/device/json-http-std.yml +13 -0
- package/test/configFiles/device/labjack-t4-condition-exprs.yaml +46 -0
- package/test/configFiles/device/labjack-t4-default.yml +3 -0
- package/test/configFiles/device/labjack-t4-pins-alt.yaml +41 -0
- package/test/configFiles/device/labjack-t4-pins.yaml +40 -0
- package/test/configFiles/device/labjack-t4-v1.yaml +29 -0
- package/test/configFiles/device/labjack-t7-default.yml +2 -0
- package/test/configFiles/device/labjack-u3-default.yml +2 -0
- package/test/configFiles/device/modbus-partial.yml +4 -0
- package/test/configFiles/device/modbus-std-extended.yaml +23 -0
- package/test/configFiles/device/modbus-std.yaml +34 -0
- package/test/configFiles/device/modbus-tcp-default.yml +3 -0
- package/test/configFiles/device/mqtt-default.yml +2 -0
- package/test/configFiles/device/mqtt-lincoln-default.yml +3 -0
- package/test/configFiles/device/mqtt-lincoln-full.yml +7 -0
- package/test/configFiles/device/mtconnect-adapter-default.yml +3 -0
- package/test/configFiles/device/mtconnect-adapter-keys.yaml +18 -0
- package/test/configFiles/device/mtconnect-complex-keys.yaml +17 -0
- package/test/configFiles/device/mtconnect-default.yml +3 -0
- package/test/configFiles/device/mtconnect-duplicate-allow-keys.yaml +10 -0
- package/test/configFiles/device/mtconnect-duplicate-declare-keys.yaml +8 -0
- package/test/configFiles/device/mtconnect-duplicate-deny-keys.yaml +10 -0
- package/test/configFiles/device/mtconnect-haas-default.yml +3 -0
- package/test/configFiles/device/mtconnect-std.yaml +18 -0
- package/test/configFiles/device/null-default.yml +1 -0
- package/test/configFiles/device/opcua-bad-tag.yml +18 -0
- package/test/configFiles/device/opcua-bad-tag2.yml +18 -0
- package/test/configFiles/device/opcua-default.yml +3 -0
- package/test/configFiles/device/opcua-std.yml +18 -0
- package/test/configFiles/dump-test.yml +11 -0
- package/test/configFiles/expressionCond.yml +46 -0
- package/test/configFiles/min-config-t4.yaml +4 -0
- package/test/configFiles/min-config-u3.yaml +3 -0
- package/test/configFiles/missing-device.yaml +2 -0
- package/test/configFiles/parse-error1.yml +9 -0
- package/test/configFiles/parse-error2.yml +9 -0
- package/test/configFiles/repro/buffer-convert-repro.yml +15 -0
- package/test/configFiles/repro/chained-delay-timing-repro.yml +13 -0
- package/test/configFiles/repro/count-init-repro.yml +45 -0
- package/test/configFiles/repro/cycle-break-repro.yml +44 -0
- package/test/configFiles/repro/debounce-repro.yml +46 -0
- package/test/configFiles/repro/diff-count-repro.yml +34 -0
- package/test/configFiles/repro/engine-hang-repro.yml +9 -0
- package/test/configFiles/repro/latch-apm-repro.yml +26 -0
- package/test/configFiles/repro/lockout-count-repro.yml +33 -0
- package/test/configFiles/repro/program-extract-repro.yml +38 -0
- package/test/configFiles/repro/state-latch-repro.yml +47 -0
- package/test/configFiles/repro/ternary-repro.yml +26 -0
- package/test/configFiles/transform/debounce.yml +12 -0
- package/test/configFiles/transform/expression.yml +34 -0
- package/test/configFiles/transform/ignoreValue.yml +31 -0
- package/test/configFiles/transform/latch.yml +11 -0
- package/test/configFiles/transform/latchValue.yml +31 -0
- package/test/configFiles/transform/logicAnd.yml +14 -0
- package/test/configFiles/transform/logicOr.yml +14 -0
- package/test/configFiles/transform/map.yml +19 -0
- package/test/configFiles/transform/maxLength.yml +13 -0
- package/test/configFiles/transform/offDelay.yml +12 -0
- package/test/configFiles/transform/pattern-escape.yml +10 -0
- package/test/configFiles/transform/pattern-match.yml +57 -0
- package/test/configFiles/transform/pattern-replace.yml +34 -0
- package/test/configFiles/transform/pattern-test.yml +25 -0
- package/test/configFiles/transform/reject.yml +24 -0
- package/test/configFiles/transform/risingEdgeCounter.yml +36 -0
- package/test/configFiles/transform/source.yml +20 -0
- package/test/configFiles/transform/state.yml +56 -0
- package/test/configFiles/transform/toggle.yml +19 -0
- package/test/configFiles/transform/whenUnavailable.yml +19 -0
- package/test/dataFiles/noisy-pulse.txt +11330 -0
- package/test/dataItems.test.js +140 -0
- package/test/engine-v1-tests.js +418 -0
- package/test/engine-v2-tests.js +284 -0
- package/test/expression-tests.js +171 -0
- package/test/expressionService.test.js +154 -0
- package/test/expressionServiceCondition.test.js +130 -0
- package/test/repro/buffer-convert-repro.test.js +38 -0
- package/test/repro/chained-delay-timing-repro.test.js +34 -0
- package/test/repro/count-init-repro.test.js +46 -0
- package/test/repro/cylce-break-repro.test.js +57 -0
- package/test/repro/debounce-repro.test.js +65 -0
- package/test/repro/diff-count-repro.test.js +79 -0
- package/test/repro/engine-hang-repro.test.js +38 -0
- package/test/repro/latch-apm-repro.test.js +119 -0
- package/test/repro/lockout-count-repro.test.js +84 -0
- package/test/repro/program-extract-repro.test.js +40 -0
- package/test/repro/state-latch-repro.test.js +63 -0
- package/test/repro/ternary-repro.test.js +43 -0
- package/test/transform/accumulte.test.js +18 -0
- package/test/transform/average.test.js +22 -0
- package/test/transform/debounce.test.js +70 -0
- package/test/transform/downsample.test.js +30 -0
- package/test/transform/edge.test.js +27 -0
- package/test/transform/expression.test.js +189 -0
- package/test/transform/fallingEdge.test.js +59 -0
- package/test/transform/fromBuffer.test.js +60 -0
- package/test/transform/hash.test.js +34 -0
- package/test/transform/ignoreValue.test.js +123 -0
- package/test/transform/invert.test.js +26 -0
- package/test/transform/latch.test.js +33 -0
- package/test/transform/latchValue.test.js +126 -0
- package/test/transform/logicAnd.test.js +80 -0
- package/test/transform/logicOr.test.js +80 -0
- package/test/transform/map.test.js +42 -0
- package/test/transform/max.test.js +30 -0
- package/test/transform/maxLength.test.js +32 -0
- package/test/transform/min.test.js +30 -0
- package/test/transform/minDelta.test.js +14 -0
- package/test/transform/offDelay.test.js +123 -0
- package/test/transform/onDelay.test.js +105 -0
- package/test/transform/patternEscape.test.js +18 -0
- package/test/transform/patternMatch.test.js +177 -0
- package/test/transform/patternReplace.test.js +95 -0
- package/test/transform/patternTest.test.js +105 -0
- package/test/transform/rateOfChange.test.js +34 -0
- package/test/transform/reject.test.js +56 -0
- package/test/transform/resample.test.js +193 -0
- package/test/transform/risingEdge.test.js +60 -0
- package/test/transform/risingEdgeCounter.test.js +227 -0
- package/test/transform/sampleInterval.test.js +22 -0
- package/test/transform/source.test.js +137 -0
- package/test/transform/state.test.js +248 -0
- package/test/transform/threshold.test.js +78 -0
- package/test/transform/toBuffer.test.js +60 -0
- package/test/transform/toggle.test.js +92 -0
- package/test/transform/trim.test.js +30 -0
- package/test/transform/valueChange.test.js +14 -0
- package/test/transform/valueDecrease.test.js +32 -0
- package/test/transform/valueIncrease.test.js +32 -0
- package/test/transform/valueIncreaseDiff.test.js +32 -0
- package/test/transform/whenUnavailable.test.js +93 -0
- package/test/transform/windowCount.test.js +26 -0
- package/test/util/testUtils.js +405 -0
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
- program_comment
|
|
9
|
+
- part_variant
|
|
10
|
+
- avail
|
|
11
|
+
variables:
|
|
12
|
+
extract:
|
|
13
|
+
- source: program_comment
|
|
14
|
+
- pattern-match:
|
|
15
|
+
pattern: /\(DNCI[^)]*\)[^)]*(?:\([^0-9)]*\)[^(]*?)?\(([^)]*?[0-9-]{4,}[^)]*?)\)/
|
|
16
|
+
group: 1
|
|
17
|
+
part_name_template:
|
|
18
|
+
- source: extract
|
|
19
|
+
- pattern-match:
|
|
20
|
+
pattern: /^(?:ALPHATEC-SPINE-|(?:[A-Za-z]+(?:[\s\-_&]?[A-Za-z2]*)*(?:[\s*_]|--))?)#?((?:[A-Za-z][A-Za-z\d]*-?)?[\dXKMLV]*(?:(?:[\-\/+._]|\sTHRU\s)[\dXKML]+)*)/
|
|
21
|
+
group: 1
|
|
22
|
+
range_pattern:
|
|
23
|
+
- source: part_name_template
|
|
24
|
+
- pattern-match:
|
|
25
|
+
pattern: /(?<=-)(X{2,3}|\d{1,3}[\/+_]\d{1,3}|\d*\sTHRU\s.*$)/
|
|
26
|
+
group: 1
|
|
27
|
+
character_count:
|
|
28
|
+
- source: range_pattern
|
|
29
|
+
- pattern-match:
|
|
30
|
+
pattern: /(?:^|[\/+_-])([X\d]+)$/
|
|
31
|
+
group: 1
|
|
32
|
+
- expression: size(this)
|
|
33
|
+
part_name:
|
|
34
|
+
- source: 'range_pattern == "" ? part_name_template : replace(part_name_template, range_pattern, lpad(part_variant, character_count, "0"))'
|
|
35
|
+
data-items:
|
|
36
|
+
- avail
|
|
37
|
+
- part_name_template
|
|
38
|
+
- part_name
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
- off-delay: 0.1
|
|
10
|
+
trigger-2:
|
|
11
|
+
- source: AIN1
|
|
12
|
+
- threshold: 5
|
|
13
|
+
- rising-edge
|
|
14
|
+
- off-delay: 0.1
|
|
15
|
+
trigger-3:
|
|
16
|
+
- source: AIN2
|
|
17
|
+
- threshold: 5
|
|
18
|
+
- rising-edge
|
|
19
|
+
- off-delay: 0.1
|
|
20
|
+
trigger-4:
|
|
21
|
+
- source: AIN3
|
|
22
|
+
- threshold: 5
|
|
23
|
+
- rising-edge
|
|
24
|
+
- off-delay: 0.1
|
|
25
|
+
trigger-reset:
|
|
26
|
+
- source: trigger-1 or trigger-2 or trigger-3 or trigger-4
|
|
27
|
+
- off-delay: 10
|
|
28
|
+
- falling-edge
|
|
29
|
+
- off-delay: 0.1
|
|
30
|
+
counter-switch:
|
|
31
|
+
- state:
|
|
32
|
+
- TR1: trigger-1
|
|
33
|
+
- TR2: trigger-2
|
|
34
|
+
- TR3: trigger-3
|
|
35
|
+
- TR4: trigger-4
|
|
36
|
+
- IDLE: true
|
|
37
|
+
- latch-value:
|
|
38
|
+
reset: trigger-reset
|
|
39
|
+
reset-value: IDLE
|
|
40
|
+
latch-on-change: true
|
|
41
|
+
part-count:
|
|
42
|
+
- source: trigger-1 and counter-switch == "TR1"
|
|
43
|
+
- or: trigger-2 and counter-switch == "TR2"
|
|
44
|
+
- or: trigger-3 and counter-switch == "TR3"
|
|
45
|
+
- or: trigger-4 and counter-switch == "TR4"
|
|
46
|
+
- rising-edge
|
|
47
|
+
- count
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
- program_comment
|
|
8
|
+
variables:
|
|
9
|
+
parsed_program1:
|
|
10
|
+
- source: program_comment
|
|
11
|
+
- pattern-match:
|
|
12
|
+
pattern: /\s*PART# ([^.)]*)/
|
|
13
|
+
parsed_program2:
|
|
14
|
+
- source: program_comment
|
|
15
|
+
- pattern-match:
|
|
16
|
+
pattern: /\(([^.)]*)/
|
|
17
|
+
group: 1
|
|
18
|
+
parsed_program:
|
|
19
|
+
- source: parsed_program1 == '' ? parsed_program2:parsed_program1
|
|
20
|
+
data-items:
|
|
21
|
+
operation_name:
|
|
22
|
+
value: parsed_program
|
|
23
|
+
temp_name1:
|
|
24
|
+
value: parsed_program1
|
|
25
|
+
temp_name2:
|
|
26
|
+
value: parsed_program2
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- xact
|
|
7
|
+
- counter
|
|
8
|
+
- data1
|
|
9
|
+
- data2
|
|
10
|
+
- data3
|
|
11
|
+
variables:
|
|
12
|
+
var1:
|
|
13
|
+
- source: xact
|
|
14
|
+
- expression: this + 5
|
|
15
|
+
var2:
|
|
16
|
+
- source: xact
|
|
17
|
+
- expression: "this > 5 ? 0 : this + counter"
|
|
18
|
+
var3:
|
|
19
|
+
- source: xact
|
|
20
|
+
- expression: counter + 10
|
|
21
|
+
var4:
|
|
22
|
+
- expression: xact + 5
|
|
23
|
+
var5:
|
|
24
|
+
- expression: this + xact + 5
|
|
25
|
+
var6:
|
|
26
|
+
- source: data1
|
|
27
|
+
- expression: this.foo + 5
|
|
28
|
+
var7:
|
|
29
|
+
- source: data2
|
|
30
|
+
- expression: this.foo.bar + 5
|
|
31
|
+
var8:
|
|
32
|
+
- source: data3
|
|
33
|
+
- expression: this.foo
|
|
34
|
+
- expression: this.bar + 5
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- program
|
|
7
|
+
- pmode
|
|
8
|
+
variables:
|
|
9
|
+
test1:
|
|
10
|
+
- source: program
|
|
11
|
+
- ignore-value: warmup
|
|
12
|
+
test2:
|
|
13
|
+
- source: program
|
|
14
|
+
- ignore-value: ""
|
|
15
|
+
test3:
|
|
16
|
+
- source: program
|
|
17
|
+
- ignore-value:
|
|
18
|
+
pattern: /warmup\d*/
|
|
19
|
+
test4:
|
|
20
|
+
- source: program
|
|
21
|
+
- ignore-value:
|
|
22
|
+
expression: this == "warmup"
|
|
23
|
+
test5:
|
|
24
|
+
- source: program
|
|
25
|
+
- ignore-value:
|
|
26
|
+
expression: pmode == 5
|
|
27
|
+
test6:
|
|
28
|
+
- source: program
|
|
29
|
+
- ignore-value:
|
|
30
|
+
value: warmup
|
|
31
|
+
default: null
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- program
|
|
7
|
+
- pmode
|
|
8
|
+
variables:
|
|
9
|
+
test1:
|
|
10
|
+
- source: program
|
|
11
|
+
- latch-value
|
|
12
|
+
test2:
|
|
13
|
+
- source: program
|
|
14
|
+
- latch-value:
|
|
15
|
+
reset: pmode == 5
|
|
16
|
+
test3:
|
|
17
|
+
- source: program
|
|
18
|
+
- latch-value:
|
|
19
|
+
reset: pmode == 5
|
|
20
|
+
latch-on-change: true
|
|
21
|
+
test4:
|
|
22
|
+
- source: program
|
|
23
|
+
- latch-value:
|
|
24
|
+
reset: pmode == 5
|
|
25
|
+
reset-value: O0000
|
|
26
|
+
test5:
|
|
27
|
+
- source: program
|
|
28
|
+
- latch-value:
|
|
29
|
+
reset: pmode == 5
|
|
30
|
+
reset-value: O0000
|
|
31
|
+
latch-on-change: true
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- active
|
|
7
|
+
- counter
|
|
8
|
+
- program
|
|
9
|
+
- complex
|
|
10
|
+
variables:
|
|
11
|
+
var1:
|
|
12
|
+
- source: counter
|
|
13
|
+
- map:
|
|
14
|
+
- value-increase
|
|
15
|
+
- count
|
|
16
|
+
var2:
|
|
17
|
+
- source: complex
|
|
18
|
+
- map:
|
|
19
|
+
- expression: this.subkey
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- program
|
|
7
|
+
- program8
|
|
8
|
+
- program9
|
|
9
|
+
- pat1
|
|
10
|
+
variables:
|
|
11
|
+
match1:
|
|
12
|
+
- source: program
|
|
13
|
+
- pattern-match: /test\d+/i
|
|
14
|
+
match2:
|
|
15
|
+
- source: program
|
|
16
|
+
- pattern-match: "test\\d+"
|
|
17
|
+
match3:
|
|
18
|
+
- source: program
|
|
19
|
+
- pattern-match:
|
|
20
|
+
pattern: /test(\d+)/i
|
|
21
|
+
group: 1
|
|
22
|
+
else: NOMATCH
|
|
23
|
+
match4:
|
|
24
|
+
- source: program
|
|
25
|
+
- pattern-match: /test${pat1}/i
|
|
26
|
+
match5:
|
|
27
|
+
- source: program
|
|
28
|
+
- pattern-match:
|
|
29
|
+
pattern: /test(${pat1})/i
|
|
30
|
+
group: 1
|
|
31
|
+
else: no match ${this}
|
|
32
|
+
match6:
|
|
33
|
+
- source: program
|
|
34
|
+
- pattern-match:
|
|
35
|
+
pattern: /[\w.-]+/
|
|
36
|
+
index: 1
|
|
37
|
+
match7:
|
|
38
|
+
- source: program
|
|
39
|
+
- pattern-match:
|
|
40
|
+
pattern: /([\w.-]+)\./
|
|
41
|
+
group: 1
|
|
42
|
+
index: 1
|
|
43
|
+
match8:
|
|
44
|
+
- source: program8
|
|
45
|
+
- pattern-match:
|
|
46
|
+
pattern: /([\w.-]+)\./g
|
|
47
|
+
match9:
|
|
48
|
+
- source: program9
|
|
49
|
+
- pattern-match:
|
|
50
|
+
pattern: /([\w.-]+)\./g
|
|
51
|
+
group: 1
|
|
52
|
+
match10:
|
|
53
|
+
- source: program
|
|
54
|
+
- pattern-match:
|
|
55
|
+
pattern: /test(\d+)/i
|
|
56
|
+
group: 1
|
|
57
|
+
else: 0
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- program
|
|
7
|
+
- xact
|
|
8
|
+
- yact
|
|
9
|
+
- pat1
|
|
10
|
+
- pat2
|
|
11
|
+
variables:
|
|
12
|
+
replace1:
|
|
13
|
+
- source: program
|
|
14
|
+
- pattern-replace:
|
|
15
|
+
pattern: /test\d+/
|
|
16
|
+
with: heck
|
|
17
|
+
replace2:
|
|
18
|
+
- source: program
|
|
19
|
+
- pattern-replace:
|
|
20
|
+
pattern: /test(\d+)/i
|
|
21
|
+
with: foo$1
|
|
22
|
+
else: NOMATCH
|
|
23
|
+
replace3:
|
|
24
|
+
- source: program
|
|
25
|
+
- pattern-replace:
|
|
26
|
+
pattern: /test${pat1}+/
|
|
27
|
+
with: heck ${xact}
|
|
28
|
+
else: coord ${xact},${yact} (${this})
|
|
29
|
+
replace4:
|
|
30
|
+
- source: program
|
|
31
|
+
- pattern-replace:
|
|
32
|
+
pattern: ${pat2}
|
|
33
|
+
with: ${xact * yact}
|
|
34
|
+
else: ${xact + yact}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- program
|
|
7
|
+
- pat1
|
|
8
|
+
variables:
|
|
9
|
+
test1:
|
|
10
|
+
- source: program
|
|
11
|
+
- pattern-test: /test\d+/
|
|
12
|
+
test2:
|
|
13
|
+
- source: program
|
|
14
|
+
- pattern-test: "test\\d+"
|
|
15
|
+
test3:
|
|
16
|
+
- source: program
|
|
17
|
+
- pattern-test:
|
|
18
|
+
pattern: /test(\d+)/i
|
|
19
|
+
test4:
|
|
20
|
+
- source: program
|
|
21
|
+
- pattern-test: /test${pat1}/
|
|
22
|
+
test5:
|
|
23
|
+
- source: program
|
|
24
|
+
- pattern-test:
|
|
25
|
+
pattern: /test(${pat1})/i
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- program
|
|
7
|
+
variables:
|
|
8
|
+
test1:
|
|
9
|
+
- source: program
|
|
10
|
+
- reject: warmup
|
|
11
|
+
test2:
|
|
12
|
+
- source: program
|
|
13
|
+
- reject: ""
|
|
14
|
+
test3:
|
|
15
|
+
- source: program
|
|
16
|
+
- reject: null
|
|
17
|
+
test4:
|
|
18
|
+
- source: program
|
|
19
|
+
- reject:
|
|
20
|
+
pattern: /warmup\d*/
|
|
21
|
+
test5:
|
|
22
|
+
- source: program
|
|
23
|
+
- reject:
|
|
24
|
+
expression: this == "warmup"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- active
|
|
7
|
+
- counter
|
|
8
|
+
- program
|
|
9
|
+
- ppc
|
|
10
|
+
variables:
|
|
11
|
+
var1:
|
|
12
|
+
- source: active
|
|
13
|
+
- count
|
|
14
|
+
var2:
|
|
15
|
+
- source: active
|
|
16
|
+
- count:
|
|
17
|
+
reset: program == 10
|
|
18
|
+
var3:
|
|
19
|
+
- source: active
|
|
20
|
+
- count:
|
|
21
|
+
reset: this >= 3
|
|
22
|
+
var4:
|
|
23
|
+
- source: active
|
|
24
|
+
- count: 5
|
|
25
|
+
var5:
|
|
26
|
+
- source: active
|
|
27
|
+
- count:
|
|
28
|
+
amount: 5
|
|
29
|
+
reset: this > 10
|
|
30
|
+
var6:
|
|
31
|
+
- source: active
|
|
32
|
+
- count:
|
|
33
|
+
merge-window: 3
|
|
34
|
+
var7:
|
|
35
|
+
- source: active
|
|
36
|
+
- count: ppc
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- xact
|
|
7
|
+
- yact
|
|
8
|
+
- execution
|
|
9
|
+
variables:
|
|
10
|
+
var1:
|
|
11
|
+
- source: xact
|
|
12
|
+
var2:
|
|
13
|
+
- source: xact + 10
|
|
14
|
+
var3:
|
|
15
|
+
- source: xact + yact
|
|
16
|
+
var4:
|
|
17
|
+
- source: xact
|
|
18
|
+
- expression: this + yact
|
|
19
|
+
var5:
|
|
20
|
+
- source: execution != 'MANUAL'
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- is-running
|
|
7
|
+
- exec
|
|
8
|
+
- in-fault
|
|
9
|
+
variables:
|
|
10
|
+
test1:
|
|
11
|
+
- source: exec
|
|
12
|
+
- state:
|
|
13
|
+
- ACTIVE: this == 'ACTIVE' and not in-fault
|
|
14
|
+
- STOPPED: this == 'ACTIVE' and in-fault
|
|
15
|
+
test2:
|
|
16
|
+
- source: exec
|
|
17
|
+
- state:
|
|
18
|
+
- STOPPED: this == 'ACTIVE' and in-fault
|
|
19
|
+
test3:
|
|
20
|
+
- source: is-running
|
|
21
|
+
- state:
|
|
22
|
+
- ACTIVE: this
|
|
23
|
+
- READY: true
|
|
24
|
+
test4:
|
|
25
|
+
- source: exec
|
|
26
|
+
- state:
|
|
27
|
+
- select: This is a long active message
|
|
28
|
+
when: this == 'ACTIVE' and not in-fault
|
|
29
|
+
- select: This is a long stop message
|
|
30
|
+
when: this == 'ACTIVE' and in-fault
|
|
31
|
+
- select: This is a default message
|
|
32
|
+
when: true
|
|
33
|
+
test5:
|
|
34
|
+
- source: true
|
|
35
|
+
- state:
|
|
36
|
+
- ACTIVE: exec == 'ACTIVE' and not in-fault
|
|
37
|
+
- STOPPED: exec == 'ACTIVE' and in-fault
|
|
38
|
+
- READY: true
|
|
39
|
+
test6:
|
|
40
|
+
- state:
|
|
41
|
+
- ACTIVE: exec == 'ACTIVE' and not in-fault
|
|
42
|
+
- STOPPED: exec == 'ACTIVE' and in-fault
|
|
43
|
+
- READY: true
|
|
44
|
+
test7:
|
|
45
|
+
- state:
|
|
46
|
+
- ACTIVE: this == 'ACTIVE' and not in-fault
|
|
47
|
+
- STOPPED: this == 'ACTIVE' and in-fault
|
|
48
|
+
- READY: true
|
|
49
|
+
test8:
|
|
50
|
+
- state:
|
|
51
|
+
- ACTIVE: is-running
|
|
52
|
+
test9:
|
|
53
|
+
- state:
|
|
54
|
+
- 10: not in-fault
|
|
55
|
+
- 20: in-fault
|
|
56
|
+
- expression: this + exec
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- active
|
|
7
|
+
- program
|
|
8
|
+
variables:
|
|
9
|
+
var1:
|
|
10
|
+
- source: active
|
|
11
|
+
- toggle
|
|
12
|
+
var2:
|
|
13
|
+
- source: active
|
|
14
|
+
- toggle:
|
|
15
|
+
default: true
|
|
16
|
+
var3:
|
|
17
|
+
- source: active
|
|
18
|
+
- toggle:
|
|
19
|
+
reset: program == 10
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
device: mtconnect-adapter
|
|
3
|
+
endpoint: localhost:8001
|
|
4
|
+
mtconnect-port: 8002
|
|
5
|
+
declare-keys:
|
|
6
|
+
- active
|
|
7
|
+
- counter
|
|
8
|
+
variables:
|
|
9
|
+
var1:
|
|
10
|
+
- source: active
|
|
11
|
+
- when-unavailable: false
|
|
12
|
+
var2:
|
|
13
|
+
- source: active
|
|
14
|
+
- when-unavailable: counter
|
|
15
|
+
var3:
|
|
16
|
+
- source: active
|
|
17
|
+
- when-unavailable: false
|
|
18
|
+
- falling-edge
|
|
19
|
+
- count
|